summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2010-02-20 03:48:25 +0000
committerjoerg <joerg@pkgsrc.org>2010-02-20 03:48:25 +0000
commit813e1c65cfea70db0fa02bd006013a08731f470f (patch)
treef2e9909a57c8ba8f986b13e36ed04e225fc44b2a
parenta3bb8bd3027e67eb07c16f479613f290fb214f4a (diff)
downloadpkgsrc-813e1c65cfea70db0fa02bd006013a08731f470f.tar.gz
Import libarchive 2.8.0:
- Infrastructure: - Allow command line tools as fallback for missing compression libraries. If compiled without gzip for example, gunzip will be used automatically. - Improved support for a number of platforms like high-resolution timestamps and Extended Attributes on various Unix systems - New convience interface for creating archives based on disk content, complement of the archive_write_disk interface. - Frontends: - bsdcpio ready for public consumption - hand-written date parser replaces the yacc code - Filter system: - Simplified read filter chains - Option support for filters - LZMA, XZ, uudecode handled - Format support: - Write support for mtree files based on file system or archive content - Basic read support for Joliet - Write support for zip files - Write support for shar archives, both text-only and binary-safe
-rw-r--r--archivers/libarchive/files/CMakeLists.txt746
-rw-r--r--archivers/libarchive/files/COPYING4
-rw-r--r--archivers/libarchive/files/INSTALL30
-rw-r--r--archivers/libarchive/files/Makefile.am295
-rw-r--r--archivers/libarchive/files/Makefile.in2880
-rw-r--r--archivers/libarchive/files/NEWS93
-rw-r--r--archivers/libarchive/files/README52
-rw-r--r--archivers/libarchive/files/aclocal.m410061
-rw-r--r--archivers/libarchive/files/build/autoconf/check_stdcall_func.m451
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/compile142
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/config.guess1407
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/config.sub1504
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/depcomp589
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/install-sh519
-rw-r--r--archivers/libarchive/files/build/autoconf/la_uid_t.m420
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/ltmain.sh8457
-rwxr-xr-xarchivers/libarchive/files/build/autoconf/missing367
-rwxr-xr-xarchivers/libarchive/files/build/autogen.sh64
-rw-r--r--archivers/libarchive/files/build/bump-version.sh36
-rw-r--r--archivers/libarchive/files/build/clean.sh81
-rw-r--r--archivers/libarchive/files/build/cmake/AddTest28.cmake107
-rw-r--r--archivers/libarchive/files/build/cmake/CheckFileOffsetBits.c14
-rw-r--r--archivers/libarchive/files/build/cmake/CheckFileOffsetBits.cmake44
-rw-r--r--archivers/libarchive/files/build/cmake/CheckFuncs.cmake49
-rw-r--r--archivers/libarchive/files/build/cmake/CheckFuncs_stub.c.in16
-rw-r--r--archivers/libarchive/files/build/cmake/CheckHeaderDirent.cmake32
-rw-r--r--archivers/libarchive/files/build/cmake/CheckStructMember.cmake43
-rw-r--r--archivers/libarchive/files/build/cmake/CheckTypeExists.cmake42
-rw-r--r--archivers/libarchive/files/build/cmake/FindLZMA.cmake52
-rw-r--r--archivers/libarchive/files/build/cmake/config.h.in723
-rw-r--r--archivers/libarchive/files/build/pkgconfig/libarchive.pc.in10
-rw-r--r--archivers/libarchive/files/build/version1
-rw-r--r--archivers/libarchive/files/build/windows/mvcpp.nt141
-rw-r--r--archivers/libarchive/files/build/windows/vc71/libarchive.sln23
-rw-r--r--archivers/libarchive/files/build/windows/vc71/libarchive.vcproj327
-rw-r--r--archivers/libarchive/files/build/windows/vc80/libarchive.sln25
-rw-r--r--archivers/libarchive/files/build/windows/vc80/libarchive.vcproj455
-rw-r--r--archivers/libarchive/files/build/windows/vc80/libarchive_test/libarchive_test.vcproj495
-rw-r--r--archivers/libarchive/files/build/windows/vc90/libarchive.sln25
-rw-r--r--archivers/libarchive/files/build/windows/vc90/libarchive.vcproj456
-rw-r--r--archivers/libarchive/files/build/windows/vc90/libarchive_test/libarchive_test.vcproj494
-rw-r--r--archivers/libarchive/files/build/windows/wccpp.nt131
-rw-r--r--archivers/libarchive/files/config.h.in266
-rwxr-xr-xarchivers/libarchive/files/configure27834
-rw-r--r--archivers/libarchive/files/configure.ac240
-rw-r--r--archivers/libarchive/files/contrib/libarchive.1aix53.spec27
-rw-r--r--archivers/libarchive/files/contrib/libarchive.spec27
-rw-r--r--archivers/libarchive/files/contrib/shar/shar.1128
-rw-r--r--archivers/libarchive/files/contrib/shar/shar.c314
-rw-r--r--archivers/libarchive/files/contrib/shar/tree.c542
-rw-r--r--archivers/libarchive/files/contrib/shar/tree.h115
-rw-r--r--archivers/libarchive/files/contrib/shar/tree_config.h78
-rw-r--r--archivers/libarchive/files/contrib/untar.c225
-rw-r--r--archivers/libarchive/files/cpio/CMakeLists.txt51
-rw-r--r--archivers/libarchive/files/cpio/bsdcpio.138
-rw-r--r--archivers/libarchive/files/cpio/cmdline.c359
-rw-r--r--archivers/libarchive/files/cpio/config_freebsd.h56
-rw-r--r--archivers/libarchive/files/cpio/cpio.c773
-rw-r--r--archivers/libarchive/files/cpio/cpio.h37
-rw-r--r--archivers/libarchive/files/cpio/cpio_platform.h45
-rw-r--r--archivers/libarchive/files/cpio/cpio_windows.c338
-rw-r--r--archivers/libarchive/files/cpio/cpio_windows.h72
-rw-r--r--archivers/libarchive/files/cpio/test/CMakeLists.txt79
-rw-r--r--archivers/libarchive/files/cpio/test/list.h13
-rw-r--r--archivers/libarchive/files/cpio/test/main.c2117
-rw-r--r--archivers/libarchive/files/cpio/test/test.h214
-rw-r--r--archivers/libarchive/files/cpio/test/test_0.c15
-rw-r--r--archivers/libarchive/files/cpio/test/test_basic.c141
-rw-r--r--archivers/libarchive/files/cpio/test/test_cmdline.c107
-rw-r--r--archivers/libarchive/files/cpio/test/test_format_newc.c157
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat.c107
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_B_upper.c52
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_C_upper.c62
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_J_upper.c56
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_L_upper.c101
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_Z_upper.c56
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_a.c33
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_c.c107
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_d.c30
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_f.c46
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_help.c3
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_l.c50
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_lzma.c56
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_m.c29
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_t.c58
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu5
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_u.c15
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_version.c8
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_y.c31
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_z.c28
-rw-r--r--archivers/libarchive/files/cpio/test/test_owner_parse.c97
-rw-r--r--archivers/libarchive/files/cpio/test/test_passthrough_dotdot.c76
-rw-r--r--archivers/libarchive/files/cpio/test/test_passthrough_reverse.c85
-rw-r--r--archivers/libarchive/files/cpio/test/test_pathmatch.c272
-rw-r--r--archivers/libarchive/files/doc/html/Makefile46
-rw-r--r--archivers/libarchive/files/doc/html/archive_entry.3.html694
-rw-r--r--archivers/libarchive/files/doc/html/archive_read.3.html820
-rw-r--r--archivers/libarchive/files/doc/html/archive_read_disk.3.html341
-rw-r--r--archivers/libarchive/files/doc/html/archive_util.3.html210
-rw-r--r--archivers/libarchive/files/doc/html/archive_write.3.html845
-rw-r--r--archivers/libarchive/files/doc/html/archive_write_disk.3.html421
-rw-r--r--archivers/libarchive/files/doc/html/bsdcpio.1.html519
-rw-r--r--archivers/libarchive/files/doc/html/bsdtar.1.html1014
-rw-r--r--archivers/libarchive/files/doc/html/cpio.5.html422
-rw-r--r--archivers/libarchive/files/doc/html/libarchive-formats.5.html375
-rw-r--r--archivers/libarchive/files/doc/html/libarchive.3.html329
-rw-r--r--archivers/libarchive/files/doc/html/libarchive_internals.3.html381
-rw-r--r--archivers/libarchive/files/doc/html/mtree.5.html339
-rw-r--r--archivers/libarchive/files/doc/html/tar.5.html1400
-rw-r--r--archivers/libarchive/files/doc/man/Makefile5
-rw-r--r--archivers/libarchive/files/doc/man/archive_entry.3810
-rw-r--r--archivers/libarchive/files/doc/man/archive_read.3861
-rw-r--r--archivers/libarchive/files/doc/man/archive_read_disk.3300
-rw-r--r--archivers/libarchive/files/doc/man/archive_util.3187
-rw-r--r--archivers/libarchive/files/doc/man/archive_write.3721
-rw-r--r--archivers/libarchive/files/doc/man/archive_write_disk.3286
-rw-r--r--archivers/libarchive/files/doc/man/bsdcpio.1114
-rw-r--r--archivers/libarchive/files/doc/man/bsdtar.1380
-rw-r--r--archivers/libarchive/files/doc/man/cpio.550
-rw-r--r--archivers/libarchive/files/doc/man/libarchive-formats.5152
-rw-r--r--archivers/libarchive/files/doc/man/libarchive.3206
-rw-r--r--archivers/libarchive/files/doc/man/libarchive_internals.395
-rw-r--r--archivers/libarchive/files/doc/man/mtree.531
-rw-r--r--archivers/libarchive/files/doc/man/tar.5244
-rw-r--r--archivers/libarchive/files/doc/mdoc2man.awk125
-rw-r--r--archivers/libarchive/files/doc/mdoc2wiki.awk448
-rw-r--r--archivers/libarchive/files/doc/pdf/Makefile46
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_entry.3.pdfbin0 -> 14134 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_read.3.pdfbin0 -> 23686 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_read_disk.3.pdfbin0 -> 12084 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_util.3.pdfbin0 -> 6977 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_write.3.pdfbin0 -> 22916 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/archive_write_disk.3.pdfbin0 -> 15096 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/bsdcpio.1.pdfbin0 -> 13957 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/bsdtar.1.pdfbin0 -> 32109 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/cpio.5.pdfbin0 -> 13389 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/libarchive-formats.5.pdfbin0 -> 17368 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/libarchive.3.pdfbin0 -> 13354 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/libarchive_internals.3.pdfbin0 -> 17135 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/mtree.5.pdfbin0 -> 9141 bytes
-rw-r--r--archivers/libarchive/files/doc/pdf/tar.5.pdfbin0 -> 32993 bytes
-rw-r--r--archivers/libarchive/files/doc/text/Makefile58
-rw-r--r--archivers/libarchive/files/doc/text/archive_entry.3.txt63
-rw-r--r--archivers/libarchive/files/doc/text/archive_read.3.txt151
-rw-r--r--archivers/libarchive/files/doc/text/archive_read_disk.3.txt204
-rw-r--r--archivers/libarchive/files/doc/text/archive_util.3.txt14
-rw-r--r--archivers/libarchive/files/doc/text/archive_write.3.txt90
-rw-r--r--archivers/libarchive/files/doc/text/archive_write_disk.3.txt6
-rw-r--r--archivers/libarchive/files/doc/text/bsdcpio.1.txt111
-rw-r--r--archivers/libarchive/files/doc/text/bsdtar.1.txt217
-rw-r--r--archivers/libarchive/files/doc/text/cpio.5.txt20
-rw-r--r--archivers/libarchive/files/doc/text/libarchive-formats.5.txt143
-rw-r--r--archivers/libarchive/files/doc/text/libarchive.3.txt2
-rw-r--r--archivers/libarchive/files/doc/text/libarchive_internals.3.txt2
-rw-r--r--archivers/libarchive/files/doc/text/mtree.5.txt48
-rw-r--r--archivers/libarchive/files/doc/text/tar.5.txt155
-rwxr-xr-xarchivers/libarchive/files/doc/update.sh98
-rw-r--r--archivers/libarchive/files/doc/wiki/Makefile46
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveEntry3.wiki504
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveRead3.wiki694
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveReadDisk3.wiki287
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveUtil3.wiki146
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveWrite3.wiki630
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageArchiveWriteDisk3.wiki358
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageBsdcpio1.wiki386
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageBsdtar1.wiki941
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageCpio5.wiki297
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageLibarchive3.wiki302
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageLibarchiveFormats5.wiki327
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageLibarchiveInternals3.wiki337
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageMtree5.wiki237
-rw-r--r--archivers/libarchive/files/doc/wiki/ManPageTar5.wiki805
-rw-r--r--archivers/libarchive/files/examples/minitar/minitar.c146
-rw-r--r--archivers/libarchive/files/examples/untar.c109
-rw-r--r--archivers/libarchive/files/libarchive/CMakeLists.txt139
-rw-r--r--archivers/libarchive/files/libarchive/archive.h241
-rw-r--r--archivers/libarchive/files/libarchive/archive_check_magic.c26
-rw-r--r--archivers/libarchive/files/libarchive/archive_endian.h24
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry.c491
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry.h83
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_copy_bhfi.c74
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_copy_stat.c20
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_link_resolver.c22
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_private.h21
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_stat.c22
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_xattr.c158
-rw-r--r--archivers/libarchive/files/libarchive/archive_hash.h196
-rw-r--r--archivers/libarchive/files/libarchive/archive_platform.h57
-rw-r--r--archivers/libarchive/files/libarchive/archive_private.h41
-rw-r--r--archivers/libarchive/files/libarchive/archive_read.3123
-rw-r--r--archivers/libarchive/files/libarchive/archive_read.c840
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_disk.3308
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_disk.c198
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c563
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_disk_private.h62
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_disk_set_standard_lookup.c272
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_open_fd.c71
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_open_file.c52
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_open_filename.c171
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_private.h158
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_all.c27
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c479
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_compress.c257
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c698
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_none.c340
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_program.c518
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_rpm.c287
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_uu.c627
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_xz.c708
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_all.c3
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_ar.c81
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c168
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_empty.c11
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c2584
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c102
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_raw.c185
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_tar.c189
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_xar.c3150
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_zip.c214
-rw-r--r--archivers/libarchive/files/libarchive/archive_string.c334
-rw-r--r--archivers/libarchive/files/libarchive/archive_string.h23
-rw-r--r--archivers/libarchive/files/libarchive/archive_string_sprintf.c38
-rw-r--r--archivers/libarchive/files/libarchive/archive_util.311
-rw-r--r--archivers/libarchive/files/libarchive/archive_util.c232
-rw-r--r--archivers/libarchive/files/libarchive/archive_virtual.c21
-rw-r--r--archivers/libarchive/files/libarchive/archive_windows.c1310
-rw-r--r--archivers/libarchive/files/libarchive/archive_windows.h396
-rw-r--r--archivers/libarchive/files/libarchive/archive_write.385
-rw-r--r--archivers/libarchive/files/libarchive/archive_write.c118
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk.36
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk.c731
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk_private.h6
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c68
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_open_fd.c11
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_open_filename.c49
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_private.h13
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c208
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_compress.c6
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c255
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_none.c6
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_program.c8
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_xz.c438
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format.c4
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_ar.c7
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_by_name.c6
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c111
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c46
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_mtree.c1050
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_pax.c97
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_shar.c448
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c11
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_zip.c667
-rw-r--r--archivers/libarchive/files/libarchive/config_freebsd.h44
-rw-r--r--archivers/libarchive/files/libarchive/filter_fork.c16
-rw-r--r--archivers/libarchive/files/libarchive/filter_fork.h6
-rw-r--r--archivers/libarchive/files/libarchive/filter_fork_windows.c113
-rw-r--r--archivers/libarchive/files/libarchive/libarchive-formats.5133
-rw-r--r--archivers/libarchive/files/libarchive/tar.5153
-rw-r--r--archivers/libarchive/files/libarchive/test/CMakeLists.txt158
-rw-r--r--archivers/libarchive/files/libarchive/test/README63
-rw-r--r--archivers/libarchive/files/libarchive/test/list.h51
-rw-r--r--archivers/libarchive/files/libarchive/test/main.c2110
-rw-r--r--archivers/libarchive/files/libarchive/test/read_open_memory.c53
-rw-r--r--archivers/libarchive/files/libarchive/test/test.h237
-rw-r--r--archivers/libarchive/files/libarchive/test/test_acl_basic.c13
-rw-r--r--archivers/libarchive/files/libarchive/test/test_acl_freebsd.c255
-rw-r--r--archivers/libarchive/files/libarchive/test/test_acl_pax.c42
-rw-r--r--archivers/libarchive/files/libarchive/test/test_bad_fd.c8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_bzip2.c85
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_bzip2_1.tbz.uu24
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_bzip2_2.tbz.uu11
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_cpio.c106
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_cpio_1.cpio.uu19
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gtar.c25
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tar.uu232
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gzip.c97
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gzip_1.tgz.uu24
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gzip_2.tgz.uu11
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_lzma.c155
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_lzma_1.tlz.uu10
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_lzma_2.tlz.uu9
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_lzma_3.tlz.uu9
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.c128
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.tar.uu61
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c6
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_xz.c84
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_xz_1.txz.uu13
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_zip.c23
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu1
-rw-r--r--archivers/libarchive/files/libarchive/test/test_empty_write.c87
-rw-r--r--archivers/libarchive/files/libarchive/test/test_entry.c213
-rw-r--r--archivers/libarchive/files/libarchive/test/test_entry_strmode.c33
-rw-r--r--archivers/libarchive/files/libarchive/test/test_extattr_freebsd.c172
-rw-r--r--archivers/libarchive/files/libarchive/test/test_fuzz.c166
-rw-r--r--archivers/libarchive/files/libarchive/test/test_fuzz_1.iso.Z.uu495
-rw-r--r--archivers/libarchive/files/libarchive/test/test_open_fd.c128
-rw-r--r--archivers/libarchive/files/libarchive/test/test_open_file.c108
-rw-r--r--archivers/libarchive/files/libarchive/test/test_open_filename.c109
-rw-r--r--archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c52
-rw-r--r--archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.tar.uu118
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_compress_program.c61
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_data_large.c44
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_disk.c172
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_disk_entry_from_file.c80
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_extract.c103
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_file_nonexistent.c37
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_ar.ar.uu12
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_ar.c44
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin.c8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_Z.c30
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.c55
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.cpio.uu8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_bz2.c24
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_gz.c34
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_lzma.c60
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_xz.c70
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c127
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu47
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip.c33
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c127
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu46
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4c_Z.c28
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_empty.c14
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_gz.c32
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_lzma.c78
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c43
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu1370
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu1370
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu1597
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu1370
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu1370
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu1
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso.iso.Z.uu26
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_gz.c57
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet.iso.Z.uu66
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu71
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu68
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.c94
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu67
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu206
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu63
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu208
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu304
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu63
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_bz2.c134
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_long.c141
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_rr.c159
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c212
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isorr_ce.c223
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isorr_new_bz2.c204
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isorr_rr_moved.c270
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isozisofs_bz2.c187
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_mtree.c98
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_mtree.mtree.uu13
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_pax_bz2.c30
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_raw.c89
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_raw.data.Z.uu5
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_raw.data.uu5
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tar.c33
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.c8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.tar.uu1
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tbz.c30
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tgz.c32
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tlz.c60
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_txz.c63
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tz.c27
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_xar.c697
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_zip.c36
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_zip.zip.uu23
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_large.c41
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c89
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_position.c71
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_truncated.c24
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_uu.c134
-rw-r--r--archivers/libarchive/files/libarchive/test/test_tar_filenames.c20
-rw-r--r--archivers/libarchive/files/libarchive/test/test_tar_large.c64
-rw-r--r--archivers/libarchive/files/libarchive/test/test_ustar_filenames.c18
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress.c20
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress_bzip2.c228
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress_gzip.c252
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress_lzma.c245
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress_program.c67
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_compress_xz.c253
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk.c196
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_failures.c72
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c158
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_perms.c20
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_secure.c86
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_sparse.c280
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_symlink.c117
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_times.c167
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_ar.c108
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio.c47
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio_empty.c10
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c21
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c37
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_mtree.c155
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_pax.c146
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_shar_empty.c8
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_tar.c18
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_tar_empty.c20
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_tar_ustar.c11
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_zip.c180
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_zip_empty.c56
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_zip_no_compression.c304
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_open_memory.c10
-rw-r--r--archivers/libarchive/files/libarchive_fe/err.c74
-rw-r--r--archivers/libarchive/files/libarchive_fe/err.h41
-rw-r--r--archivers/libarchive/files/libarchive_fe/lafe_platform.h55
-rw-r--r--archivers/libarchive/files/libarchive_fe/line_reader.c171
-rw-r--r--archivers/libarchive/files/libarchive_fe/line_reader.h35
-rw-r--r--archivers/libarchive/files/libarchive_fe/matching.c284
-rw-r--r--archivers/libarchive/files/libarchive_fe/matching.h46
-rw-r--r--archivers/libarchive/files/libarchive_fe/pathmatch.c255
-rw-r--r--archivers/libarchive/files/libarchive_fe/pathmatch.h42
-rw-r--r--archivers/libarchive/files/tar/CMakeLists.txt55
-rw-r--r--archivers/libarchive/files/tar/bsdtar.1169
-rw-r--r--archivers/libarchive/files/tar/bsdtar.c535
-rw-r--r--archivers/libarchive/files/tar/bsdtar.h67
-rw-r--r--archivers/libarchive/files/tar/bsdtar_platform.h86
-rw-r--r--archivers/libarchive/files/tar/bsdtar_windows.c298
-rw-r--r--archivers/libarchive/files/tar/bsdtar_windows.h60
-rw-r--r--archivers/libarchive/files/tar/cmdline.c381
-rw-r--r--archivers/libarchive/files/tar/config_freebsd.h84
-rw-r--r--archivers/libarchive/files/tar/getdate.c2613
-rw-r--r--archivers/libarchive/files/tar/read.c167
-rw-r--r--archivers/libarchive/files/tar/subst.c46
-rw-r--r--archivers/libarchive/files/tar/test/CMakeLists.txt67
-rw-r--r--archivers/libarchive/files/tar/test/list.h16
-rw-r--r--archivers/libarchive/files/tar/test/main.c2221
-rw-r--r--archivers/libarchive/files/tar/test/test.h219
-rw-r--r--archivers/libarchive/files/tar/test/test_0.c11
-rw-r--r--archivers/libarchive/files/tar/test/test_basic.c113
-rw-r--r--archivers/libarchive/files/tar/test/test_copy.c398
-rw-r--r--archivers/libarchive/files/tar/test/test_empty_mtree.c45
-rw-r--r--archivers/libarchive/files/tar/test/test_getdate.c46
-rw-r--r--archivers/libarchive/files/tar/test/test_help.c3
-rw-r--r--archivers/libarchive/files/tar/test/test_option_T_upper.c188
-rw-r--r--archivers/libarchive/files/tar/test/test_option_q.c129
-rw-r--r--archivers/libarchive/files/tar/test/test_option_r.c117
-rw-r--r--archivers/libarchive/files/tar/test/test_option_s.c107
-rw-r--r--archivers/libarchive/files/tar/test/test_patterns.c151
-rw-r--r--archivers/libarchive/files/tar/test/test_patterns_2.tar.uu231
-rw-r--r--archivers/libarchive/files/tar/test/test_patterns_3.tar.uu231
-rw-r--r--archivers/libarchive/files/tar/test/test_patterns_4.tar.uu641
-rw-r--r--archivers/libarchive/files/tar/test/test_stdio.c33
-rw-r--r--archivers/libarchive/files/tar/test/test_strip_components.c109
-rw-r--r--archivers/libarchive/files/tar/test/test_symlink_dir.c160
-rw-r--r--archivers/libarchive/files/tar/test/test_version.c20
-rw-r--r--archivers/libarchive/files/tar/test/test_windows.c323
-rw-r--r--archivers/libarchive/files/tar/tree.c471
-rw-r--r--archivers/libarchive/files/tar/tree.h58
-rw-r--r--archivers/libarchive/files/tar/util.c478
-rw-r--r--archivers/libarchive/files/tar/write.c1090
455 files changed, 112486 insertions, 33358 deletions
diff --git a/archivers/libarchive/files/CMakeLists.txt b/archivers/libarchive/files/CMakeLists.txt
new file mode 100644
index 00000000000..42dc9fee555
--- /dev/null
+++ b/archivers/libarchive/files/CMakeLists.txt
@@ -0,0 +1,746 @@
+#
+#
+PROJECT(libarchive C)
+#
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin)
+endif()
+
+#
+# Version - read from 'version' file.
+#
+FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version)
+STRING(REGEX REPLACE
+ "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]?$" "\\1" _major ${_version})
+STRING(REGEX REPLACE
+ "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]?$" "\\1" _minor ${_version})
+STRING(REGEX REPLACE
+ "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]?$" "\\1" _revision ${_version})
+STRING(REGEX REPLACE
+ "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version})
+SET(_version_number ${_major}${_minor}${_revision})
+STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _minor ${_minor})
+STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _revision ${_revision})
+#
+SET(VERSION "${_major}.${_minor}.${_revision}${_quality}")
+SET(BSDCPIO_VERSION_STRING "${VERSION}")
+SET(BSDTAR_VERSION_STRING "${VERSION}")
+SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}")
+SET(LIBARCHIVE_VERSION_STRING "${VERSION}")
+# Shared library number
+SET(SOVERSION 8)
+
+# Enable CTest/CDash support
+include(CTest)
+
+# Provide ADD_TEST_28 macro to approximate CMake 2.8 ADD_TEST(NAME).
+# TODO: Require CMake 2.8 and drop this workaround (perhaps late 2010).
+INCLUDE(AddTest28)
+
+OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
+OPTION(ENABLE_TAR "Enable tar building" ON)
+OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" OFF)
+OPTION(ENABLE_CPIO "Enable cpio building" ON)
+OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" OFF)
+OPTION(ENABLE_XATTR "Enable extended attribute support" ON)
+OPTION(ENABLE_ACL "Enable ACL support" ON)
+OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
+
+IF(ENABLE_TEST)
+ ENABLE_TESTING()
+ENDIF(ENABLE_TEST)
+IF(WIN32 AND NOT CYGWIN)
+ # Currently, dynamic build only.
+ SET(ENABLE_TAR_SHARED ON)
+ SET(ENABLE_CPIO_SHARED ON)
+ENDIF(WIN32 AND NOT CYGWIN)
+
+IF(WIN32)
+ SET(_WIN32_WINNT 0x0500 CACHE INTERNAL "Setting _WIN32_WINNT to 0x0500 for Windows 2000 APIs")
+ SET(WINVER 0x0500 CACHE INTERNAL "Setting WINVER to 0x0500 for Windows 2000 APIs")
+ENDIF(WIN32)
+
+#
+INCLUDE(CheckCSourceRuns)
+INCLUDE(CheckFileOffsetBits)
+INCLUDE(CheckFuncs)
+INCLUDE(CheckHeaderDirent)
+INCLUDE(CheckIncludeFile)
+INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckLibraryExists)
+INCLUDE(CheckStructMember)
+INCLUDE(CheckSymbolExists)
+INCLUDE(CheckTypeExists)
+INCLUDE(CheckTypeSize)
+
+#
+# Generate list.h
+#
+MACRO (GENERATE_LIST_H _listfile _cmlist __list_sources)
+ SET(_argv ${ARGV})
+ # Remove _listfile and _cmlist from _argv
+ LIST(REMOVE_AT _argv 0 1)
+ IF (NOT EXISTS "${_listfile}" OR
+ ${_cmlist} IS_NEWER_THAN "${_listfile}")
+
+ MESSAGE(STATUS "Generating ${_listfile}")
+ FILE(WRITE ${_listfile} "")
+ FOREACH (testfile ${_argv})
+ IF (testfile MATCHES "^test_[^/]+[.]c$")
+ FILE(STRINGS ${testfile} testvar REGEX "^DEFINE_TEST")
+ FOREACH (deftest ${testvar})
+ FILE(APPEND ${_listfile} "${deftest}\n")
+ ENDFOREACH (deftest)
+ ENDIF (testfile MATCHES "^test_[^/]+[.]c$")
+ ENDFOREACH (testfile)
+
+ ENDIF (NOT EXISTS "${_listfile}" OR
+ ${_cmlist} IS_NEWER_THAN "${_listfile}")
+ENDMACRO (GENERATE_LIST_H)
+#
+# Generate installation rules for man pages.
+#
+MACRO (INSTALL_MAN __mans)
+ FOREACH (_man ${ARGV})
+ STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man})
+ INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}")
+ ENDFOREACH (_man)
+ENDMACRO (INSTALL_MAN __mans)
+
+#
+# Check compress/decompress libraries
+#
+IF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN)
+ # GnuWin32 is only for Win32, not Win64.
+ SET(__GNUWIN32PATH "C:/Program Files/GnuWin32")
+ENDIF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN)
+IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}")
+ # You have to add a path availabel DLL file into PATH environment variable.
+ # Maybe DLL path is "C:/Program Files/GnuWin32/bin".
+ # The zlib and the bzip2 Setup program have installed programs and DLLs into
+ # "C:/Program Files/GnuWin32" by default.
+ # This is convenience setting for Windows.
+ SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH))
+ #
+ # If you didn't use Setup program or installed into nonstandard path,
+ # cmake cannot find out your zlib or bzip2 libraries and include files,
+ # you should execute cmake with -DCMAKE_PREFIX_PATH option.
+ # e.g.
+ # cmake -DCMAKE_PREFIX_PATH=<your-GnuWin32-path> <path-to-source>
+ #
+ # If compiling error occured in zconf.h, You may need patch to zconf.h.
+ #--- zconf.h.orig 2005-07-21 00:40:26.000000000
+ #+++ zconf.h 2009-01-19 11:39:10.093750000
+ #@@ -286,7 +286,7 @@
+ #
+ # #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */
+ # # include <sys/types.h> /* for off_t */
+ #-# include <unistd.h> /* for SEEK_* and off_t */
+ #+# include <stdio.h> /* for SEEK_* and off_t */
+ # # ifdef VMS
+ # # include <unixio.h> /* for off_t */
+ # # endif
+ENDIF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}")
+
+SET(ADDITIONAL_LIBS "")
+#
+# Find ZLIB
+#
+FIND_PACKAGE(ZLIB)
+IF(ZLIB_FOUND)
+ SET(HAVE_LIBZ 1)
+ SET(HAVE_ZLIB_H 1)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES})
+ENDIF(ZLIB_FOUND)
+MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR)
+MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY)
+#
+# Find BZip2
+#
+FIND_PACKAGE(BZip2)
+IF(BZIP2_FOUND)
+ SET(HAVE_LIBBZ2 1)
+ SET(HAVE_BZLIB_H 1)
+ INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES})
+ENDIF(BZIP2_FOUND)
+MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR)
+MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARY)
+#
+# Find LZMA
+#
+FIND_PACKAGE(LZMA)
+IF(LZMA_FOUND)
+ SET(HAVE_LIBLZMA 1)
+ SET(HAVE_LZMA_H 1)
+ INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES})
+ MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY)
+ELSEIF(LZMADEC_FOUND)
+ SET(HAVE_LIBLZMADEC 1)
+ SET(HAVE_LZMADEC_H 1)
+ INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES})
+ MARK_AS_ADVANCED(CLEAR LZMADEC_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR LZMADEC_LIBRARY)
+ELSE(LZMA_FOUND)
+ MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY)
+ENDIF(LZMA_FOUND)
+
+#
+# Check headers
+#
+CHECK_HEADER_DIRENT()
+
+SET(INCLUDES "")
+MACRO (LA_CHECK_INCLUDE_FILE header var)
+ CHECK_INCLUDE_FILES("${INCLUDES};${header}" ${var})
+ IF (${var})
+ SET(INCLUDES ${INCLUDES} ${header})
+ ENDIF (${var})
+ENDMACRO (LA_CHECK_INCLUDE_FILE)
+
+# Few headers that must precede other headers
+# Must precede sys/extattr.h on FreeBSD
+LA_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
+
+# Alphabetize the rest unless there's a compelling reason
+LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H)
+LA_CHECK_INCLUDE_FILE("attr/xattr.h" HAVE_ATTR_XATTR_H)
+LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H)
+LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
+LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
+LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H)
+LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
+LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
+LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
+LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H)
+LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H)
+LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H)
+LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H)
+LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
+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("pwd.h" HAVE_PWD_H)
+LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
+LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
+LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H)
+LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
+LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
+LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
+LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
+LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H)
+LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H)
+LA_CHECK_INCLUDE_FILE("sys/extattr.h" HAVE_SYS_EXTATTR_H)
+LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H)
+LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
+LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
+LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
+LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
+LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
+LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H)
+LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H)
+LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H)
+LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
+LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
+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)
+
+
+#
+# Some headers require extra includes when they're available.
+#
+
+#
+# Find OpenSSL
+#
+IF(ENABLE_OPENSSL)
+ FIND_PACKAGE(OpenSSL)
+ELSE()
+ SET(OPENSSL_FOUND 0)
+ENDIF()
+IF(OPENSSL_FOUND)
+ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES})
+ELSE()
+ # Block OpenSSL checks and override cached results.
+ SET(HAVE_OPENSSL_MD5_H 0)
+ SET(HAVE_OPENSSL_RIPEMD_H 0)
+ SET(HAVE_OPENSSL_SHA_H 0)
+ SET(HAVE_OPENSSL_SHA256_INIT 0)
+ SET(HAVE_OPENSSL_SHA384_INIT 0)
+ SET(HAVE_OPENSSL_SHA512_INIT 0)
+ENDIF()
+#
+# Check MD5/RMD160/SHA headers
+#
+LA_CHECK_INCLUDE_FILE("md5.h" HAVE_MD5_H)
+LA_CHECK_INCLUDE_FILE("openssl/md5.h" HAVE_OPENSSL_MD5_H)
+LA_CHECK_INCLUDE_FILE("openssl/ripemd.h" HAVE_OPENSSL_RIPEMD_H)
+LA_CHECK_INCLUDE_FILE("openssl/sha.h" HAVE_OPENSSL_SHA_H)
+LA_CHECK_INCLUDE_FILE("ripemd.h" HAVE_RIPEMD_H)
+LA_CHECK_INCLUDE_FILE("rmd160.h" HAVE_RMD160_H)
+LA_CHECK_INCLUDE_FILE("sha.h" HAVE_SHA_H)
+LA_CHECK_INCLUDE_FILE("sha1.h" HAVE_SHA1_H)
+LA_CHECK_INCLUDE_FILE("sha2.h" HAVE_SHA2_H)
+LA_CHECK_INCLUDE_FILE("sha256.h" HAVE_SHA256_H)
+
+#
+# Find MD5/RMD160/SHA library
+#
+FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto)
+IF(CRYPTO_LIBRARY)
+ LIST(APPEND ADDITIONAL_LIBS ${CRYPTO_LIBRARY})
+ELSE(CRYPTO_LIBRARY)
+ IF(NOT OPENSSL_FOUND)
+ FIND_LIBRARY(MD_LIBRARY NAMES md)
+ IF(MD_LIBRARY)
+ LIST(APPEND ADDITIONAL_LIBS ${MD_LIBRARY})
+ ENDIF(MD_LIBRARY)
+ ENDIF(NOT OPENSSL_FOUND)
+ENDIF(CRYPTO_LIBRARY)
+#
+# Check MD5/RMD160/SHA functions
+#
+SET(CMAKE_REQUIRED_LIBRARIES ${ADDITIONAL_LIBS})
+IF(HAVE_MD5_H)
+ CHECK_SYMBOL_EXISTS(MD5Init "md5.h" HAVE_MD5INIT)
+ENDIF(HAVE_MD5_H)
+IF(HAVE_RMD160_H)
+ CHECK_SYMBOL_EXISTS(RMD160Init "rmd160.h" HAVE_RMD160INIT)
+ENDIF(HAVE_RMD160_H)
+IF(HAVE_SHA2_H)
+ CHECK_SYMBOL_EXISTS(SHA256Init "sha2.h" HAVE_SHA256INIT)
+ CHECK_SYMBOL_EXISTS(SHA384Init "sha2.h" HAVE_SHA384INIT)
+ CHECK_SYMBOL_EXISTS(SHA512Init "sha2.h" HAVE_SHA512INIT)
+ CHECK_SYMBOL_EXISTS(SHA256_Init "sha2.h" HAVE_SHA256_INIT)
+ CHECK_SYMBOL_EXISTS(SHA384_Init "sha2.h" HAVE_SHA384_INIT)
+ CHECK_SYMBOL_EXISTS(SHA512_Init "sha2.h" HAVE_SHA512_INIT)
+ELSEIF(HAVE_OPENSSL_SHA_H)
+ CHECK_SYMBOL_EXISTS(SHA256_Init "openssl/sha.h" HAVE_OPENSSL_SHA256_INIT)
+ CHECK_SYMBOL_EXISTS(SHA384_Init "openssl/sha.h" HAVE_OPENSSL_SHA384_INIT)
+ CHECK_SYMBOL_EXISTS(SHA512_Init "openssl/sha.h" HAVE_OPENSSL_SHA512_INIT)
+ENDIF()
+SET(CMAKE_REQUIRED_LIBRARIES "")
+
+#
+# Find Libxml2
+#
+FIND_PACKAGE(LibXml2)
+IF(LIBXML2_FOUND)
+ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES})
+ SET(HAVE_LIBXML2 1)
+ # libxml2's include files use iconv.h
+ # We need a directory path of iconv.h so that it won't fail to check
+ # "libxml/xmlreader.h".
+ FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
+ SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
+ CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H)
+ SET(CMAKE_REQUIRED_INCLUDES "")
+ELSE(LIBXML2_FOUND)
+ #
+ # Find Expat
+ #
+ FIND_PACKAGE(EXPAT)
+ IF(EXPAT_FOUND)
+ INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${EXPAT_LIBRARIES})
+ SET(HAVE_LIBEXPAT 1)
+ LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H)
+ ENDIF(EXPAT_FOUND)
+ENDIF(LIBXML2_FOUND)
+
+#
+# Check functions
+#
+CHECK_SYMBOL_EXISTS(CreateHardLinkA "windows.h" HAVE_CREATEHARDLINKA)
+CHECK_SYMBOL_EXISTS(CreateHardLinkW "windows.h" HAVE_CREATEHARDLINKW)
+CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode)
+CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS)
+CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
+CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
+CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR)
+CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS)
+CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD)
+CHECK_FUNCTION_EXISTS_GLIBC(fchown HAVE_FCHOWN)
+CHECK_FUNCTION_EXISTS_GLIBC(fcntl HAVE_FCNTL)
+CHECK_FUNCTION_EXISTS_GLIBC(fork HAVE_FORK)
+CHECK_FUNCTION_EXISTS_GLIBC(fstat HAVE_FSTAT)
+CHECK_FUNCTION_EXISTS_GLIBC(ftruncate HAVE_FTRUNCATE)
+CHECK_FUNCTION_EXISTS_GLIBC(futimens HAVE_FUTIMENS)
+CHECK_FUNCTION_EXISTS_GLIBC(futimes HAVE_FUTIMES)
+CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID)
+CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
+CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS)
+CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD)
+CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN)
+CHECK_FUNCTION_EXISTS_GLIBC(link HAVE_LINK)
+CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT)
+CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES)
+CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE)
+CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR)
+CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO)
+CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD)
+CHECK_FUNCTION_EXISTS_GLIBC(nl_langinfo HAVE_NL_LANGINFO)
+CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE)
+CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL)
+CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK)
+CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT)
+CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV)
+CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE)
+CHECK_FUNCTION_EXISTS_GLIBC(sigaction HAVE_SIGACTION)
+CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR)
+CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP)
+CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR)
+CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S)
+CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR)
+CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK)
+CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM)
+CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET)
+CHECK_FUNCTION_EXISTS_GLIBC(unsetenv HAVE_UNSETENV)
+CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME)
+CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES)
+CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT)
+CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK)
+CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB)
+CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY)
+CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN)
+CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB)
+CHECK_SYMBOL_EXISTS(wmemcmp "wchar.h" HAVE_WMEMCMP)
+CHECK_SYMBOL_EXISTS(wmemcpy "wchar.h" HAVE_WMEMCPY)
+
+SET(CMAKE_REQUIRED_LIBRARIES "")
+CHECK_SYMBOL_EXISTS(fseeko "stdio.h" HAVE_FSEEKO)
+CHECK_SYMBOL_EXISTS(strerror_r "string.h" HAVE_STRERROR_R)
+CHECK_SYMBOL_EXISTS(strftime "time.h" HAVE_STRFTIME)
+CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF)
+CHECK_SYMBOL_EXISTS(cygwin_conv_path "sys/cygwin.h" HAVE_CYGWIN_CONV_PATH)
+
+CHECK_SYMBOL_EXISTS(major "sys/mkdev.h" MAJOR_IN_MKDEV)
+CHECK_SYMBOL_EXISTS(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
+
+IF(HAVE_STRERROR_R)
+ SET(HAVE_DECL_STRERROR_R 1)
+ENDIF(HAVE_STRERROR_R)
+
+#
+# Check defines
+#
+SET(headers "limits.h")
+IF(HAVE_STDINT_H)
+ LIST(APPEND headers "stdint.h")
+ENDIF(HAVE_STDINT_H)
+IF(HAVE_INTTYPES_H)
+ LIST(APPEND headers "inttypes.h")
+ENDIF(HAVE_INTTYPES_H)
+CHECK_SYMBOL_EXISTS(EFTYPE "errno.h" HAVE_EFTYPE)
+CHECK_SYMBOL_EXISTS(EILSEQ "errno.h" HAVE_EILSEQ)
+CHECK_SYMBOL_EXISTS(D_MD_ORDER "langinfo.h" HAVE_D_MD_ORDER)
+CHECK_SYMBOL_EXISTS(optarg "unistd.h" HAVE_DECL_OPTARG)
+CHECK_SYMBOL_EXISTS(optind "unistd.h" HAVE_DECL_OPTIND)
+CHECK_SYMBOL_EXISTS(INT64_MAX "${headers}" HAVE_DECL_INT64_MAX)
+CHECK_SYMBOL_EXISTS(INT64_MIN "${headers}" HAVE_DECL_INT64_MIN)
+CHECK_SYMBOL_EXISTS(UINT32_MAX "${headers}" HAVE_DECL_UINT32_MAX)
+CHECK_SYMBOL_EXISTS(UINT64_MAX "${headers}" HAVE_DECL_UINT64_MAX)
+CHECK_SYMBOL_EXISTS(SIZE_MAX "${headers}" HAVE_DECL_SIZE_MAX)
+CHECK_SYMBOL_EXISTS(SSIZE_MAX "limits.h" HAVE_DECL_SSIZE_MAX)
+
+#
+# Check struct members
+#
+# Check for birthtime in struct stat
+CHECK_STRUCT_MEMBER("struct stat" st_birthtime
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIME)
+
+# Check for high-resolution timestamps in struct stat
+CHECK_STRUCT_MEMBER("struct stat" st_birthtimespec.tv_nsec
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC)
+CHECK_STRUCT_MEMBER("struct stat" st_mtimespec.tv_nsec
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
+CHECK_STRUCT_MEMBER("struct stat" st_mtim.tv_nsec
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
+CHECK_STRUCT_MEMBER("struct stat" st_mtime_n
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_N)
+CHECK_STRUCT_MEMBER("struct stat" st_umtime
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_UMTIME)
+CHECK_STRUCT_MEMBER("struct stat" st_mtime_usec
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_USEC)
+# Check for block size support in struct stat
+CHECK_STRUCT_MEMBER("struct stat" st_blksize
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BLKSIZE)
+# Check for st_flags in struct stat (BSD fflags)
+CHECK_STRUCT_MEMBER("struct stat" st_flags
+ "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_FLAGS)
+#
+#
+CHECK_STRUCT_MEMBER("struct tm" tm_sec
+ "sys/types.h;sys/time.h;time.h" TIME_WITH_SYS_TIME)
+
+#
+# Check for integer types
+#
+# XXX There must be a way to make this simpler <sigh> XXXX
+#
+CHECK_TYPE_SIZE("long long int" LONG_LONG_INT)
+CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG)
+CHECK_TYPE_SIZE("unsigned long long int" UNSIGNED_LONG_LONG_INT)
+
+#
+CHECK_TYPE_SIZE(dev_t DEV_T)
+IF(NOT HAVE_DEV_T)
+ IF(MSVC)
+ SET(dev_t "unsigned int")
+ ENDIF(MSVC)
+ENDIF(NOT HAVE_DEV_T)
+#
+CHECK_TYPE_SIZE(gid_t GID_T)
+IF(NOT HAVE_GID_T)
+ IF(WIN32)
+ SET(gid_t "short")
+ ELSE(WIN32)
+ SET(gid_t "unsigned int")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_GID_T)
+#
+CHECK_TYPE_SIZE(id_t ID_T)
+IF(NOT HAVE_ID_T)
+ IF(WIN32)
+ SET(id_t "short")
+ ELSE(WIN32)
+ SET(id_t "unsigned int")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_ID_T)
+#
+CHECK_TYPE_SIZE(int32_t INT32_T)
+IF(NOT HAVE_INT32_T)
+ SET(int32_t "int")
+ENDIF(NOT HAVE_INT32_T)
+#
+CHECK_TYPE_SIZE(int64_t INT64_T)
+IF(NOT HAVE_INT64_T)
+ IF(WIN32)
+ SET(int64_t __int64)
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_INT64_T)
+#
+CHECK_TYPE_SIZE(intmax_t INTMAX_T)
+IF(NOT HAVE_INTMAX_T)
+ SET(intmax_t "int64_t")
+ENDIF(NOT HAVE_INTMAX_T)
+#
+CHECK_TYPE_SIZE(mode_t MODE_T)
+IF(NOT HAVE_MODE_T)
+ IF(WIN32)
+ SET(mode_t "unsigned short")
+ ELSE(WIN32)
+ SET(mode_t "int")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_MODE_T)
+#
+CHECK_TYPE_SIZE(off_t OFF_T)
+IF(NOT HAVE_OFF_T)
+ SET(off_t "__int64")
+ENDIF(NOT HAVE_OFF_T)
+#
+CHECK_TYPE_SIZE(size_t SIZE_T)
+IF(NOT HAVE_SIZE_T)
+ IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(size_t "uint64_t")
+ ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(size_t "uint32_t")
+ ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ENDIF(NOT HAVE_SIZE_T)
+#
+CHECK_TYPE_SIZE(ssize_t SSIZE_T)
+IF(NOT HAVE_SSIZE_T)
+ IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(ssize_t "int64_t")
+ ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(ssize_t "long")
+ ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ENDIF(NOT HAVE_SSIZE_T)
+#
+CHECK_TYPE_SIZE(uid_t UID_T)
+IF(NOT HAVE_UID_T)
+ IF(WIN32)
+ SET(uid_t "short")
+ ELSE(WIN32)
+ SET(uid_t "unsigned int")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_UID_T)
+#
+CHECK_TYPE_SIZE(pid_t PID_T)
+IF(NOT HAVE_PID_T)
+ IF(WIN32)
+ SET(pid_t "int")
+ ELSE(WIN32)
+ MESSAGE(FATAL_ERROR "pid_t doesn't exist on this platform?")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_PID_T)
+#
+CHECK_TYPE_SIZE(uint16_t UINT16_T)
+IF(NOT HAVE_UINT16_T)
+ SET(uint16_t "unsigned short")
+ENDIF(NOT HAVE_UINT16_T)
+#
+CHECK_TYPE_SIZE(uint32_t UINT32_T)
+IF(NOT HAVE_UINT32_T)
+ SET(uint32_t "unsigned int")
+ENDIF(NOT HAVE_UINT32_T)
+#
+CHECK_TYPE_SIZE(uint64_t UINT64_T)
+IF(NOT HAVE_UINT64_T)
+ IF(WIN32)
+ SET(uint64_t "unsigned __int64")
+ ENDIF(WIN32)
+ENDIF(NOT HAVE_UINT64_T)
+#
+CHECK_TYPE_SIZE(uintmax_t UINTMAX_T)
+IF(NOT HAVE_UINTMAX_T)
+ SET(uintmax_t "uint64_t")
+ENDIF(NOT HAVE_UINTMAX_T)
+#
+CHECK_TYPE_SIZE(intptr_t INTPTR_T)
+IF(NOT HAVE_INTPTR_T)
+ IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(intptr_t "int64_t")
+ ELSE()
+ SET(intptr_t "int32_t")
+ ENDIF()
+ENDIF(NOT HAVE_INTPTR_T)
+#
+CHECK_TYPE_SIZE(uintptr_t UINTPTR_T)
+IF(NOT HAVE_UINTPTR_T)
+ IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ SET(uintptr_t "uint64_t")
+ ELSE()
+ SET(uintptr_t "uint32_t")
+ ENDIF()
+ENDIF(NOT HAVE_UINTPTR_T)
+#
+CHECK_TYPE_SIZE(wchar_t SIZEOF_WCHAR_T)
+IF(HAVE_SIZEOF_WCHAR_T)
+ SET(HAVE_WCHAR_T 1)
+ENDIF(HAVE_SIZEOF_WCHAR_T)
+#
+# Check if _FILE_OFFSET_BITS macro needed for large files
+#
+CHECK_FILE_OFFSET_BITS()
+
+
+
+#
+# Check for Extended Attribute libraries, headers, and functions
+#
+IF(ENABLE_XATTR)
+ LA_CHECK_INCLUDE_FILE(attr/xattr.h HAVE_ATTR_XATTR_H)
+ LA_CHECK_INCLUDE_FILE(sys/xattr.h HAVE_SYS_XATTR_H)
+ CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_ATTR_LIB)
+ IF(HAVE_ATTR_LIB)
+ SET(CMAKE_REQUIRED_LIBRARIES "attr")
+ ENDIF(HAVE_ATTR_LIB)
+ CHECK_FUNCTION_EXISTS_GLIBC(extattr_get_file HAVE_EXTATTR_GET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(extattr_list_file HAVE_EXTATTR_LIST_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_fd HAVE_EXTATTR_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_file HAVE_EXTATTR_SET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR)
+ENDIF(ENABLE_XATTR)
+
+#
+# Check for ACL libraries, headers, and functions
+#
+# The ACL support in libarchive is written against the POSIX1e draft,
+# which was never officially approved and varies quite a bit across
+# platforms. Worse, some systems have completely non-POSIX acl functions,
+# which makes the following checks rather more complex than I would like.
+#
+IF(ENABLE_ACL)
+ CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_ACL_LIB)
+ IF(HAVE_ACL_LIB)
+ SET(CMAKE_REQUIRED_LIBRARIES "acl")
+ FIND_LIBRARY(ACL_LIBRARY NAMES acl)
+ LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY})
+ ENDIF(HAVE_ACL_LIB)
+ #
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd_np HAVE_ACL_SET_FD_NP)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
+ CHECK_TYPE_EXISTS(acl_permset_t "${INCLUDES}" HAVE_ACL_PERMSET_T)
+
+ # The "acl_get_perm()" function was omitted from the POSIX draft.
+ # (It's a pretty obvious oversight; otherwise, there's no way to
+ # test for specific permissions in a permset.) Linux uses the obvious
+ # name, FreeBSD adds _np to mark it as "non-Posix extension."
+ # Test for both as a double-check that we really have POSIX-style ACL support.
+ CHECK_SYMBOL_EXISTS(acl_get_perm "${INCLUDES}" HAVE_ACL_GET_PERM)
+ CHECK_SYMBOL_EXISTS(acl_get_perm_np "${INCLUDES}" HAVE_ACL_GET_PERM_NP)
+ CHECK_SYMBOL_EXISTS(acl_get_link "${INCLUDES}" HAVE_ACL_GET_LINK)
+ CHECK_SYMBOL_EXISTS(acl_get_link_np "${INCLUDES}" HAVE_ACL_GET_LINK_NP)
+
+ # MacOS has an acl.h that isn't POSIX. It can be detected by
+ # checking for ACL_USER
+ CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER)
+ENDIF(ENABLE_ACL)
+
+# Generate "config.h" from "build/cmake/config.h.in"
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+
+#
+# Register installation of PDF documents.
+#
+IF(WIN32 AND NOT CYGWIN)
+ #
+ # On Windows platform, It's better that we install PDF documents
+ # on one's computer.
+ # These PDF documents are available in the release package.
+ #
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf)
+ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf
+ DESTINATION share/man
+ FILES_MATCHING PATTERN "*.pdf"
+ )
+ ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf)
+ENDIF(WIN32 AND NOT CYGWIN)
+#
+#
+#
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libarchive)
+#
+IF(MSVC)
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
+ENDIF(MSVC)
+# 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$")
+ ADD_DEFINITIONS(-Wall -Werror)
+ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
+
+IF(ENABLE_TEST)
+ADD_CUSTOM_TARGET(run_all_tests)
+ENDIF(ENABLE_TEST)
+
+add_subdirectory(libarchive)
+add_subdirectory(tar)
+add_subdirectory(cpio)
diff --git a/archivers/libarchive/files/COPYING b/archivers/libarchive/files/COPYING
index ec7d6c43603..9dbf49dbf21 100644
--- a/archivers/libarchive/files/COPYING
+++ b/archivers/libarchive/files/COPYING
@@ -22,7 +22,7 @@ the actual statements in the files are controlling.
tar/matching.c
* The following source files are in the public domain:
- tar/getdate.y
+ tar/getdate.c
* The build files---including Makefiles, configure scripts,
and auxiliary scripts used as part of the compile process---have
@@ -35,7 +35,7 @@ do use the license below. The varying licensing of the build scripts
seems to be an unavoidable mess.
-Copyright (c) 2003-2008 <author(s)>
+Copyright (c) 2003-2009 <author(s)>
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/archivers/libarchive/files/INSTALL b/archivers/libarchive/files/INSTALL
index 6da53c30f33..d91cc0691f4 100644
--- a/archivers/libarchive/files/INSTALL
+++ b/archivers/libarchive/files/INSTALL
@@ -1,5 +1,8 @@
-On most Unix-like systems, you should be able to install libarchive
-and bsdtar using the following common steps:
+More complete build documentation is available on the libarchive
+Wiki: http://libarchive.googlecode.com/
+
+On most Unix-like systems, you should be able to install libarchive,
+bsdtar, and bsdcpio using the following common steps:
./configure
make
make install
@@ -9,12 +12,19 @@ the build setting, use
./configure --help
to list the configure options.
-To build and install only libarchive:
- ./configure
- make
- cd libarchive && make install
+If you are developing libarchive and need to update the
+configure script and other build files:
+ /bin/sh build/autogen.sh
-To build and install only bsdtar (assumes a suitable
-libarchive is already installed on the system):
- ./configure
- cd tar && make && make install
+To create a distribution, please use the 'distcheck' target:
+ /bin/sh build/autogen.sh && ./configure && make distcheck
+
+On non-Unix-like systems, use the "cmake" utility (available from
+http://cmake.org/) to generate suitable build files for your platform.
+Cmake requires the name of the directory containing CmakeLists.txt and
+the "generator" to use for your build environment. For example, to
+build with Xcode on Mac OS, you can use the following command:
+ cmake -G "Xcode" ~/libarchive-download-dir/
+The result will be appropriate makefiles, solution files, or project
+files that can be used with the corresponding development tool.
+See the libarchive Wiki or the cmake site for further documentation. \ No newline at end of file
diff --git a/archivers/libarchive/files/Makefile.am b/archivers/libarchive/files/Makefile.am
index 5430f4f6ca5..4f4a80dcfc7 100644
--- a/archivers/libarchive/files/Makefile.am
+++ b/archivers/libarchive/files/Makefile.am
@@ -1,11 +1,13 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS= foreign subdir-objects
+ACLOCAL_AMFLAGS = -I build/autoconf
#
# What to build and install
#
lib_LTLIBRARIES= libarchive.la
+noinst_LTLIBRARIES= libarchive_fe.la
bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs)
man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS)
BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h
@@ -19,15 +21,27 @@ TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs)
TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT)
# Always build and test both bsdtar and bsdcpio as part of 'distcheck'
DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
+# Uncommenting this line can help diagnose some errors. This is ordinarily
+# enabled in the libarchive development branch but is disabled
+# for libarchive production releases.
+#AM_CFLAGS=-Wall -Werror
+PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
+AM_CPPFLAGS=$(PLATFORMCPPFLAGS)
#
# What to include in the distribution
#
-EXTRA_DIST= version \
+EXTRA_DIST= \
+ CMakeLists.txt \
+ build/autogen.sh \
+ build/bump-version.sh \
+ build/clean.sh \
+ build/cmake \
+ build/version \
+ build/windows \
contrib \
doc \
examples \
- windows \
$(libarchive_EXTRA_DIST) \
$(libarchive_test_EXTRA_DIST) \
$(bsdtar_EXTRA_DIST) \
@@ -46,10 +60,16 @@ dist-hook:
-rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile
cd $(distdir)/doc && /bin/sh update.sh
+# Verify cmake builds as part of the acceptance
+distcheck-hook:
+ mkdir $(distdir)/_build/cmtest
+ cd $(distdir)/_build/cmtest && cmake ../.. && make && make test
+ rm -rf $(distdir)/_build/cmtest
+
#
# Extra rules for cleanup
#
-DISTCLEANFILES= tar/getdate.c tar/getdate.h \
+DISTCLEANFILES= \
libarchive/test/list.h \
tar/test/list.h \
cpio/test/list.h
@@ -82,10 +102,16 @@ libarchive_la_SOURCES= \
libarchive/archive_entry_private.h \
libarchive/archive_entry_stat.c \
libarchive/archive_entry_strmode.c \
+ libarchive/archive_entry_xattr.c \
+ libarchive/archive_hash.h \
libarchive/archive_platform.h \
libarchive/archive_private.h \
libarchive/archive_read.c \
libarchive/archive_read_data_into_fd.c \
+ libarchive/archive_read_disk.c \
+ libarchive/archive_read_disk_entry_from_file.c \
+ libarchive/archive_read_disk_private.h \
+ libarchive/archive_read_disk_set_standard_lookup.c \
libarchive/archive_read_extract.c \
libarchive/archive_read_open_fd.c \
libarchive/archive_read_open_file.c \
@@ -98,13 +124,18 @@ libarchive_la_SOURCES= \
libarchive/archive_read_support_compression_gzip.c \
libarchive/archive_read_support_compression_none.c \
libarchive/archive_read_support_compression_program.c \
+ libarchive/archive_read_support_compression_rpm.c \
+ libarchive/archive_read_support_compression_uu.c \
+ libarchive/archive_read_support_compression_xz.c \
libarchive/archive_read_support_format_all.c \
libarchive/archive_read_support_format_ar.c \
libarchive/archive_read_support_format_cpio.c \
libarchive/archive_read_support_format_empty.c \
libarchive/archive_read_support_format_iso9660.c \
libarchive/archive_read_support_format_mtree.c \
+ libarchive/archive_read_support_format_raw.c \
libarchive/archive_read_support_format_tar.c \
+ libarchive/archive_read_support_format_xar.c \
libarchive/archive_read_support_format_zip.c \
libarchive/archive_string.c \
libarchive/archive_string.h \
@@ -125,27 +156,38 @@ libarchive_la_SOURCES= \
libarchive/archive_write_set_compression_gzip.c \
libarchive/archive_write_set_compression_none.c \
libarchive/archive_write_set_compression_program.c \
+ libarchive/archive_write_set_compression_xz.c \
libarchive/archive_write_set_format.c \
libarchive/archive_write_set_format_ar.c \
libarchive/archive_write_set_format_by_name.c \
libarchive/archive_write_set_format_cpio.c \
libarchive/archive_write_set_format_cpio_newc.c \
+ libarchive/archive_write_set_format_mtree.c \
libarchive/archive_write_set_format_pax.c \
libarchive/archive_write_set_format_shar.c \
libarchive/archive_write_set_format_ustar.c \
+ libarchive/archive_write_set_format_zip.c \
libarchive/config_freebsd.h \
- libarchive/config_windows.h \
libarchive/filter_fork.c \
libarchive/filter_fork.h
-# cygwin barfs without -no-undefined; I don't know what it does or
-# whether it helps or hurts other platforms...
+if INC_WINDOWS_FILES
+libarchive_la_SOURCES+= \
+ libarchive/archive_entry_copy_bhfi.c \
+ libarchive/archive_windows.h \
+ libarchive/archive_windows.c \
+ libarchive/filter_fork_windows.c
+endif
+
+# -no-undefined marks that libarchive doesn't rely on symbols
+# defined in the application. This is mandatory for cygwin.
libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
# Manpages to install
libarchive_man_MANS= \
libarchive/archive_entry.3 \
libarchive/archive_read.3 \
+ libarchive/archive_read_disk.3 \
libarchive/archive_util.3 \
libarchive/archive_write.3 \
libarchive/archive_write_disk.3 \
@@ -161,8 +203,14 @@ libarchive_EXTRA_DIST= \
libarchive/test/list.h \
libarchive/archive_windows.c \
libarchive/archive_windows.h \
+ libarchive/filter_fork_windows.c \
+ libarchive/CMakeLists.txt \
$(libarchive_man_MANS)
+# pkgconfig
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = build/pkgconfig/libarchive.pc
+
#
#
# libarchive_test program
@@ -174,66 +222,113 @@ libarchive_test_SOURCES= \
libarchive/test/read_open_memory.c \
libarchive/test/test.h \
libarchive/test/test_acl_basic.c \
+ libarchive/test/test_acl_freebsd.c \
libarchive/test/test_acl_pax.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_bad_fd.c \
+ libarchive/test/test_compat_bzip2.c \
+ libarchive/test/test_compat_cpio.c \
libarchive/test/test_compat_gtar.c \
+ libarchive/test/test_compat_gzip.c \
+ libarchive/test/test_compat_lzma.c \
+ libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_tar_hardlink.c \
+ libarchive/test/test_compat_xz.c \
libarchive/test/test_compat_zip.c \
libarchive/test/test_empty_write.c \
libarchive/test/test_entry.c \
+ libarchive/test/test_extattr_freebsd.c \
+ libarchive/test/test_fuzz.c \
libarchive/test/test_entry_strmode.c \
libarchive/test/test_link_resolver.c \
+ libarchive/test/test_open_fd.c \
+ libarchive/test/test_open_file.c \
+ libarchive/test/test_open_filename.c \
libarchive/test/test_pax_filename_encoding.c \
libarchive/test/test_read_compress_program.c \
libarchive/test/test_read_data_large.c \
+ libarchive/test/test_read_disk.c \
+ libarchive/test/test_read_disk_entry_from_file.c \
libarchive/test/test_read_extract.c \
+ libarchive/test/test_read_file_nonexistent.c \
libarchive/test/test_read_format_ar.c \
libarchive/test/test_read_format_cpio_bin.c \
libarchive/test/test_read_format_cpio_bin_Z.c \
+ libarchive/test/test_read_format_cpio_bin_be.c \
libarchive/test/test_read_format_cpio_bin_bz2.c \
libarchive/test/test_read_format_cpio_bin_gz.c \
+ libarchive/test/test_read_format_cpio_bin_lzma.c \
+ libarchive/test/test_read_format_cpio_bin_xz.c \
libarchive/test/test_read_format_cpio_odc.c \
+ libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c \
libarchive/test/test_read_format_cpio_svr4_gzip.c \
+ libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c \
libarchive/test/test_read_format_cpio_svr4c_Z.c \
libarchive/test/test_read_format_empty.c \
libarchive/test/test_read_format_gtar_gz.c \
+ libarchive/test/test_read_format_gtar_lzma.c \
libarchive/test/test_read_format_gtar_sparse.c \
libarchive/test/test_read_format_iso_gz.c \
+ libarchive/test/test_read_format_iso_multi_extent.c \
+ libarchive/test/test_read_format_isojoliet_bz2.c \
+ libarchive/test/test_read_format_isojoliet_long.c \
+ libarchive/test/test_read_format_isojoliet_rr.c \
libarchive/test/test_read_format_isorr_bz2.c \
+ libarchive/test/test_read_format_isorr_ce.c \
+ libarchive/test/test_read_format_isorr_new_bz2.c \
+ libarchive/test/test_read_format_isorr_rr_moved.c \
+ libarchive/test/test_read_format_isozisofs_bz2.c \
libarchive/test/test_read_format_mtree.c \
libarchive/test/test_read_format_pax_bz2.c \
+ libarchive/test/test_read_format_raw.c \
libarchive/test/test_read_format_tar.c \
libarchive/test/test_read_format_tar_empty_filename.c \
libarchive/test/test_read_format_tbz.c \
libarchive/test/test_read_format_tgz.c \
+ libarchive/test/test_read_format_tlz.c \
+ libarchive/test/test_read_format_txz.c \
libarchive/test/test_read_format_tz.c \
+ libarchive/test/test_read_format_xar.c \
libarchive/test/test_read_format_zip.c \
libarchive/test/test_read_large.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
libarchive/test/test_read_truncated.c \
+ libarchive/test/test_read_uu.c \
libarchive/test/test_tar_filenames.c \
libarchive/test/test_tar_large.c \
libarchive/test/test_ustar_filenames.c \
libarchive/test/test_write_compress.c \
+ libarchive/test/test_write_compress_bzip2.c \
+ libarchive/test/test_write_compress_gzip.c \
+ libarchive/test/test_write_compress_lzma.c \
libarchive/test/test_write_compress_program.c \
+ libarchive/test/test_write_compress_xz.c \
libarchive/test/test_write_disk.c \
+ libarchive/test/test_write_disk_failures.c \
libarchive/test/test_write_disk_hardlink.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_sparse.c \
+ libarchive/test/test_write_disk_symlink.c \
+ libarchive/test/test_write_disk_times.c \
libarchive/test/test_write_format_ar.c \
libarchive/test/test_write_format_cpio.c \
libarchive/test/test_write_format_cpio_empty.c \
libarchive/test/test_write_format_cpio_odc.c \
libarchive/test/test_write_format_cpio_newc.c \
+ libarchive/test/test_write_format_mtree.c \
+ libarchive/test/test_write_format_pax.c \
libarchive/test/test_write_format_shar_empty.c \
libarchive/test/test_write_format_tar.c \
libarchive/test/test_write_format_tar_empty.c \
libarchive/test/test_write_format_tar_ustar.c \
+ libarchive/test/test_write_format_zip.c \
+ libarchive/test/test_write_format_zip_empty.c \
+ libarchive/test/test_write_format_zip_no_compression.c \
libarchive/test/test_write_open_memory.c
-libarchive_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test
+libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
# The "list.h" file just lists all of the tests defined in all of the sources.
# Building it automatically provides a sanity-check on libarchive_test_SOURCES
@@ -244,20 +339,62 @@ libarchive/test/list.h: Makefile
libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test
libarchive_test_EXTRA_DIST=\
- libarchive/test/test_compat_gtar_1.tgz.uu \
+ libarchive/test/test_compat_bzip2_1.tbz.uu \
+ libarchive/test/test_compat_bzip2_2.tbz.uu \
+ libarchive/test/test_compat_cpio_1.cpio.uu \
+ libarchive/test/test_compat_gtar_1.tar.uu \
+ libarchive/test/test_compat_gzip_1.tgz.uu \
+ libarchive/test/test_compat_gzip_2.tgz.uu \
+ libarchive/test/test_compat_lzma_1.tlz.uu \
+ libarchive/test/test_compat_lzma_2.tlz.uu \
+ libarchive/test/test_compat_lzma_3.tlz.uu \
+ libarchive/test/test_compat_solaris_tar_acl.tar.uu \
libarchive/test/test_compat_tar_hardlink_1.tar.uu \
+ libarchive/test/test_compat_xz_1.txz.uu \
libarchive/test/test_compat_zip_1.zip.uu \
- libarchive/test/test_pax_filename_encoding.tar.gz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu \
+ libarchive/test/test_fuzz_1.iso.Z.uu \
+ libarchive/test/test_pax_filename_encoding.tar.uu \
+ libarchive/test/test_read_format_ar.ar.uu \
+ libarchive/test/test_read_format_cpio_bin_be.cpio.uu \
+ libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu \
+ libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \
libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \
- libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu \
+ libarchive/test/test_read_format_iso.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu \
+ libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu\
+ libarchive/test/test_read_format_iso_zisofs.iso.Z.uu \
+ libarchive/test/test_read_format_mtree.mtree.uu \
+ libarchive/test/test_read_format_raw.data.Z.uu \
+ libarchive/test/test_read_format_raw.data.uu \
libarchive/test/test_read_format_tar_empty_filename.tar.uu \
- libarchive/test/test_read_format_zip.zip.uu
+ libarchive/test/test_read_format_zip.zip.uu \
+ libarchive/test/CMakeLists.txt \
+ libarchive/test/README
+#
+# Common code for libarchive frontends (cpio, tar)
+#
+libarchive_fe_la_SOURCES= \
+ libarchive_fe/err.c \
+ libarchive_fe/err.h \
+ libarchive_fe/lafe_platform.h \
+ libarchive_fe/line_reader.c \
+ libarchive_fe/line_reader.h \
+ libarchive_fe/matching.c \
+ libarchive_fe/matching.h \
+ libarchive_fe/pathmatch.c \
+ libarchive_fe/pathmatch.h
#
#
@@ -269,29 +406,43 @@ bsdtar_SOURCES= \
tar/bsdtar.c \
tar/bsdtar.h \
tar/bsdtar_platform.h \
- tar/getdate.y \
- tar/matching.c \
+ tar/cmdline.c \
+ tar/getdate.c \
tar/read.c \
- tar/siginfo.c \
tar/subst.c \
tar/tree.c \
tar/tree.h \
tar/util.c \
tar/write.c
-bsdtar_DEPENDENCIES= libarchive.la
+if INC_WINDOWS_FILES
+bsdtar_SOURCES+= \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c
+endif
+
+bsdtar_DEPENDENCIES= libarchive.la libarchive_fe.la
if STATIC_BSDTAR
-bsdtar_static= -static
+bsdtar_ldstatic= -static
+bsdtar_ccstatic= -DLIBARCHIVE_STATIC
else
-bsdtar_static=
+bsdtar_ldstatic=
+bsdtar_ccstatic=
endif
-bsdtar_LDADD= libarchive.la
-bsdtar_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
-bsdtar_LDFLAGS= $(bsdtar_static)
+bsdtar_LDADD= libarchive.la libarchive_fe.la
+bsdtar_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS)
+bsdtar_LDFLAGS= $(bsdtar_ldstatic)
+
bsdtar_EXTRA_DIST= \
- tar/bsdtar.1
+ tar/bsdtar.1 \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c \
+ tar/CMakeLists.txt \
+ tar/config_freebsd.h \
+ tar/test/list.h
+
if BUILD_BSDTAR
bsdtar_man_MANS= tar/bsdtar.1
@@ -312,26 +463,49 @@ bsdtar_test_SOURCES= \
tar/test/test_0.c \
tar/test/test_basic.c \
tar/test/test_copy.c \
+ tar/test/test_empty_mtree.c \
tar/test/test_getdate.c \
tar/test/test_help.c \
- tar/test/test_option_T.c \
+ tar/test/test_option_T_upper.c \
+ tar/test/test_option_q.c \
+ tar/test/test_option_r.c \
+ tar/test/test_option_s.c \
tar/test/test_patterns.c \
tar/test/test_stdio.c \
- tar/test/test_version.c
+ tar/test/test_strip_components.c \
+ tar/test/test_symlink_dir.c \
+ tar/test/test_version.c \
+ tar/test/test_windows.c
+
+# For now, bsdtar_test uses Windows shims from tar/bsdtar_windows.*
+if INC_WINDOWS_FILES
+bsdtar_test_SOURCES+= \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c
+endif
-bsdtar_test_CPPFLAGS= -I$(top_builddir)/tar/test
+bsdtar_test_CPPFLAGS=\
+ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
+ -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+ $(PLATFORMCPPFLAGS)
tar/test/list.h: Makefile
cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
if BUILD_BSDTAR
bsdtar_test_programs= bsdtar_test
-bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
+bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar$(EXEEXT) BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
else
bsdtar_test_programs=
bsdtar_TESTS_ENVIRONMENT=
endif
+bsdtar_test_EXTRA_DIST= \
+ tar/test/test_patterns_2.tar.uu \
+ tar/test/test_patterns_3.tar.uu \
+ tar/test/test_patterns_4.tar.uu \
+ tar/test/CMakeLists.txt
+
#
#
@@ -343,28 +517,37 @@ bsdcpio_SOURCES= \
cpio/cmdline.c \
cpio/cpio.c \
cpio/cpio.h \
- cpio/cpio_platform.h \
- cpio/err.c \
- cpio/matching.c \
- cpio/matching.h \
- cpio/pathmatch.c \
- cpio/pathmatch.h
+ cpio/cpio_platform.h
-bsdcpio_DEPENDENCIES = libarchive.la
+if INC_WINDOWS_FILES
+bsdcpio_SOURCES+= \
+ cpio/cpio_windows.h \
+ cpio/cpio_windows.c
+endif
+
+bsdcpio_DEPENDENCIES = libarchive.la libarchive_fe.la
if STATIC_BSDCPIO
-bsdcpio_static= -static
+bsdcpio_ldstatic= -static
+bsdcpio_ccstatic= -DLIBARCHIVE_STATIC
else
-bsdcpio_static=
+bsdcpio_ldstatic=
+bsdcpio_ccstatic=
endif
-bsdcpio_LDADD= libarchive.la
-bsdcpio_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
-bsdcpio_LDFLAGS= $(bsdcpio_static)
+bsdcpio_LDADD= libarchive_fe.la libarchive.la
+bsdcpio_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcpio_ccstatic) $(PLATFORMCPPFLAGS)
+bsdcpio_LDFLAGS= $(bsdcpio_ldstatic)
+
bsdcpio_EXTRA_DIST= \
cpio/test/list.h \
- cpio/bsdcpio.1
+ cpio/bsdcpio.1 \
+ cpio/cpio_windows.h \
+ cpio/cpio_windows.c \
+ cpio/CMakeLists.txt \
+ cpio/config_freebsd.h
+
if BUILD_BSDCPIO
# Manpages to install
@@ -381,22 +564,25 @@ endif
bsdcpio_test_SOURCES= \
cpio/cmdline.c \
- cpio/err.c \
- cpio/pathmatch.c \
cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_0.c \
cpio/test/test_basic.c \
+ cpio/test/test_cmdline.c \
cpio/test/test_format_newc.c \
cpio/test/test_gcpio_compat.c \
+ cpio/test/test_option_B_upper.c \
+ cpio/test/test_option_C_upper.c \
+ cpio/test/test_option_J_upper.c \
+ cpio/test/test_option_L_upper.c \
+ cpio/test/test_option_Z_upper.c \
cpio/test/test_option_a.c \
- cpio/test/test_option_B.c \
cpio/test/test_option_c.c \
cpio/test/test_option_d.c \
cpio/test/test_option_f.c \
cpio/test/test_option_help.c \
- cpio/test/test_option_L.c \
- cpio/test/test_option_ell.c \
+ cpio/test/test_option_l.c \
+ cpio/test/test_option_lzma.c \
cpio/test/test_option_m.c \
cpio/test/test_option_t.c \
cpio/test/test_option_u.c \
@@ -404,16 +590,22 @@ bsdcpio_test_SOURCES= \
cpio/test/test_option_y.c \
cpio/test/test_option_z.c \
cpio/test/test_owner_parse.c \
+ cpio/test/test_passthrough_dotdot.c \
+ cpio/test/test_passthrough_reverse.c \
cpio/test/test_pathmatch.c
-bsdcpio_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test
+bsdcpio_test_CPPFLAGS= \
+ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
+ -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+ $(PLATFORMCPPFLAGS)
+bsdcpio_test_LDADD=libarchive_fe.la
cpio/test/list.h: Makefile
cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
if BUILD_BSDCPIO
bsdcpio_test_programs= bsdcpio_test
-bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
+bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio$(EXEEXT) BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
else
bsdcpio_test_programs=
bsdcpio_TESTS_ENVIRONMENT=
@@ -428,4 +620,5 @@ bsdcpio_test_EXTRA_DIST= \
cpio/test/test_option_m.cpio.uu \
cpio/test/test_option_t.cpio.uu \
cpio/test/test_option_t.stdout.uu \
- cpio/test/test_option_tv.stdout.uu
+ cpio/test/test_option_tv.stdout.uu \
+ cpio/test/CMakeLists.txt
diff --git a/archivers/libarchive/files/Makefile.in b/archivers/libarchive/files/Makefile.in
index 24672995d40..01b5c9d0c2c 100644
--- a/archivers/libarchive/files/Makefile.in
+++ b/archivers/libarchive/files/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,6 +16,7 @@
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -38,23 +39,48 @@ bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
check_PROGRAMS = libarchive_test$(EXEEXT) $(am__EXEEXT_3) \
$(am__EXEEXT_4)
TESTS = libarchive_test$(EXEEXT) $(am__EXEEXT_3) $(am__EXEEXT_4)
+@INC_WINDOWS_FILES_TRUE@am__append_1 = \
+@INC_WINDOWS_FILES_TRUE@ libarchive/archive_entry_copy_bhfi.c \
+@INC_WINDOWS_FILES_TRUE@ libarchive/archive_windows.h \
+@INC_WINDOWS_FILES_TRUE@ libarchive/archive_windows.c \
+@INC_WINDOWS_FILES_TRUE@ libarchive/filter_fork_windows.c
+
+@INC_WINDOWS_FILES_TRUE@am__append_2 = \
+@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.h \
+@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.c
+
+
+# For now, bsdtar_test uses Windows shims from tar/bsdtar_windows.*
+@INC_WINDOWS_FILES_TRUE@am__append_3 = \
+@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.h \
+@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.c
+
+@INC_WINDOWS_FILES_TRUE@am__append_4 = \
+@INC_WINDOWS_FILES_TRUE@ cpio/cpio_windows.h \
+@INC_WINDOWS_FILES_TRUE@ cpio/cpio_windows.c
+
subdir = .
DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(top_srcdir)/configure COPYING INSTALL \
- NEWS config.aux/compile config.aux/config.guess \
- config.aux/config.sub config.aux/depcomp config.aux/install-sh \
- config.aux/ltmain.sh config.aux/missing config.aux/ylwrap \
- tar/getdate.c
+ $(srcdir)/config.h.in \
+ $(top_srcdir)/build/pkgconfig/libarchive.pc.in \
+ $(top_srcdir)/configure COPYING INSTALL NEWS \
+ build/autoconf/compile build/autoconf/config.guess \
+ build/autoconf/config.sub build/autoconf/depcomp \
+ build/autoconf/install-sh build/autoconf/ltmain.sh \
+ build/autoconf/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = \
+ $(top_srcdir)/build/autoconf/check_stdcall_func.m4 \
+ $(top_srcdir)/build/autoconf/la_uid_t.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = build/pkgconfig/libarchive.pc
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -63,18 +89,99 @@ am__vpath_adj = case $$p in \
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
- "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)"
+ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" \
+ "$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libarchive_la_LIBADD =
+am__libarchive_la_SOURCES_DIST = libarchive/archive_check_magic.c \
+ libarchive/archive_endian.h libarchive/archive_entry.c \
+ libarchive/archive_entry.h \
+ libarchive/archive_entry_copy_stat.c \
+ libarchive/archive_entry_link_resolver.c \
+ libarchive/archive_entry_private.h \
+ libarchive/archive_entry_stat.c \
+ libarchive/archive_entry_strmode.c \
+ libarchive/archive_entry_xattr.c libarchive/archive_hash.h \
+ libarchive/archive_platform.h libarchive/archive_private.h \
+ libarchive/archive_read.c \
+ libarchive/archive_read_data_into_fd.c \
+ libarchive/archive_read_disk.c \
+ libarchive/archive_read_disk_entry_from_file.c \
+ libarchive/archive_read_disk_private.h \
+ libarchive/archive_read_disk_set_standard_lookup.c \
+ libarchive/archive_read_extract.c \
+ libarchive/archive_read_open_fd.c \
+ libarchive/archive_read_open_file.c \
+ libarchive/archive_read_open_filename.c \
+ libarchive/archive_read_open_memory.c \
+ libarchive/archive_read_private.h \
+ libarchive/archive_read_support_compression_all.c \
+ libarchive/archive_read_support_compression_bzip2.c \
+ libarchive/archive_read_support_compression_compress.c \
+ libarchive/archive_read_support_compression_gzip.c \
+ libarchive/archive_read_support_compression_none.c \
+ libarchive/archive_read_support_compression_program.c \
+ libarchive/archive_read_support_compression_rpm.c \
+ libarchive/archive_read_support_compression_uu.c \
+ libarchive/archive_read_support_compression_xz.c \
+ libarchive/archive_read_support_format_all.c \
+ libarchive/archive_read_support_format_ar.c \
+ libarchive/archive_read_support_format_cpio.c \
+ libarchive/archive_read_support_format_empty.c \
+ libarchive/archive_read_support_format_iso9660.c \
+ libarchive/archive_read_support_format_mtree.c \
+ libarchive/archive_read_support_format_raw.c \
+ libarchive/archive_read_support_format_tar.c \
+ libarchive/archive_read_support_format_xar.c \
+ libarchive/archive_read_support_format_zip.c \
+ libarchive/archive_string.c libarchive/archive_string.h \
+ libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_virtual.c libarchive/archive_write.c \
+ libarchive/archive_write_disk.c \
+ libarchive/archive_write_disk_private.h \
+ libarchive/archive_write_disk_set_standard_lookup.c \
+ libarchive/archive_write_open_fd.c \
+ libarchive/archive_write_open_file.c \
+ libarchive/archive_write_open_filename.c \
+ libarchive/archive_write_open_memory.c \
+ libarchive/archive_write_private.h \
+ libarchive/archive_write_set_compression_bzip2.c \
+ libarchive/archive_write_set_compression_compress.c \
+ libarchive/archive_write_set_compression_gzip.c \
+ libarchive/archive_write_set_compression_none.c \
+ libarchive/archive_write_set_compression_program.c \
+ libarchive/archive_write_set_compression_xz.c \
+ libarchive/archive_write_set_format.c \
+ libarchive/archive_write_set_format_ar.c \
+ libarchive/archive_write_set_format_by_name.c \
+ libarchive/archive_write_set_format_cpio.c \
+ libarchive/archive_write_set_format_cpio_newc.c \
+ libarchive/archive_write_set_format_mtree.c \
+ libarchive/archive_write_set_format_pax.c \
+ libarchive/archive_write_set_format_shar.c \
+ libarchive/archive_write_set_format_ustar.c \
+ libarchive/archive_write_set_format_zip.c \
+ libarchive/config_freebsd.h libarchive/filter_fork.c \
+ libarchive/filter_fork.h libarchive/archive_entry_copy_bhfi.c \
+ libarchive/archive_windows.h libarchive/archive_windows.c \
+ libarchive/filter_fork_windows.c
am__dirstamp = $(am__leading_dot)dirstamp
+@INC_WINDOWS_FILES_TRUE@am__objects_1 = \
+@INC_WINDOWS_FILES_TRUE@ libarchive/archive_entry_copy_bhfi.lo \
+@INC_WINDOWS_FILES_TRUE@ libarchive/archive_windows.lo \
+@INC_WINDOWS_FILES_TRUE@ libarchive/filter_fork_windows.lo
am_libarchive_la_OBJECTS = libarchive/archive_check_magic.lo \
libarchive/archive_entry.lo \
libarchive/archive_entry_copy_stat.lo \
libarchive/archive_entry_link_resolver.lo \
libarchive/archive_entry_stat.lo \
- libarchive/archive_entry_strmode.lo libarchive/archive_read.lo \
+ libarchive/archive_entry_strmode.lo \
+ libarchive/archive_entry_xattr.lo libarchive/archive_read.lo \
libarchive/archive_read_data_into_fd.lo \
+ libarchive/archive_read_disk.lo \
+ libarchive/archive_read_disk_entry_from_file.lo \
+ libarchive/archive_read_disk_set_standard_lookup.lo \
libarchive/archive_read_extract.lo \
libarchive/archive_read_open_fd.lo \
libarchive/archive_read_open_file.lo \
@@ -86,13 +193,18 @@ am_libarchive_la_OBJECTS = libarchive/archive_check_magic.lo \
libarchive/archive_read_support_compression_gzip.lo \
libarchive/archive_read_support_compression_none.lo \
libarchive/archive_read_support_compression_program.lo \
+ libarchive/archive_read_support_compression_rpm.lo \
+ libarchive/archive_read_support_compression_uu.lo \
+ libarchive/archive_read_support_compression_xz.lo \
libarchive/archive_read_support_format_all.lo \
libarchive/archive_read_support_format_ar.lo \
libarchive/archive_read_support_format_cpio.lo \
libarchive/archive_read_support_format_empty.lo \
libarchive/archive_read_support_format_iso9660.lo \
libarchive/archive_read_support_format_mtree.lo \
+ libarchive/archive_read_support_format_raw.lo \
libarchive/archive_read_support_format_tar.lo \
+ libarchive/archive_read_support_format_xar.lo \
libarchive/archive_read_support_format_zip.lo \
libarchive/archive_string.lo \
libarchive/archive_string_sprintf.lo \
@@ -108,49 +220,62 @@ am_libarchive_la_OBJECTS = libarchive/archive_check_magic.lo \
libarchive/archive_write_set_compression_gzip.lo \
libarchive/archive_write_set_compression_none.lo \
libarchive/archive_write_set_compression_program.lo \
+ libarchive/archive_write_set_compression_xz.lo \
libarchive/archive_write_set_format.lo \
libarchive/archive_write_set_format_ar.lo \
libarchive/archive_write_set_format_by_name.lo \
libarchive/archive_write_set_format_cpio.lo \
libarchive/archive_write_set_format_cpio_newc.lo \
+ libarchive/archive_write_set_format_mtree.lo \
libarchive/archive_write_set_format_pax.lo \
libarchive/archive_write_set_format_shar.lo \
libarchive/archive_write_set_format_ustar.lo \
- libarchive/filter_fork.lo
+ libarchive/archive_write_set_format_zip.lo \
+ libarchive/filter_fork.lo $(am__objects_1)
libarchive_la_OBJECTS = $(am_libarchive_la_OBJECTS)
libarchive_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libarchive_la_LDFLAGS) $(LDFLAGS) -o $@
+libarchive_fe_la_LIBADD =
+am_libarchive_fe_la_OBJECTS = libarchive_fe/err.lo \
+ libarchive_fe/line_reader.lo libarchive_fe/matching.lo \
+ libarchive_fe/pathmatch.lo
+libarchive_fe_la_OBJECTS = $(am_libarchive_fe_la_OBJECTS)
@BUILD_BSDTAR_TRUE@am__EXEEXT_1 = bsdtar$(EXEEXT)
@BUILD_BSDCPIO_TRUE@am__EXEEXT_2 = bsdcpio$(EXEEXT)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@BUILD_BSDTAR_TRUE@am__EXEEXT_3 = bsdtar_test$(EXEEXT)
@BUILD_BSDCPIO_TRUE@am__EXEEXT_4 = bsdcpio_test$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
+am__bsdcpio_SOURCES_DIST = cpio/cmdline.c cpio/cpio.c cpio/cpio.h \
+ cpio/cpio_platform.h cpio/cpio_windows.h cpio/cpio_windows.c
+@INC_WINDOWS_FILES_TRUE@am__objects_2 = \
+@INC_WINDOWS_FILES_TRUE@ cpio/bsdcpio-cpio_windows.$(OBJEXT)
am_bsdcpio_OBJECTS = cpio/bsdcpio-cmdline.$(OBJEXT) \
- cpio/bsdcpio-cpio.$(OBJEXT) cpio/bsdcpio-err.$(OBJEXT) \
- cpio/bsdcpio-matching.$(OBJEXT) \
- cpio/bsdcpio-pathmatch.$(OBJEXT)
+ cpio/bsdcpio-cpio.$(OBJEXT) $(am__objects_2)
bsdcpio_OBJECTS = $(am_bsdcpio_OBJECTS)
bsdcpio_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(bsdcpio_LDFLAGS) \
$(LDFLAGS) -o $@
am_bsdcpio_test_OBJECTS = cpio/bsdcpio_test-cmdline.$(OBJEXT) \
- cpio/bsdcpio_test-err.$(OBJEXT) \
- cpio/bsdcpio_test-pathmatch.$(OBJEXT) \
cpio/test/bsdcpio_test-main.$(OBJEXT) \
cpio/test/bsdcpio_test-test_0.$(OBJEXT) \
cpio/test/bsdcpio_test-test_basic.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_cmdline.$(OBJEXT) \
cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT) \
cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_B_upper.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_C_upper.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_J_upper.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_L_upper.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_Z_upper.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_a.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_option_B.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_c.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_d.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_f.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_help.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_option_L.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_l.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_lzma.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_m.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_t.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_u.$(OBJEXT) \
@@ -158,40 +283,252 @@ am_bsdcpio_test_OBJECTS = cpio/bsdcpio_test-cmdline.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_y.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_z.$(OBJEXT) \
cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_passthrough_dotdot.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_passthrough_reverse.$(OBJEXT) \
cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT)
bsdcpio_test_OBJECTS = $(am_bsdcpio_test_OBJECTS)
-bsdcpio_test_LDADD = $(LDADD)
+bsdcpio_test_DEPENDENCIES = libarchive_fe.la
+am__bsdtar_SOURCES_DIST = tar/bsdtar.c tar/bsdtar.h \
+ tar/bsdtar_platform.h tar/cmdline.c tar/getdate.c tar/read.c \
+ tar/subst.c tar/tree.c tar/tree.h tar/util.c tar/write.c \
+ tar/bsdtar_windows.h tar/bsdtar_windows.c
+@INC_WINDOWS_FILES_TRUE@am__objects_3 = \
+@INC_WINDOWS_FILES_TRUE@ tar/bsdtar-bsdtar_windows.$(OBJEXT)
am_bsdtar_OBJECTS = tar/bsdtar-bsdtar.$(OBJEXT) \
- tar/bsdtar-getdate.$(OBJEXT) tar/bsdtar-matching.$(OBJEXT) \
- tar/bsdtar-read.$(OBJEXT) tar/bsdtar-siginfo.$(OBJEXT) \
- tar/bsdtar-subst.$(OBJEXT) tar/bsdtar-tree.$(OBJEXT) \
- tar/bsdtar-util.$(OBJEXT) tar/bsdtar-write.$(OBJEXT)
+ tar/bsdtar-cmdline.$(OBJEXT) tar/bsdtar-getdate.$(OBJEXT) \
+ tar/bsdtar-read.$(OBJEXT) tar/bsdtar-subst.$(OBJEXT) \
+ tar/bsdtar-tree.$(OBJEXT) tar/bsdtar-util.$(OBJEXT) \
+ tar/bsdtar-write.$(OBJEXT) $(am__objects_3)
bsdtar_OBJECTS = $(am_bsdtar_OBJECTS)
bsdtar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(bsdtar_LDFLAGS) \
$(LDFLAGS) -o $@
+am__bsdtar_test_SOURCES_DIST = tar/getdate.c tar/test/main.c \
+ tar/test/test.h tar/test/test_0.c tar/test/test_basic.c \
+ tar/test/test_copy.c tar/test/test_empty_mtree.c \
+ tar/test/test_getdate.c tar/test/test_help.c \
+ tar/test/test_option_T_upper.c tar/test/test_option_q.c \
+ tar/test/test_option_r.c tar/test/test_option_s.c \
+ tar/test/test_patterns.c tar/test/test_stdio.c \
+ tar/test/test_strip_components.c tar/test/test_symlink_dir.c \
+ tar/test/test_version.c tar/test/test_windows.c \
+ tar/bsdtar_windows.h tar/bsdtar_windows.c
+@INC_WINDOWS_FILES_TRUE@am__objects_4 = tar/bsdtar_test-bsdtar_windows.$(OBJEXT)
am_bsdtar_test_OBJECTS = tar/bsdtar_test-getdate.$(OBJEXT) \
tar/test/bsdtar_test-main.$(OBJEXT) \
tar/test/bsdtar_test-test_0.$(OBJEXT) \
tar/test/bsdtar_test-test_basic.$(OBJEXT) \
tar/test/bsdtar_test-test_copy.$(OBJEXT) \
+ tar/test/bsdtar_test-test_empty_mtree.$(OBJEXT) \
tar/test/bsdtar_test-test_getdate.$(OBJEXT) \
tar/test/bsdtar_test-test_help.$(OBJEXT) \
- tar/test/bsdtar_test-test_option_T.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_T_upper.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_q.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_r.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_s.$(OBJEXT) \
tar/test/bsdtar_test-test_patterns.$(OBJEXT) \
tar/test/bsdtar_test-test_stdio.$(OBJEXT) \
- tar/test/bsdtar_test-test_version.$(OBJEXT)
+ tar/test/bsdtar_test-test_strip_components.$(OBJEXT) \
+ tar/test/bsdtar_test-test_symlink_dir.$(OBJEXT) \
+ tar/test/bsdtar_test-test_version.$(OBJEXT) \
+ tar/test/bsdtar_test-test_windows.$(OBJEXT) $(am__objects_4)
bsdtar_test_OBJECTS = $(am_bsdtar_test_OBJECTS)
bsdtar_test_LDADD = $(LDADD)
-am__objects_1 = \
+am__libarchive_test_SOURCES_DIST = libarchive/archive_check_magic.c \
+ libarchive/archive_endian.h libarchive/archive_entry.c \
+ libarchive/archive_entry.h \
+ libarchive/archive_entry_copy_stat.c \
+ libarchive/archive_entry_link_resolver.c \
+ libarchive/archive_entry_private.h \
+ libarchive/archive_entry_stat.c \
+ libarchive/archive_entry_strmode.c \
+ libarchive/archive_entry_xattr.c libarchive/archive_hash.h \
+ libarchive/archive_platform.h libarchive/archive_private.h \
+ libarchive/archive_read.c \
+ libarchive/archive_read_data_into_fd.c \
+ libarchive/archive_read_disk.c \
+ libarchive/archive_read_disk_entry_from_file.c \
+ libarchive/archive_read_disk_private.h \
+ libarchive/archive_read_disk_set_standard_lookup.c \
+ libarchive/archive_read_extract.c \
+ libarchive/archive_read_open_fd.c \
+ libarchive/archive_read_open_file.c \
+ libarchive/archive_read_open_filename.c \
+ libarchive/archive_read_open_memory.c \
+ libarchive/archive_read_private.h \
+ libarchive/archive_read_support_compression_all.c \
+ libarchive/archive_read_support_compression_bzip2.c \
+ libarchive/archive_read_support_compression_compress.c \
+ libarchive/archive_read_support_compression_gzip.c \
+ libarchive/archive_read_support_compression_none.c \
+ libarchive/archive_read_support_compression_program.c \
+ libarchive/archive_read_support_compression_rpm.c \
+ libarchive/archive_read_support_compression_uu.c \
+ libarchive/archive_read_support_compression_xz.c \
+ libarchive/archive_read_support_format_all.c \
+ libarchive/archive_read_support_format_ar.c \
+ libarchive/archive_read_support_format_cpio.c \
+ libarchive/archive_read_support_format_empty.c \
+ libarchive/archive_read_support_format_iso9660.c \
+ libarchive/archive_read_support_format_mtree.c \
+ libarchive/archive_read_support_format_raw.c \
+ libarchive/archive_read_support_format_tar.c \
+ libarchive/archive_read_support_format_xar.c \
+ libarchive/archive_read_support_format_zip.c \
+ libarchive/archive_string.c libarchive/archive_string.h \
+ libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_virtual.c libarchive/archive_write.c \
+ libarchive/archive_write_disk.c \
+ libarchive/archive_write_disk_private.h \
+ libarchive/archive_write_disk_set_standard_lookup.c \
+ libarchive/archive_write_open_fd.c \
+ libarchive/archive_write_open_file.c \
+ libarchive/archive_write_open_filename.c \
+ libarchive/archive_write_open_memory.c \
+ libarchive/archive_write_private.h \
+ libarchive/archive_write_set_compression_bzip2.c \
+ libarchive/archive_write_set_compression_compress.c \
+ libarchive/archive_write_set_compression_gzip.c \
+ libarchive/archive_write_set_compression_none.c \
+ libarchive/archive_write_set_compression_program.c \
+ libarchive/archive_write_set_compression_xz.c \
+ libarchive/archive_write_set_format.c \
+ libarchive/archive_write_set_format_ar.c \
+ libarchive/archive_write_set_format_by_name.c \
+ libarchive/archive_write_set_format_cpio.c \
+ libarchive/archive_write_set_format_cpio_newc.c \
+ libarchive/archive_write_set_format_mtree.c \
+ libarchive/archive_write_set_format_pax.c \
+ libarchive/archive_write_set_format_shar.c \
+ libarchive/archive_write_set_format_ustar.c \
+ libarchive/archive_write_set_format_zip.c \
+ libarchive/config_freebsd.h libarchive/filter_fork.c \
+ libarchive/filter_fork.h libarchive/archive_entry_copy_bhfi.c \
+ libarchive/archive_windows.h libarchive/archive_windows.c \
+ libarchive/filter_fork_windows.c libarchive/test/main.c \
+ libarchive/test/read_open_memory.c libarchive/test/test.h \
+ libarchive/test/test_acl_basic.c \
+ libarchive/test/test_acl_freebsd.c \
+ libarchive/test/test_acl_pax.c \
+ libarchive/test/test_archive_api_feature.c \
+ libarchive/test/test_bad_fd.c \
+ libarchive/test/test_compat_bzip2.c \
+ libarchive/test/test_compat_cpio.c \
+ libarchive/test/test_compat_gtar.c \
+ libarchive/test/test_compat_gzip.c \
+ libarchive/test/test_compat_lzma.c \
+ libarchive/test/test_compat_solaris_tar_acl.c \
+ libarchive/test/test_compat_tar_hardlink.c \
+ libarchive/test/test_compat_xz.c \
+ libarchive/test/test_compat_zip.c \
+ libarchive/test/test_empty_write.c \
+ libarchive/test/test_entry.c \
+ libarchive/test/test_extattr_freebsd.c \
+ libarchive/test/test_fuzz.c \
+ libarchive/test/test_entry_strmode.c \
+ libarchive/test/test_link_resolver.c \
+ libarchive/test/test_open_fd.c \
+ libarchive/test/test_open_file.c \
+ libarchive/test/test_open_filename.c \
+ libarchive/test/test_pax_filename_encoding.c \
+ libarchive/test/test_read_compress_program.c \
+ libarchive/test/test_read_data_large.c \
+ libarchive/test/test_read_disk.c \
+ libarchive/test/test_read_disk_entry_from_file.c \
+ libarchive/test/test_read_extract.c \
+ libarchive/test/test_read_file_nonexistent.c \
+ libarchive/test/test_read_format_ar.c \
+ libarchive/test/test_read_format_cpio_bin.c \
+ libarchive/test/test_read_format_cpio_bin_Z.c \
+ libarchive/test/test_read_format_cpio_bin_be.c \
+ libarchive/test/test_read_format_cpio_bin_bz2.c \
+ libarchive/test/test_read_format_cpio_bin_gz.c \
+ libarchive/test/test_read_format_cpio_bin_lzma.c \
+ libarchive/test/test_read_format_cpio_bin_xz.c \
+ libarchive/test/test_read_format_cpio_odc.c \
+ libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c \
+ libarchive/test/test_read_format_cpio_svr4_gzip.c \
+ libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c \
+ libarchive/test/test_read_format_cpio_svr4c_Z.c \
+ libarchive/test/test_read_format_empty.c \
+ libarchive/test/test_read_format_gtar_gz.c \
+ libarchive/test/test_read_format_gtar_lzma.c \
+ libarchive/test/test_read_format_gtar_sparse.c \
+ libarchive/test/test_read_format_iso_gz.c \
+ libarchive/test/test_read_format_iso_multi_extent.c \
+ libarchive/test/test_read_format_isojoliet_bz2.c \
+ libarchive/test/test_read_format_isojoliet_long.c \
+ libarchive/test/test_read_format_isojoliet_rr.c \
+ libarchive/test/test_read_format_isorr_bz2.c \
+ libarchive/test/test_read_format_isorr_ce.c \
+ libarchive/test/test_read_format_isorr_new_bz2.c \
+ libarchive/test/test_read_format_isorr_rr_moved.c \
+ libarchive/test/test_read_format_isozisofs_bz2.c \
+ libarchive/test/test_read_format_mtree.c \
+ libarchive/test/test_read_format_pax_bz2.c \
+ libarchive/test/test_read_format_raw.c \
+ libarchive/test/test_read_format_tar.c \
+ libarchive/test/test_read_format_tar_empty_filename.c \
+ libarchive/test/test_read_format_tbz.c \
+ libarchive/test/test_read_format_tgz.c \
+ libarchive/test/test_read_format_tlz.c \
+ libarchive/test/test_read_format_txz.c \
+ libarchive/test/test_read_format_tz.c \
+ libarchive/test/test_read_format_xar.c \
+ libarchive/test/test_read_format_zip.c \
+ libarchive/test/test_read_large.c \
+ libarchive/test/test_read_pax_truncated.c \
+ libarchive/test/test_read_position.c \
+ libarchive/test/test_read_truncated.c \
+ libarchive/test/test_read_uu.c \
+ libarchive/test/test_tar_filenames.c \
+ libarchive/test/test_tar_large.c \
+ libarchive/test/test_ustar_filenames.c \
+ libarchive/test/test_write_compress.c \
+ libarchive/test/test_write_compress_bzip2.c \
+ libarchive/test/test_write_compress_gzip.c \
+ libarchive/test/test_write_compress_lzma.c \
+ libarchive/test/test_write_compress_program.c \
+ libarchive/test/test_write_compress_xz.c \
+ libarchive/test/test_write_disk.c \
+ libarchive/test/test_write_disk_failures.c \
+ libarchive/test/test_write_disk_hardlink.c \
+ libarchive/test/test_write_disk_perms.c \
+ libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_sparse.c \
+ libarchive/test/test_write_disk_symlink.c \
+ libarchive/test/test_write_disk_times.c \
+ libarchive/test/test_write_format_ar.c \
+ libarchive/test/test_write_format_cpio.c \
+ libarchive/test/test_write_format_cpio_empty.c \
+ libarchive/test/test_write_format_cpio_odc.c \
+ libarchive/test/test_write_format_cpio_newc.c \
+ libarchive/test/test_write_format_mtree.c \
+ libarchive/test/test_write_format_pax.c \
+ libarchive/test/test_write_format_shar_empty.c \
+ libarchive/test/test_write_format_tar.c \
+ libarchive/test/test_write_format_tar_empty.c \
+ libarchive/test/test_write_format_tar_ustar.c \
+ libarchive/test/test_write_format_zip.c \
+ libarchive/test/test_write_format_zip_empty.c \
+ libarchive/test/test_write_format_zip_no_compression.c \
+ libarchive/test/test_write_open_memory.c
+@INC_WINDOWS_FILES_TRUE@am__objects_5 = libarchive/libarchive_test-archive_entry_copy_bhfi.$(OBJEXT) \
+@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-archive_windows.$(OBJEXT) \
+@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-filter_fork_windows.$(OBJEXT)
+am__objects_6 = \
libarchive/libarchive_test-archive_check_magic.$(OBJEXT) \
libarchive/libarchive_test-archive_entry.$(OBJEXT) \
libarchive/libarchive_test-archive_entry_copy_stat.$(OBJEXT) \
libarchive/libarchive_test-archive_entry_link_resolver.$(OBJEXT) \
libarchive/libarchive_test-archive_entry_stat.$(OBJEXT) \
libarchive/libarchive_test-archive_entry_strmode.$(OBJEXT) \
+ libarchive/libarchive_test-archive_entry_xattr.$(OBJEXT) \
libarchive/libarchive_test-archive_read.$(OBJEXT) \
libarchive/libarchive_test-archive_read_data_into_fd.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_disk.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_disk_entry_from_file.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_disk_set_standard_lookup.$(OBJEXT) \
libarchive/libarchive_test-archive_read_extract.$(OBJEXT) \
libarchive/libarchive_test-archive_read_open_fd.$(OBJEXT) \
libarchive/libarchive_test-archive_read_open_file.$(OBJEXT) \
@@ -203,13 +540,18 @@ am__objects_1 = \
libarchive/libarchive_test-archive_read_support_compression_gzip.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_compression_none.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_compression_program.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_support_compression_rpm.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_support_compression_uu.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_support_compression_xz.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_all.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_ar.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_cpio.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_empty.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_iso9660.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_mtree.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_support_format_raw.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_tar.$(OBJEXT) \
+ libarchive/libarchive_test-archive_read_support_format_xar.$(OBJEXT) \
libarchive/libarchive_test-archive_read_support_format_zip.$(OBJEXT) \
libarchive/libarchive_test-archive_string.$(OBJEXT) \
libarchive/libarchive_test-archive_string_sprintf.$(OBJEXT) \
@@ -227,81 +569,132 @@ am__objects_1 = \
libarchive/libarchive_test-archive_write_set_compression_gzip.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_compression_none.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_compression_program.$(OBJEXT) \
+ libarchive/libarchive_test-archive_write_set_compression_xz.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_ar.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_by_name.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_cpio.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_cpio_newc.$(OBJEXT) \
+ libarchive/libarchive_test-archive_write_set_format_mtree.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_pax.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_shar.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_format_ustar.$(OBJEXT) \
- libarchive/libarchive_test-filter_fork.$(OBJEXT)
-am_libarchive_test_OBJECTS = $(am__objects_1) \
+ libarchive/libarchive_test-archive_write_set_format_zip.$(OBJEXT) \
+ libarchive/libarchive_test-filter_fork.$(OBJEXT) \
+ $(am__objects_5)
+am_libarchive_test_OBJECTS = $(am__objects_6) \
libarchive/test/libarchive_test-main.$(OBJEXT) \
libarchive/test/libarchive_test-read_open_memory.$(OBJEXT) \
libarchive/test/libarchive_test-test_acl_basic.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_acl_freebsd.$(OBJEXT) \
libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT) \
libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT) \
libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_bzip2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_cpio.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_gzip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_lzma.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_solaris_tar_acl.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_xz.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT) \
libarchive/test/libarchive_test-test_empty_write.$(OBJEXT) \
libarchive/test/libarchive_test-test_entry.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_extattr_freebsd.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_fuzz.$(OBJEXT) \
libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT) \
libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_open_fd.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_open_file.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_open_filename.$(OBJEXT) \
libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_data_large.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_disk.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_disk_entry_from_file.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_extract.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_file_nonexistent.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_ar.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_bin.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_bin_Z.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_cpio_bin_be.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_bin_gz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_odc.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_empty.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_gtar_gz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_gtar_lzma.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_gtar_sparse.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_iso_gz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_iso_multi_extent.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isojoliet_long.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isojoliet_rr.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_isorr_bz2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isorr_ce.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_raw.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_tar_empty_filename.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_tgz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_tlz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_txz.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_tz.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_xar.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_large.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_pax_truncated.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_position.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_truncated.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_uu.$(OBJEXT) \
libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT) \
libarchive/test/libarchive_test-test_tar_large.$(OBJEXT) \
libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_compress.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_compress_bzip2.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_compress_gzip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_compress_lzma.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_compress_xz.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_failures.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_sparse.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_symlink.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_times.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_ar.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_cpio.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_cpio_empty.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_cpio_odc.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_cpio_newc.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_format_mtree.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_format_pax.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_shar_empty.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_tar.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_format_zip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_format_zip_empty.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_format_zip_no_compression.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT)
libarchive_test_OBJECTS = $(am_libarchive_test_OBJECTS)
libarchive_test_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/config.aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/autoconf/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -312,21 +705,21 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
-YLWRAP = $(top_srcdir)/config.aux/ylwrap
-SOURCES = $(libarchive_la_SOURCES) $(bsdcpio_SOURCES) \
- $(bsdcpio_test_SOURCES) $(bsdtar_SOURCES) \
- $(bsdtar_test_SOURCES) $(libarchive_test_SOURCES)
-DIST_SOURCES = $(libarchive_la_SOURCES) $(bsdcpio_SOURCES) \
- $(bsdcpio_test_SOURCES) $(bsdtar_SOURCES) \
+SOURCES = $(libarchive_la_SOURCES) $(libarchive_fe_la_SOURCES) \
+ $(bsdcpio_SOURCES) $(bsdcpio_test_SOURCES) $(bsdtar_SOURCES) \
$(bsdtar_test_SOURCES) $(libarchive_test_SOURCES)
+DIST_SOURCES = $(am__libarchive_la_SOURCES_DIST) \
+ $(libarchive_fe_la_SOURCES) $(am__bsdcpio_SOURCES_DIST) \
+ $(bsdcpio_test_SOURCES) $(am__bsdtar_SOURCES_DIST) \
+ $(am__bsdtar_test_SOURCES_DIST) \
+ $(am__libarchive_test_SOURCES_DIST)
man1dir = $(mandir)/man1
man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
NROFF = nroff
MANS = $(man_MANS)
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
@@ -346,6 +739,7 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
ARCHIVE_LIBTOOL_VERSION = @ARCHIVE_LIBTOOL_VERSION@
+AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -357,38 +751,42 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBARCHIVE_VERSION_NUMBER = @LIBARCHIVE_VERSION_NUMBER@
LIBARCHIVE_VERSION_STRING = @LIBARCHIVE_VERSION_STRING@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -396,20 +794,24 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+# Uncommenting this line can help diagnose some errors. This is ordinarily
+# enabled in the libarchive development branch but is disabled
+# for libarchive production releases.
+#AM_CFLAGS=-Wall -Werror
+PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
-YACC = @YACC@
-YFLAGS = @YFLAGS@
+XML2_CONFIG = @XML2_CONFIG@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -440,6 +842,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -452,28 +855,38 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign subdir-objects
+ACLOCAL_AMFLAGS = -I build/autoconf
#
# What to build and install
#
lib_LTLIBRARIES = libarchive.la
+noinst_LTLIBRARIES = libarchive_fe.la
man_MANS = $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS)
BUILT_SOURCES = libarchive/test/list.h tar/test/list.h cpio/test/list.h
TESTS_ENVIRONMENT = $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT)
# Always build and test both bsdtar and bsdcpio as part of 'distcheck'
DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
+AM_CPPFLAGS = $(PLATFORMCPPFLAGS)
#
# What to include in the distribution
#
-EXTRA_DIST = version \
+EXTRA_DIST = \
+ CMakeLists.txt \
+ build/autogen.sh \
+ build/bump-version.sh \
+ build/clean.sh \
+ build/cmake \
+ build/version \
+ build/windows \
contrib \
doc \
examples \
- windows \
$(libarchive_EXTRA_DIST) \
$(libarchive_test_EXTRA_DIST) \
$(bsdtar_EXTRA_DIST) \
@@ -485,7 +898,7 @@ EXTRA_DIST = version \
#
# Extra rules for cleanup
#
-DISTCLEANFILES = tar/getdate.c tar/getdate.h \
+DISTCLEANFILES = \
libarchive/test/list.h \
tar/test/list.h \
cpio/test/list.h
@@ -496,81 +909,86 @@ DISTCLEANFILES = tar/getdate.c tar/getdate.h \
#
#
include_HEADERS = libarchive/archive.h libarchive/archive_entry.h
-libarchive_la_SOURCES = \
- libarchive/archive_check_magic.c \
- libarchive/archive_endian.h \
- libarchive/archive_entry.c \
- libarchive/archive_entry.h \
- libarchive/archive_entry_copy_stat.c \
- libarchive/archive_entry_link_resolver.c \
- libarchive/archive_entry_private.h \
- libarchive/archive_entry_stat.c \
- libarchive/archive_entry_strmode.c \
- libarchive/archive_platform.h \
- libarchive/archive_private.h \
- libarchive/archive_read.c \
- libarchive/archive_read_data_into_fd.c \
- libarchive/archive_read_extract.c \
- libarchive/archive_read_open_fd.c \
- libarchive/archive_read_open_file.c \
- libarchive/archive_read_open_filename.c \
- libarchive/archive_read_open_memory.c \
- libarchive/archive_read_private.h \
- libarchive/archive_read_support_compression_all.c \
- libarchive/archive_read_support_compression_bzip2.c \
- libarchive/archive_read_support_compression_compress.c \
- libarchive/archive_read_support_compression_gzip.c \
- libarchive/archive_read_support_compression_none.c \
- libarchive/archive_read_support_compression_program.c \
- libarchive/archive_read_support_format_all.c \
- libarchive/archive_read_support_format_ar.c \
- libarchive/archive_read_support_format_cpio.c \
- libarchive/archive_read_support_format_empty.c \
- libarchive/archive_read_support_format_iso9660.c \
- libarchive/archive_read_support_format_mtree.c \
- libarchive/archive_read_support_format_tar.c \
- libarchive/archive_read_support_format_zip.c \
- libarchive/archive_string.c \
- libarchive/archive_string.h \
- libarchive/archive_string_sprintf.c \
- libarchive/archive_util.c \
- libarchive/archive_virtual.c \
- libarchive/archive_write.c \
- libarchive/archive_write_disk.c \
- libarchive/archive_write_disk_private.h \
- libarchive/archive_write_disk_set_standard_lookup.c \
- libarchive/archive_write_open_fd.c \
- libarchive/archive_write_open_file.c \
- libarchive/archive_write_open_filename.c \
- libarchive/archive_write_open_memory.c \
- libarchive/archive_write_private.h \
- libarchive/archive_write_set_compression_bzip2.c \
- libarchive/archive_write_set_compression_compress.c \
- libarchive/archive_write_set_compression_gzip.c \
- libarchive/archive_write_set_compression_none.c \
- libarchive/archive_write_set_compression_program.c \
- libarchive/archive_write_set_format.c \
- libarchive/archive_write_set_format_ar.c \
- libarchive/archive_write_set_format_by_name.c \
- libarchive/archive_write_set_format_cpio.c \
- libarchive/archive_write_set_format_cpio_newc.c \
- libarchive/archive_write_set_format_pax.c \
- libarchive/archive_write_set_format_shar.c \
- libarchive/archive_write_set_format_ustar.c \
- libarchive/config_freebsd.h \
- libarchive/config_windows.h \
- libarchive/filter_fork.c \
- libarchive/filter_fork.h
-
-
-# cygwin barfs without -no-undefined; I don't know what it does or
-# whether it helps or hurts other platforms...
+libarchive_la_SOURCES = libarchive/archive_check_magic.c \
+ libarchive/archive_endian.h libarchive/archive_entry.c \
+ libarchive/archive_entry.h \
+ libarchive/archive_entry_copy_stat.c \
+ libarchive/archive_entry_link_resolver.c \
+ libarchive/archive_entry_private.h \
+ libarchive/archive_entry_stat.c \
+ libarchive/archive_entry_strmode.c \
+ libarchive/archive_entry_xattr.c libarchive/archive_hash.h \
+ libarchive/archive_platform.h libarchive/archive_private.h \
+ libarchive/archive_read.c \
+ libarchive/archive_read_data_into_fd.c \
+ libarchive/archive_read_disk.c \
+ libarchive/archive_read_disk_entry_from_file.c \
+ libarchive/archive_read_disk_private.h \
+ libarchive/archive_read_disk_set_standard_lookup.c \
+ libarchive/archive_read_extract.c \
+ libarchive/archive_read_open_fd.c \
+ libarchive/archive_read_open_file.c \
+ libarchive/archive_read_open_filename.c \
+ libarchive/archive_read_open_memory.c \
+ libarchive/archive_read_private.h \
+ libarchive/archive_read_support_compression_all.c \
+ libarchive/archive_read_support_compression_bzip2.c \
+ libarchive/archive_read_support_compression_compress.c \
+ libarchive/archive_read_support_compression_gzip.c \
+ libarchive/archive_read_support_compression_none.c \
+ libarchive/archive_read_support_compression_program.c \
+ libarchive/archive_read_support_compression_rpm.c \
+ libarchive/archive_read_support_compression_uu.c \
+ libarchive/archive_read_support_compression_xz.c \
+ libarchive/archive_read_support_format_all.c \
+ libarchive/archive_read_support_format_ar.c \
+ libarchive/archive_read_support_format_cpio.c \
+ libarchive/archive_read_support_format_empty.c \
+ libarchive/archive_read_support_format_iso9660.c \
+ libarchive/archive_read_support_format_mtree.c \
+ libarchive/archive_read_support_format_raw.c \
+ libarchive/archive_read_support_format_tar.c \
+ libarchive/archive_read_support_format_xar.c \
+ libarchive/archive_read_support_format_zip.c \
+ libarchive/archive_string.c libarchive/archive_string.h \
+ libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_virtual.c libarchive/archive_write.c \
+ libarchive/archive_write_disk.c \
+ libarchive/archive_write_disk_private.h \
+ libarchive/archive_write_disk_set_standard_lookup.c \
+ libarchive/archive_write_open_fd.c \
+ libarchive/archive_write_open_file.c \
+ libarchive/archive_write_open_filename.c \
+ libarchive/archive_write_open_memory.c \
+ libarchive/archive_write_private.h \
+ libarchive/archive_write_set_compression_bzip2.c \
+ libarchive/archive_write_set_compression_compress.c \
+ libarchive/archive_write_set_compression_gzip.c \
+ libarchive/archive_write_set_compression_none.c \
+ libarchive/archive_write_set_compression_program.c \
+ libarchive/archive_write_set_compression_xz.c \
+ libarchive/archive_write_set_format.c \
+ libarchive/archive_write_set_format_ar.c \
+ libarchive/archive_write_set_format_by_name.c \
+ libarchive/archive_write_set_format_cpio.c \
+ libarchive/archive_write_set_format_cpio_newc.c \
+ libarchive/archive_write_set_format_mtree.c \
+ libarchive/archive_write_set_format_pax.c \
+ libarchive/archive_write_set_format_shar.c \
+ libarchive/archive_write_set_format_ustar.c \
+ libarchive/archive_write_set_format_zip.c \
+ libarchive/config_freebsd.h libarchive/filter_fork.c \
+ libarchive/filter_fork.h $(am__append_1)
+
+# -no-undefined marks that libarchive doesn't rely on symbols
+# defined in the application. This is mandatory for cygwin.
libarchive_la_LDFLAGS = -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
# Manpages to install
libarchive_man_MANS = \
libarchive/archive_entry.3 \
libarchive/archive_read.3 \
+ libarchive/archive_read_disk.3 \
libarchive/archive_util.3 \
libarchive/archive_write.3 \
libarchive/archive_write_disk.3 \
@@ -587,9 +1005,15 @@ libarchive_EXTRA_DIST = \
libarchive/test/list.h \
libarchive/archive_windows.c \
libarchive/archive_windows.h \
+ libarchive/filter_fork_windows.c \
+ libarchive/CMakeLists.txt \
$(libarchive_man_MANS)
+# pkgconfig
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = build/pkgconfig/libarchive.pc
+
#
#
# libarchive_test program
@@ -601,81 +1025,172 @@ libarchive_test_SOURCES = \
libarchive/test/read_open_memory.c \
libarchive/test/test.h \
libarchive/test/test_acl_basic.c \
+ libarchive/test/test_acl_freebsd.c \
libarchive/test/test_acl_pax.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_bad_fd.c \
+ libarchive/test/test_compat_bzip2.c \
+ libarchive/test/test_compat_cpio.c \
libarchive/test/test_compat_gtar.c \
+ libarchive/test/test_compat_gzip.c \
+ libarchive/test/test_compat_lzma.c \
+ libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_tar_hardlink.c \
+ libarchive/test/test_compat_xz.c \
libarchive/test/test_compat_zip.c \
libarchive/test/test_empty_write.c \
libarchive/test/test_entry.c \
+ libarchive/test/test_extattr_freebsd.c \
+ libarchive/test/test_fuzz.c \
libarchive/test/test_entry_strmode.c \
libarchive/test/test_link_resolver.c \
+ libarchive/test/test_open_fd.c \
+ libarchive/test/test_open_file.c \
+ libarchive/test/test_open_filename.c \
libarchive/test/test_pax_filename_encoding.c \
libarchive/test/test_read_compress_program.c \
libarchive/test/test_read_data_large.c \
+ libarchive/test/test_read_disk.c \
+ libarchive/test/test_read_disk_entry_from_file.c \
libarchive/test/test_read_extract.c \
+ libarchive/test/test_read_file_nonexistent.c \
libarchive/test/test_read_format_ar.c \
libarchive/test/test_read_format_cpio_bin.c \
libarchive/test/test_read_format_cpio_bin_Z.c \
+ libarchive/test/test_read_format_cpio_bin_be.c \
libarchive/test/test_read_format_cpio_bin_bz2.c \
libarchive/test/test_read_format_cpio_bin_gz.c \
+ libarchive/test/test_read_format_cpio_bin_lzma.c \
+ libarchive/test/test_read_format_cpio_bin_xz.c \
libarchive/test/test_read_format_cpio_odc.c \
+ libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c \
libarchive/test/test_read_format_cpio_svr4_gzip.c \
+ libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c \
libarchive/test/test_read_format_cpio_svr4c_Z.c \
libarchive/test/test_read_format_empty.c \
libarchive/test/test_read_format_gtar_gz.c \
+ libarchive/test/test_read_format_gtar_lzma.c \
libarchive/test/test_read_format_gtar_sparse.c \
libarchive/test/test_read_format_iso_gz.c \
+ libarchive/test/test_read_format_iso_multi_extent.c \
+ libarchive/test/test_read_format_isojoliet_bz2.c \
+ libarchive/test/test_read_format_isojoliet_long.c \
+ libarchive/test/test_read_format_isojoliet_rr.c \
libarchive/test/test_read_format_isorr_bz2.c \
+ libarchive/test/test_read_format_isorr_ce.c \
+ libarchive/test/test_read_format_isorr_new_bz2.c \
+ libarchive/test/test_read_format_isorr_rr_moved.c \
+ libarchive/test/test_read_format_isozisofs_bz2.c \
libarchive/test/test_read_format_mtree.c \
libarchive/test/test_read_format_pax_bz2.c \
+ libarchive/test/test_read_format_raw.c \
libarchive/test/test_read_format_tar.c \
libarchive/test/test_read_format_tar_empty_filename.c \
libarchive/test/test_read_format_tbz.c \
libarchive/test/test_read_format_tgz.c \
+ libarchive/test/test_read_format_tlz.c \
+ libarchive/test/test_read_format_txz.c \
libarchive/test/test_read_format_tz.c \
+ libarchive/test/test_read_format_xar.c \
libarchive/test/test_read_format_zip.c \
libarchive/test/test_read_large.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
libarchive/test/test_read_truncated.c \
+ libarchive/test/test_read_uu.c \
libarchive/test/test_tar_filenames.c \
libarchive/test/test_tar_large.c \
libarchive/test/test_ustar_filenames.c \
libarchive/test/test_write_compress.c \
+ libarchive/test/test_write_compress_bzip2.c \
+ libarchive/test/test_write_compress_gzip.c \
+ libarchive/test/test_write_compress_lzma.c \
libarchive/test/test_write_compress_program.c \
+ libarchive/test/test_write_compress_xz.c \
libarchive/test/test_write_disk.c \
+ libarchive/test/test_write_disk_failures.c \
libarchive/test/test_write_disk_hardlink.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_sparse.c \
+ libarchive/test/test_write_disk_symlink.c \
+ libarchive/test/test_write_disk_times.c \
libarchive/test/test_write_format_ar.c \
libarchive/test/test_write_format_cpio.c \
libarchive/test/test_write_format_cpio_empty.c \
libarchive/test/test_write_format_cpio_odc.c \
libarchive/test/test_write_format_cpio_newc.c \
+ libarchive/test/test_write_format_mtree.c \
+ libarchive/test/test_write_format_pax.c \
libarchive/test/test_write_format_shar_empty.c \
libarchive/test/test_write_format_tar.c \
libarchive/test/test_write_format_tar_empty.c \
libarchive/test/test_write_format_tar_ustar.c \
+ libarchive/test/test_write_format_zip.c \
+ libarchive/test/test_write_format_zip_empty.c \
+ libarchive/test/test_write_format_zip_no_compression.c \
libarchive/test/test_write_open_memory.c
-libarchive_test_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test
+libarchive_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test
libarchive_test_EXTRA_DIST = \
- libarchive/test/test_compat_gtar_1.tgz.uu \
+ libarchive/test/test_compat_bzip2_1.tbz.uu \
+ libarchive/test/test_compat_bzip2_2.tbz.uu \
+ libarchive/test/test_compat_cpio_1.cpio.uu \
+ libarchive/test/test_compat_gtar_1.tar.uu \
+ libarchive/test/test_compat_gzip_1.tgz.uu \
+ libarchive/test/test_compat_gzip_2.tgz.uu \
+ libarchive/test/test_compat_lzma_1.tlz.uu \
+ libarchive/test/test_compat_lzma_2.tlz.uu \
+ libarchive/test/test_compat_lzma_3.tlz.uu \
+ libarchive/test/test_compat_solaris_tar_acl.tar.uu \
libarchive/test/test_compat_tar_hardlink_1.tar.uu \
+ libarchive/test/test_compat_xz_1.txz.uu \
libarchive/test/test_compat_zip_1.zip.uu \
- libarchive/test/test_pax_filename_encoding.tar.gz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu \
- libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu \
+ libarchive/test/test_fuzz_1.iso.Z.uu \
+ libarchive/test/test_pax_filename_encoding.tar.uu \
+ libarchive/test/test_read_format_ar.ar.uu \
+ libarchive/test/test_read_format_cpio_bin_be.cpio.uu \
+ libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu \
+ libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \
libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \
- libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu \
+ libarchive/test/test_read_format_iso.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu \
+ libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu \
+ libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu \
+ libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu\
+ libarchive/test/test_read_format_iso_zisofs.iso.Z.uu \
+ libarchive/test/test_read_format_mtree.mtree.uu \
+ libarchive/test/test_read_format_raw.data.Z.uu \
+ libarchive/test/test_read_format_raw.data.uu \
libarchive/test/test_read_format_tar_empty_filename.tar.uu \
- libarchive/test/test_read_format_zip.zip.uu
+ libarchive/test/test_read_format_zip.zip.uu \
+ libarchive/test/CMakeLists.txt \
+ libarchive/test/README
+
+
+#
+# Common code for libarchive frontends (cpio, tar)
+#
+libarchive_fe_la_SOURCES = \
+ libarchive_fe/err.c \
+ libarchive_fe/err.h \
+ libarchive_fe/lafe_platform.h \
+ libarchive_fe/line_reader.c \
+ libarchive_fe/line_reader.h \
+ libarchive_fe/matching.c \
+ libarchive_fe/matching.h \
+ libarchive_fe/pathmatch.c \
+ libarchive_fe/pathmatch.h
#
@@ -683,28 +1198,24 @@ libarchive_test_EXTRA_DIST = \
# bsdtar source, docs, etc.
#
#
-bsdtar_SOURCES = \
- tar/bsdtar.c \
- tar/bsdtar.h \
- tar/bsdtar_platform.h \
- tar/getdate.y \
- tar/matching.c \
- tar/read.c \
- tar/siginfo.c \
- tar/subst.c \
- tar/tree.c \
- tar/tree.h \
- tar/util.c \
- tar/write.c
-
-bsdtar_DEPENDENCIES = libarchive.la
-@STATIC_BSDTAR_FALSE@bsdtar_static =
-@STATIC_BSDTAR_TRUE@bsdtar_static = -static
-bsdtar_LDADD = libarchive.la
-bsdtar_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
-bsdtar_LDFLAGS = $(bsdtar_static)
+bsdtar_SOURCES = tar/bsdtar.c tar/bsdtar.h tar/bsdtar_platform.h \
+ tar/cmdline.c tar/getdate.c tar/read.c tar/subst.c tar/tree.c \
+ tar/tree.h tar/util.c tar/write.c $(am__append_2)
+bsdtar_DEPENDENCIES = libarchive.la libarchive_fe.la
+@STATIC_BSDTAR_FALSE@bsdtar_ldstatic =
+@STATIC_BSDTAR_TRUE@bsdtar_ldstatic = -static
+@STATIC_BSDTAR_FALSE@bsdtar_ccstatic =
+@STATIC_BSDTAR_TRUE@bsdtar_ccstatic = -DLIBARCHIVE_STATIC
+bsdtar_LDADD = libarchive.la libarchive_fe.la
+bsdtar_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS)
+bsdtar_LDFLAGS = $(bsdtar_ldstatic)
bsdtar_EXTRA_DIST = \
- tar/bsdtar.1
+ tar/bsdtar.1 \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c \
+ tar/CMakeLists.txt \
+ tar/config_freebsd.h \
+ tar/test/list.h
@BUILD_BSDTAR_FALSE@bsdtar_man_MANS =
@BUILD_BSDTAR_TRUE@bsdtar_man_MANS = tar/bsdtar.1
@@ -714,51 +1225,53 @@ bsdtar_EXTRA_DIST = \
#
# bsdtar_test
#
-bsdtar_test_SOURCES = \
- tar/getdate.c \
- tar/test/main.c \
- tar/test/test.h \
- tar/test/test_0.c \
- tar/test/test_basic.c \
- tar/test/test_copy.c \
- tar/test/test_getdate.c \
- tar/test/test_help.c \
- tar/test/test_option_T.c \
- tar/test/test_patterns.c \
- tar/test/test_stdio.c \
- tar/test/test_version.c
-
-bsdtar_test_CPPFLAGS = -I$(top_builddir)/tar/test
+bsdtar_test_SOURCES = tar/getdate.c tar/test/main.c tar/test/test.h \
+ tar/test/test_0.c tar/test/test_basic.c tar/test/test_copy.c \
+ tar/test/test_empty_mtree.c tar/test/test_getdate.c \
+ tar/test/test_help.c tar/test/test_option_T_upper.c \
+ tar/test/test_option_q.c tar/test/test_option_r.c \
+ tar/test/test_option_s.c tar/test/test_patterns.c \
+ tar/test/test_stdio.c tar/test/test_strip_components.c \
+ tar/test/test_symlink_dir.c tar/test/test_version.c \
+ tar/test/test_windows.c $(am__append_3)
+bsdtar_test_CPPFLAGS = \
+ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
+ -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+ $(PLATFORMCPPFLAGS)
+
@BUILD_BSDTAR_FALSE@bsdtar_test_programs =
@BUILD_BSDTAR_TRUE@bsdtar_test_programs = bsdtar_test
@BUILD_BSDTAR_FALSE@bsdtar_TESTS_ENVIRONMENT =
-@BUILD_BSDTAR_TRUE@bsdtar_TESTS_ENVIRONMENT = BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
+@BUILD_BSDTAR_TRUE@bsdtar_TESTS_ENVIRONMENT = BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar$(EXEEXT) BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
+bsdtar_test_EXTRA_DIST = \
+ tar/test/test_patterns_2.tar.uu \
+ tar/test/test_patterns_3.tar.uu \
+ tar/test/test_patterns_4.tar.uu \
+ tar/test/CMakeLists.txt
+
#
#
# bsdcpio source, docs, etc.
#
#
-bsdcpio_SOURCES = \
- cpio/cmdline.c \
- cpio/cpio.c \
- cpio/cpio.h \
- cpio/cpio_platform.h \
- cpio/err.c \
- cpio/matching.c \
- cpio/matching.h \
- cpio/pathmatch.c \
- cpio/pathmatch.h
-
-bsdcpio_DEPENDENCIES = libarchive.la
-@STATIC_BSDCPIO_FALSE@bsdcpio_static =
-@STATIC_BSDCPIO_TRUE@bsdcpio_static = -static
-bsdcpio_LDADD = libarchive.la
-bsdcpio_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
-bsdcpio_LDFLAGS = $(bsdcpio_static)
+bsdcpio_SOURCES = cpio/cmdline.c cpio/cpio.c cpio/cpio.h \
+ cpio/cpio_platform.h $(am__append_4)
+bsdcpio_DEPENDENCIES = libarchive.la libarchive_fe.la
+@STATIC_BSDCPIO_FALSE@bsdcpio_ldstatic =
+@STATIC_BSDCPIO_TRUE@bsdcpio_ldstatic = -static
+@STATIC_BSDCPIO_FALSE@bsdcpio_ccstatic =
+@STATIC_BSDCPIO_TRUE@bsdcpio_ccstatic = -DLIBARCHIVE_STATIC
+bsdcpio_LDADD = libarchive_fe.la libarchive.la
+bsdcpio_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcpio_ccstatic) $(PLATFORMCPPFLAGS)
+bsdcpio_LDFLAGS = $(bsdcpio_ldstatic)
bsdcpio_EXTRA_DIST = \
cpio/test/list.h \
- cpio/bsdcpio.1
+ cpio/bsdcpio.1 \
+ cpio/cpio_windows.h \
+ cpio/cpio_windows.c \
+ cpio/CMakeLists.txt \
+ cpio/config_freebsd.h
@BUILD_BSDCPIO_FALSE@bsdcpio_man_MANS =
@@ -772,22 +1285,25 @@ bsdcpio_EXTRA_DIST = \
#
bsdcpio_test_SOURCES = \
cpio/cmdline.c \
- cpio/err.c \
- cpio/pathmatch.c \
cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_0.c \
cpio/test/test_basic.c \
+ cpio/test/test_cmdline.c \
cpio/test/test_format_newc.c \
cpio/test/test_gcpio_compat.c \
+ cpio/test/test_option_B_upper.c \
+ cpio/test/test_option_C_upper.c \
+ cpio/test/test_option_J_upper.c \
+ cpio/test/test_option_L_upper.c \
+ cpio/test/test_option_Z_upper.c \
cpio/test/test_option_a.c \
- cpio/test/test_option_B.c \
cpio/test/test_option_c.c \
cpio/test/test_option_d.c \
cpio/test/test_option_f.c \
cpio/test/test_option_help.c \
- cpio/test/test_option_L.c \
- cpio/test/test_option_ell.c \
+ cpio/test/test_option_l.c \
+ cpio/test/test_option_lzma.c \
cpio/test/test_option_m.c \
cpio/test/test_option_t.c \
cpio/test/test_option_u.c \
@@ -795,13 +1311,20 @@ bsdcpio_test_SOURCES = \
cpio/test/test_option_y.c \
cpio/test/test_option_z.c \
cpio/test/test_owner_parse.c \
+ cpio/test/test_passthrough_dotdot.c \
+ cpio/test/test_passthrough_reverse.c \
cpio/test/test_pathmatch.c
-bsdcpio_test_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test
+bsdcpio_test_CPPFLAGS = \
+ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
+ -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+ $(PLATFORMCPPFLAGS)
+
+bsdcpio_test_LDADD = libarchive_fe.la
@BUILD_BSDCPIO_FALSE@bsdcpio_test_programs =
@BUILD_BSDCPIO_TRUE@bsdcpio_test_programs = bsdcpio_test
@BUILD_BSDCPIO_FALSE@bsdcpio_TESTS_ENVIRONMENT =
-@BUILD_BSDCPIO_TRUE@bsdcpio_TESTS_ENVIRONMENT = BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
+@BUILD_BSDCPIO_TRUE@bsdcpio_TESTS_ENVIRONMENT = BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio$(EXEEXT) BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
bsdcpio_test_EXTRA_DIST = \
cpio/test/test_gcpio_compat_ref.bin.uu \
cpio/test/test_gcpio_compat_ref.crc.uu \
@@ -811,13 +1334,14 @@ bsdcpio_test_EXTRA_DIST = \
cpio/test/test_option_m.cpio.uu \
cpio/test/test_option_t.cpio.uu \
cpio/test/test_option_t.stdout.uu \
- cpio/test/test_option_tv.stdout.uu
+ cpio/test/test_option_tv.stdout.uu \
+ cpio/test/CMakeLists.txt
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj .y
+.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@@ -868,14 +1392,16 @@ $(srcdir)/config.h.in: $(am__configure_deps)
distclean-hdr:
-rm -f config.h stamp-h1
+build/pkgconfig/libarchive.pc: $(top_builddir)/config.status $(top_srcdir)/build/pkgconfig/libarchive.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
@@ -883,8 +1409,8 @@ uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@@ -895,6 +1421,15 @@ clean-libLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
libarchive/$(am__dirstamp):
@$(MKDIR_P) libarchive
@: > libarchive/$(am__dirstamp)
@@ -913,10 +1448,20 @@ libarchive/archive_entry_stat.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_entry_strmode.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_entry_xattr.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_data_into_fd.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_disk.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_disk_entry_from_file.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_disk_set_standard_lookup.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_extract.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_open_fd.lo: libarchive/$(am__dirstamp) \
@@ -945,6 +1490,15 @@ libarchive/archive_read_support_compression_none.lo: \
libarchive/archive_read_support_compression_program.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_support_compression_rpm.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_support_compression_uu.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_support_compression_xz.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_support_format_all.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -963,9 +1517,15 @@ libarchive/archive_read_support_format_iso9660.lo: \
libarchive/archive_read_support_format_mtree.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_support_format_raw.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_support_format_tar.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_read_support_format_xar.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_read_support_format_zip.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1007,6 +1567,9 @@ libarchive/archive_write_set_compression_none.lo: \
libarchive/archive_write_set_compression_program.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_write_set_compression_xz.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write_set_format.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write_set_format_ar.lo: libarchive/$(am__dirstamp) \
@@ -1020,6 +1583,9 @@ libarchive/archive_write_set_format_cpio.lo: \
libarchive/archive_write_set_format_cpio_newc.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_write_set_format_mtree.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write_set_format_pax.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1029,10 +1595,35 @@ libarchive/archive_write_set_format_shar.lo: \
libarchive/archive_write_set_format_ustar.lo: \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_write_set_format_zip.lo: \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/filter_fork.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_entry_copy_bhfi.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_windows.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/filter_fork_windows.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive.la: $(libarchive_la_OBJECTS) $(libarchive_la_DEPENDENCIES)
$(libarchive_la_LINK) -rpath $(libdir) $(libarchive_la_OBJECTS) $(libarchive_la_LIBADD) $(LIBS)
+libarchive_fe/$(am__dirstamp):
+ @$(MKDIR_P) libarchive_fe
+ @: > libarchive_fe/$(am__dirstamp)
+libarchive_fe/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) libarchive_fe/$(DEPDIR)
+ @: > libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+libarchive_fe/err.lo: libarchive_fe/$(am__dirstamp) \
+ libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+libarchive_fe/line_reader.lo: libarchive_fe/$(am__dirstamp) \
+ libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+libarchive_fe/matching.lo: libarchive_fe/$(am__dirstamp) \
+ libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+libarchive_fe/pathmatch.lo: libarchive_fe/$(am__dirstamp) \
+ libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+libarchive_fe.la: $(libarchive_fe_la_OBJECTS) $(libarchive_fe_la_DEPENDENCIES)
+ $(LINK) $(libarchive_fe_la_OBJECTS) $(libarchive_fe_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@@ -1042,8 +1633,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -1078,21 +1669,13 @@ cpio/bsdcpio-cmdline.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
cpio/bsdcpio-cpio.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio-err.$(OBJEXT): cpio/$(am__dirstamp) \
- cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio-matching.$(OBJEXT): cpio/$(am__dirstamp) \
- cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio-pathmatch.$(OBJEXT): cpio/$(am__dirstamp) \
+cpio/bsdcpio-cpio_windows.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
bsdcpio$(EXEEXT): $(bsdcpio_OBJECTS) $(bsdcpio_DEPENDENCIES)
@rm -f bsdcpio$(EXEEXT)
$(bsdcpio_LINK) $(bsdcpio_OBJECTS) $(bsdcpio_LDADD) $(LIBS)
cpio/bsdcpio_test-cmdline.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio_test-err.$(OBJEXT): cpio/$(am__dirstamp) \
- cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio_test-pathmatch.$(OBJEXT): cpio/$(am__dirstamp) \
- cpio/$(DEPDIR)/$(am__dirstamp)
cpio/test/$(am__dirstamp):
@$(MKDIR_P) cpio/test
@: > cpio/test/$(am__dirstamp)
@@ -1105,13 +1688,23 @@ cpio/test/bsdcpio_test-test_0.$(OBJEXT): cpio/test/$(am__dirstamp) \
cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_basic.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_cmdline.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_option_a.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_B_upper.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_option_B.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_C_upper.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_J_upper.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_L_upper.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_Z_upper.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_a.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_c.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
@@ -1121,9 +1714,9 @@ cpio/test/bsdcpio_test-test_option_f.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_help.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_option_L.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_l.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_lzma.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_m.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
@@ -1139,6 +1732,10 @@ cpio/test/bsdcpio_test-test_option_z.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_passthrough_dotdot.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_passthrough_reverse.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
bsdcpio_test$(EXEEXT): $(bsdcpio_test_OBJECTS) $(bsdcpio_test_DEPENDENCIES)
@@ -1152,14 +1749,12 @@ tar/$(DEPDIR)/$(am__dirstamp):
@: > tar/$(DEPDIR)/$(am__dirstamp)
tar/bsdtar-bsdtar.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
-tar/bsdtar-getdate.$(OBJEXT): tar/$(am__dirstamp) \
+tar/bsdtar-cmdline.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
-tar/bsdtar-matching.$(OBJEXT): tar/$(am__dirstamp) \
+tar/bsdtar-getdate.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
tar/bsdtar-read.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
-tar/bsdtar-siginfo.$(OBJEXT): tar/$(am__dirstamp) \
- tar/$(DEPDIR)/$(am__dirstamp)
tar/bsdtar-subst.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
tar/bsdtar-tree.$(OBJEXT): tar/$(am__dirstamp) \
@@ -1168,6 +1763,8 @@ tar/bsdtar-util.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
tar/bsdtar-write.$(OBJEXT): tar/$(am__dirstamp) \
tar/$(DEPDIR)/$(am__dirstamp)
+tar/bsdtar-bsdtar_windows.$(OBJEXT): tar/$(am__dirstamp) \
+ tar/$(DEPDIR)/$(am__dirstamp)
bsdtar$(EXEEXT): $(bsdtar_OBJECTS) $(bsdtar_DEPENDENCIES)
@rm -f bsdtar$(EXEEXT)
$(bsdtar_LINK) $(bsdtar_OBJECTS) $(bsdtar_LDADD) $(LIBS)
@@ -1187,18 +1784,34 @@ tar/test/bsdtar_test-test_basic.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_copy.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_empty_mtree.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_getdate.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_help.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
-tar/test/bsdtar_test-test_option_T.$(OBJEXT): \
+tar/test/bsdtar_test-test_option_T_upper.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_q.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_r.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_s.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_patterns.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_stdio.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_strip_components.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_symlink_dir.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_version.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_windows.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/bsdtar_test-bsdtar_windows.$(OBJEXT): tar/$(am__dirstamp) \
+ tar/$(DEPDIR)/$(am__dirstamp)
bsdtar_test$(EXEEXT): $(bsdtar_test_OBJECTS) $(bsdtar_test_DEPENDENCIES)
@rm -f bsdtar_test$(EXEEXT)
$(LINK) $(bsdtar_test_OBJECTS) $(bsdtar_test_LDADD) $(LIBS)
@@ -1220,12 +1833,24 @@ libarchive/libarchive_test-archive_entry_stat.$(OBJEXT): \
libarchive/libarchive_test-archive_entry_strmode.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_entry_xattr.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read_data_into_fd.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_disk.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_disk_entry_from_file.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_disk_set_standard_lookup.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read_extract.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1259,6 +1884,15 @@ libarchive/libarchive_test-archive_read_support_compression_none.$(OBJEXT): \
libarchive/libarchive_test-archive_read_support_compression_program.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_support_compression_rpm.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_support_compression_uu.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_support_compression_xz.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read_support_format_all.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1277,9 +1911,15 @@ libarchive/libarchive_test-archive_read_support_format_iso9660.$(OBJEXT): \
libarchive/libarchive_test-archive_read_support_format_mtree.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_support_format_raw.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read_support_format_tar.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_read_support_format_xar.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_read_support_format_zip.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1331,6 +1971,9 @@ libarchive/libarchive_test-archive_write_set_compression_none.$(OBJEXT): \
libarchive/libarchive_test-archive_write_set_compression_program.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_write_set_compression_xz.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_write_set_format.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1346,6 +1989,9 @@ libarchive/libarchive_test-archive_write_set_format_cpio.$(OBJEXT): \
libarchive/libarchive_test-archive_write_set_format_cpio_newc.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_write_set_format_mtree.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_write_set_format_pax.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1355,9 +2001,21 @@ libarchive/libarchive_test-archive_write_set_format_shar.$(OBJEXT): \
libarchive/libarchive_test-archive_write_set_format_ustar.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_write_set_format_zip.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-filter_fork.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_entry_copy_bhfi.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_windows.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-filter_fork_windows.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/test/$(am__dirstamp):
@$(MKDIR_P) libarchive/test
@: > libarchive/test/$(am__dirstamp)
@@ -1373,6 +2031,9 @@ libarchive/test/libarchive_test-read_open_memory.$(OBJEXT): \
libarchive/test/libarchive_test-test_acl_basic.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_acl_freebsd.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1382,12 +2043,30 @@ libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT): \
libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_bzip2.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_cpio.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_gzip.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_lzma.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_solaris_tar_acl.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_xz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1397,12 +2076,27 @@ libarchive/test/libarchive_test-test_empty_write.$(OBJEXT): \
libarchive/test/libarchive_test-test_entry.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_extattr_freebsd.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_fuzz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_open_fd.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_open_file.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_open_filename.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1412,9 +2106,18 @@ libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT): \
libarchive/test/libarchive_test-test_read_data_large.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_disk.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_disk_entry_from_file.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_extract.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_file_nonexistent.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_ar.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1424,18 +2127,33 @@ libarchive/test/libarchive_test-test_read_format_cpio_bin.$(OBJEXT): \
libarchive/test/libarchive_test-test_read_format_cpio_bin_Z.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_cpio_bin_be.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_cpio_bin_gz.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_cpio_odc.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1445,21 +2163,51 @@ libarchive/test/libarchive_test-test_read_format_empty.$(OBJEXT): \
libarchive/test/libarchive_test-test_read_format_gtar_gz.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_gtar_lzma.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_gtar_sparse.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_iso_gz.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_iso_multi_extent.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isojoliet_long.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isojoliet_rr.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_isorr_bz2.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isorr_ce.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_raw.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1472,9 +2220,18 @@ libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT): \
libarchive/test/libarchive_test-test_read_format_tgz.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_tlz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_txz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_tz.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_xar.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_zip.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1490,6 +2247,9 @@ libarchive/test/libarchive_test-test_read_position.$(OBJEXT): \
libarchive/test/libarchive_test-test_read_truncated.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_uu.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1502,12 +2262,27 @@ libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT): \
libarchive/test/libarchive_test-test_write_compress.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_compress_bzip2.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_compress_gzip.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_compress_lzma.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_compress_xz.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_disk.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_failures.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1517,6 +2292,15 @@ libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT): \
libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_sparse.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_symlink.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_times.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_format_ar.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1532,6 +2316,12 @@ libarchive/test/libarchive_test-test_write_format_cpio_odc.$(OBJEXT): \
libarchive/test/libarchive_test-test_write_format_cpio_newc.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_format_mtree.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_format_pax.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_format_shar_empty.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1544,6 +2334,15 @@ libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT): \
libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_format_zip.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_format_zip_empty.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_format_zip_no_compression.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1555,25 +2354,26 @@ mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f cpio/bsdcpio-cmdline.$(OBJEXT)
-rm -f cpio/bsdcpio-cpio.$(OBJEXT)
- -rm -f cpio/bsdcpio-err.$(OBJEXT)
- -rm -f cpio/bsdcpio-matching.$(OBJEXT)
- -rm -f cpio/bsdcpio-pathmatch.$(OBJEXT)
+ -rm -f cpio/bsdcpio-cpio_windows.$(OBJEXT)
-rm -f cpio/bsdcpio_test-cmdline.$(OBJEXT)
- -rm -f cpio/bsdcpio_test-err.$(OBJEXT)
- -rm -f cpio/bsdcpio_test-pathmatch.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-main.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_0.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_basic.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_cmdline.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_option_B.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_option_L.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_B_upper.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_C_upper.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_J_upper.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_L_upper.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_Z_upper.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_a.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_c.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_d.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_f.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_help.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_l.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_lzma.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_m.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_t.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_u.$(OBJEXT)
@@ -1581,11 +2381,15 @@ mostlyclean-compile:
-rm -f cpio/test/bsdcpio_test-test_option_y.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_z.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_passthrough_dotdot.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_passthrough_reverse.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT)
-rm -f libarchive/archive_check_magic.$(OBJEXT)
-rm -f libarchive/archive_check_magic.lo
-rm -f libarchive/archive_entry.$(OBJEXT)
-rm -f libarchive/archive_entry.lo
+ -rm -f libarchive/archive_entry_copy_bhfi.$(OBJEXT)
+ -rm -f libarchive/archive_entry_copy_bhfi.lo
-rm -f libarchive/archive_entry_copy_stat.$(OBJEXT)
-rm -f libarchive/archive_entry_copy_stat.lo
-rm -f libarchive/archive_entry_link_resolver.$(OBJEXT)
@@ -1594,10 +2398,18 @@ mostlyclean-compile:
-rm -f libarchive/archive_entry_stat.lo
-rm -f libarchive/archive_entry_strmode.$(OBJEXT)
-rm -f libarchive/archive_entry_strmode.lo
+ -rm -f libarchive/archive_entry_xattr.$(OBJEXT)
+ -rm -f libarchive/archive_entry_xattr.lo
-rm -f libarchive/archive_read.$(OBJEXT)
-rm -f libarchive/archive_read.lo
-rm -f libarchive/archive_read_data_into_fd.$(OBJEXT)
-rm -f libarchive/archive_read_data_into_fd.lo
+ -rm -f libarchive/archive_read_disk.$(OBJEXT)
+ -rm -f libarchive/archive_read_disk.lo
+ -rm -f libarchive/archive_read_disk_entry_from_file.$(OBJEXT)
+ -rm -f libarchive/archive_read_disk_entry_from_file.lo
+ -rm -f libarchive/archive_read_disk_set_standard_lookup.$(OBJEXT)
+ -rm -f libarchive/archive_read_disk_set_standard_lookup.lo
-rm -f libarchive/archive_read_extract.$(OBJEXT)
-rm -f libarchive/archive_read_extract.lo
-rm -f libarchive/archive_read_open_fd.$(OBJEXT)
@@ -1620,6 +2432,12 @@ mostlyclean-compile:
-rm -f libarchive/archive_read_support_compression_none.lo
-rm -f libarchive/archive_read_support_compression_program.$(OBJEXT)
-rm -f libarchive/archive_read_support_compression_program.lo
+ -rm -f libarchive/archive_read_support_compression_rpm.$(OBJEXT)
+ -rm -f libarchive/archive_read_support_compression_rpm.lo
+ -rm -f libarchive/archive_read_support_compression_uu.$(OBJEXT)
+ -rm -f libarchive/archive_read_support_compression_uu.lo
+ -rm -f libarchive/archive_read_support_compression_xz.$(OBJEXT)
+ -rm -f libarchive/archive_read_support_compression_xz.lo
-rm -f libarchive/archive_read_support_format_all.$(OBJEXT)
-rm -f libarchive/archive_read_support_format_all.lo
-rm -f libarchive/archive_read_support_format_ar.$(OBJEXT)
@@ -1632,8 +2450,12 @@ mostlyclean-compile:
-rm -f libarchive/archive_read_support_format_iso9660.lo
-rm -f libarchive/archive_read_support_format_mtree.$(OBJEXT)
-rm -f libarchive/archive_read_support_format_mtree.lo
+ -rm -f libarchive/archive_read_support_format_raw.$(OBJEXT)
+ -rm -f libarchive/archive_read_support_format_raw.lo
-rm -f libarchive/archive_read_support_format_tar.$(OBJEXT)
-rm -f libarchive/archive_read_support_format_tar.lo
+ -rm -f libarchive/archive_read_support_format_xar.$(OBJEXT)
+ -rm -f libarchive/archive_read_support_format_xar.lo
-rm -f libarchive/archive_read_support_format_zip.$(OBJEXT)
-rm -f libarchive/archive_read_support_format_zip.lo
-rm -f libarchive/archive_string.$(OBJEXT)
@@ -1644,6 +2466,8 @@ mostlyclean-compile:
-rm -f libarchive/archive_util.lo
-rm -f libarchive/archive_virtual.$(OBJEXT)
-rm -f libarchive/archive_virtual.lo
+ -rm -f libarchive/archive_windows.$(OBJEXT)
+ -rm -f libarchive/archive_windows.lo
-rm -f libarchive/archive_write.$(OBJEXT)
-rm -f libarchive/archive_write.lo
-rm -f libarchive/archive_write_disk.$(OBJEXT)
@@ -1668,6 +2492,8 @@ mostlyclean-compile:
-rm -f libarchive/archive_write_set_compression_none.lo
-rm -f libarchive/archive_write_set_compression_program.$(OBJEXT)
-rm -f libarchive/archive_write_set_compression_program.lo
+ -rm -f libarchive/archive_write_set_compression_xz.$(OBJEXT)
+ -rm -f libarchive/archive_write_set_compression_xz.lo
-rm -f libarchive/archive_write_set_format.$(OBJEXT)
-rm -f libarchive/archive_write_set_format.lo
-rm -f libarchive/archive_write_set_format_ar.$(OBJEXT)
@@ -1678,22 +2504,33 @@ mostlyclean-compile:
-rm -f libarchive/archive_write_set_format_cpio.lo
-rm -f libarchive/archive_write_set_format_cpio_newc.$(OBJEXT)
-rm -f libarchive/archive_write_set_format_cpio_newc.lo
+ -rm -f libarchive/archive_write_set_format_mtree.$(OBJEXT)
+ -rm -f libarchive/archive_write_set_format_mtree.lo
-rm -f libarchive/archive_write_set_format_pax.$(OBJEXT)
-rm -f libarchive/archive_write_set_format_pax.lo
-rm -f libarchive/archive_write_set_format_shar.$(OBJEXT)
-rm -f libarchive/archive_write_set_format_shar.lo
-rm -f libarchive/archive_write_set_format_ustar.$(OBJEXT)
-rm -f libarchive/archive_write_set_format_ustar.lo
+ -rm -f libarchive/archive_write_set_format_zip.$(OBJEXT)
+ -rm -f libarchive/archive_write_set_format_zip.lo
-rm -f libarchive/filter_fork.$(OBJEXT)
-rm -f libarchive/filter_fork.lo
+ -rm -f libarchive/filter_fork_windows.$(OBJEXT)
+ -rm -f libarchive/filter_fork_windows.lo
-rm -f libarchive/libarchive_test-archive_check_magic.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_entry.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_entry_copy_bhfi.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_entry_copy_stat.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_entry_link_resolver.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_entry_stat.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_entry_strmode.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_entry_xattr.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_data_into_fd.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_disk.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_disk_entry_from_file.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_disk_set_standard_lookup.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_extract.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_open_fd.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_open_file.$(OBJEXT)
@@ -1705,18 +2542,24 @@ mostlyclean-compile:
-rm -f libarchive/libarchive_test-archive_read_support_compression_gzip.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_compression_none.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_compression_program.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_support_compression_rpm.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_support_compression_uu.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_support_compression_xz.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_all.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_ar.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_cpio.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_empty.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_iso9660.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_mtree.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_support_format_raw.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_tar.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_read_support_format_xar.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_read_support_format_zip.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_string.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_string_sprintf.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_util.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_virtual.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_windows.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_disk.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_disk_set_standard_lookup.$(OBJEXT)
@@ -1729,121 +2572,189 @@ mostlyclean-compile:
-rm -f libarchive/libarchive_test-archive_write_set_compression_gzip.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_compression_none.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_compression_program.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_write_set_compression_xz.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_ar.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_by_name.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_cpio.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_cpio_newc.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_write_set_format_mtree.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_pax.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_shar.$(OBJEXT)
-rm -f libarchive/libarchive_test-archive_write_set_format_ustar.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-archive_write_set_format_zip.$(OBJEXT)
-rm -f libarchive/libarchive_test-filter_fork.$(OBJEXT)
+ -rm -f libarchive/libarchive_test-filter_fork_windows.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-main.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-read_open_memory.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_acl_basic.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_acl_freebsd.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_bzip2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_cpio.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_gzip.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_lzma.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_solaris_tar_acl.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_xz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_empty_write.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_entry.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_extattr_freebsd.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_fuzz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_open_fd.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_open_file.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_open_filename.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_data_large.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_disk.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_disk_entry_from_file.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_extract.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_file_nonexistent.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_ar.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_Z.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_be.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_gz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_odc.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_empty.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_gtar_gz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_gtar_lzma.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_gtar_sparse.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_iso_gz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_iso_multi_extent.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isojoliet_long.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isojoliet_rr.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_isorr_bz2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isorr_ce.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_raw.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_tar_empty_filename.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_tgz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_tlz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_txz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_tz.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_format_xar.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_format_zip.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_large.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_pax_truncated.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_position.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_truncated.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_read_uu.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_tar_large.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_compress.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_compress_bzip2.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_compress_gzip.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_compress_lzma.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_compress_xz.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_disk_failures.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_disk_sparse.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_disk_symlink.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_disk_times.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_ar.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_cpio.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_cpio_empty.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_cpio_newc.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_cpio_odc.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_format_mtree.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_format_pax.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_shar_empty.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_tar.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_format_zip.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_format_zip_empty.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_format_zip_no_compression.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT)
+ -rm -f libarchive_fe/err.$(OBJEXT)
+ -rm -f libarchive_fe/err.lo
+ -rm -f libarchive_fe/line_reader.$(OBJEXT)
+ -rm -f libarchive_fe/line_reader.lo
+ -rm -f libarchive_fe/matching.$(OBJEXT)
+ -rm -f libarchive_fe/matching.lo
+ -rm -f libarchive_fe/pathmatch.$(OBJEXT)
+ -rm -f libarchive_fe/pathmatch.lo
-rm -f tar/bsdtar-bsdtar.$(OBJEXT)
+ -rm -f tar/bsdtar-bsdtar_windows.$(OBJEXT)
+ -rm -f tar/bsdtar-cmdline.$(OBJEXT)
-rm -f tar/bsdtar-getdate.$(OBJEXT)
- -rm -f tar/bsdtar-matching.$(OBJEXT)
-rm -f tar/bsdtar-read.$(OBJEXT)
- -rm -f tar/bsdtar-siginfo.$(OBJEXT)
-rm -f tar/bsdtar-subst.$(OBJEXT)
-rm -f tar/bsdtar-tree.$(OBJEXT)
-rm -f tar/bsdtar-util.$(OBJEXT)
-rm -f tar/bsdtar-write.$(OBJEXT)
+ -rm -f tar/bsdtar_test-bsdtar_windows.$(OBJEXT)
-rm -f tar/bsdtar_test-getdate.$(OBJEXT)
-rm -f tar/test/bsdtar_test-main.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_0.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_basic.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_copy.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_empty_mtree.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_getdate.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_help.$(OBJEXT)
- -rm -f tar/test/bsdtar_test-test_option_T.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_option_T_upper.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_option_q.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_option_r.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_option_s.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_patterns.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_stdio.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_strip_components.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_symlink_dir.$(OBJEXT)
-rm -f tar/test/bsdtar_test-test_version.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_windows.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cpio.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-err.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-matching.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-pathmatch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cpio_windows.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-err.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_gcpio_compat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_d.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_t.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Po@am__quote@
@@ -1851,15 +2762,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_owner_parse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_pathmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_check_magic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_copy_bhfi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_copy_stat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_link_resolver.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_stat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_strmode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_xattr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_data_into_fd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_disk.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_disk_entry_from_file.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_disk_set_standard_lookup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_extract.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_fd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_file.Plo@am__quote@
@@ -1871,18 +2789,24 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_gzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_none.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_program.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_rpm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_uu.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_xz.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_all.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_ar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_cpio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_empty.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_iso9660.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_mtree.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_raw.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_tar.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_xar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_zip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_string.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_string_sprintf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_virtual.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_windows.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_disk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_disk_set_standard_lookup.Plo@am__quote@
@@ -1895,23 +2819,32 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_gzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_none.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_program.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_xz.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_ar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_by_name.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_cpio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_cpio_newc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_mtree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_pax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_shar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_ustar.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_zip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/filter_fork.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/filter_fork_windows.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_link_resolver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_strmode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_data_into_fd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_extract.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_open_fd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_open_file.Po@am__quote@
@@ -1923,18 +2856,24 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_gzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_none.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_program.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_all.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_ar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_cpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_empty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_iso9660.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_mtree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_tar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_string.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_string_sprintf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_virtual.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_windows.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_disk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_set_standard_lookup.Po@am__quote@
@@ -1947,96 +2886,159 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_gzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_none.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_program.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_ar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_by_name.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_cpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_cpio_newc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_pax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_shar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_ustar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-filter_fork.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-read_open_memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_basic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_bad_fd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_entry.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_entry_strmode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_compress_program.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_data_large.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_extract.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_ar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_Z.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_bz2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_gz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_odc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4c_Z.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_empty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_gz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_sparse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_gz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_bz2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tbz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tgz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_large.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_truncated.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_position.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_truncated.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_tar_filenames.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_tar_large.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_ar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_cpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_cpio_empty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_cpio_newc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_cpio_odc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_shar_empty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_empty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive_fe/$(DEPDIR)/err.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive_fe/$(DEPDIR)/line_reader.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive_fe/$(DEPDIR)/matching.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive_fe/$(DEPDIR)/pathmatch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-bsdtar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-bsdtar_windows.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-getdate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-matching.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-read.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-siginfo.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-subst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-tree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-write.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar_test-getdate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_0.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_help.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_windows.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -2090,47 +3092,19 @@ cpio/bsdcpio-cpio.obj: cpio/cpio.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-cpio.obj `if test -f 'cpio/cpio.c'; then $(CYGPATH_W) 'cpio/cpio.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cpio.c'; fi`
-cpio/bsdcpio-err.o: cpio/err.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-err.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-err.Tpo -c -o cpio/bsdcpio-err.o `test -f 'cpio/err.c' || echo '$(srcdir)/'`cpio/err.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-err.Tpo cpio/$(DEPDIR)/bsdcpio-err.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/err.c' object='cpio/bsdcpio-err.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-err.o `test -f 'cpio/err.c' || echo '$(srcdir)/'`cpio/err.c
-
-cpio/bsdcpio-err.obj: cpio/err.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-err.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-err.Tpo -c -o cpio/bsdcpio-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-err.Tpo cpio/$(DEPDIR)/bsdcpio-err.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/err.c' object='cpio/bsdcpio-err.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-
-cpio/bsdcpio-matching.o: cpio/matching.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-matching.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-matching.Tpo -c -o cpio/bsdcpio-matching.o `test -f 'cpio/matching.c' || echo '$(srcdir)/'`cpio/matching.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-matching.Tpo cpio/$(DEPDIR)/bsdcpio-matching.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/matching.c' object='cpio/bsdcpio-matching.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-matching.o `test -f 'cpio/matching.c' || echo '$(srcdir)/'`cpio/matching.c
-
-cpio/bsdcpio-matching.obj: cpio/matching.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-matching.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-matching.Tpo -c -o cpio/bsdcpio-matching.obj `if test -f 'cpio/matching.c'; then $(CYGPATH_W) 'cpio/matching.c'; else $(CYGPATH_W) '$(srcdir)/cpio/matching.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-matching.Tpo cpio/$(DEPDIR)/bsdcpio-matching.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/matching.c' object='cpio/bsdcpio-matching.obj' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio-cpio_windows.o: cpio/cpio_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-cpio_windows.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-cpio_windows.Tpo -c -o cpio/bsdcpio-cpio_windows.o `test -f 'cpio/cpio_windows.c' || echo '$(srcdir)/'`cpio/cpio_windows.c
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-cpio_windows.Tpo cpio/$(DEPDIR)/bsdcpio-cpio_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/cpio_windows.c' object='cpio/bsdcpio-cpio_windows.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-matching.obj `if test -f 'cpio/matching.c'; then $(CYGPATH_W) 'cpio/matching.c'; else $(CYGPATH_W) '$(srcdir)/cpio/matching.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-cpio_windows.o `test -f 'cpio/cpio_windows.c' || echo '$(srcdir)/'`cpio/cpio_windows.c
-cpio/bsdcpio-pathmatch.o: cpio/pathmatch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-pathmatch.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo -c -o cpio/bsdcpio-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio-pathmatch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio-pathmatch.o' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio-cpio_windows.obj: cpio/cpio_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-cpio_windows.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-cpio_windows.Tpo -c -o cpio/bsdcpio-cpio_windows.obj `if test -f 'cpio/cpio_windows.c'; then $(CYGPATH_W) 'cpio/cpio_windows.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cpio_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-cpio_windows.Tpo cpio/$(DEPDIR)/bsdcpio-cpio_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/cpio_windows.c' object='cpio/bsdcpio-cpio_windows.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
-
-cpio/bsdcpio-pathmatch.obj: cpio/pathmatch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-pathmatch.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo -c -o cpio/bsdcpio-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio-pathmatch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio-pathmatch.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-cpio_windows.obj `if test -f 'cpio/cpio_windows.c'; then $(CYGPATH_W) 'cpio/cpio_windows.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cpio_windows.c'; fi`
cpio/bsdcpio_test-cmdline.o: cpio/cmdline.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-cmdline.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo -c -o cpio/bsdcpio_test-cmdline.o `test -f 'cpio/cmdline.c' || echo '$(srcdir)/'`cpio/cmdline.c
@@ -2146,34 +3120,6 @@ cpio/bsdcpio_test-cmdline.obj: cpio/cmdline.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-cmdline.obj `if test -f 'cpio/cmdline.c'; then $(CYGPATH_W) 'cpio/cmdline.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cmdline.c'; fi`
-cpio/bsdcpio_test-err.o: cpio/err.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-err.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-err.Tpo -c -o cpio/bsdcpio_test-err.o `test -f 'cpio/err.c' || echo '$(srcdir)/'`cpio/err.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-err.Tpo cpio/$(DEPDIR)/bsdcpio_test-err.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/err.c' object='cpio/bsdcpio_test-err.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-err.o `test -f 'cpio/err.c' || echo '$(srcdir)/'`cpio/err.c
-
-cpio/bsdcpio_test-err.obj: cpio/err.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-err.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-err.Tpo -c -o cpio/bsdcpio_test-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-err.Tpo cpio/$(DEPDIR)/bsdcpio_test-err.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/err.c' object='cpio/bsdcpio_test-err.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-
-cpio/bsdcpio_test-pathmatch.o: cpio/pathmatch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-pathmatch.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo -c -o cpio/bsdcpio_test-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio_test-pathmatch.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
-
-cpio/bsdcpio_test-pathmatch.obj: cpio/pathmatch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-pathmatch.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo -c -o cpio/bsdcpio_test-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio_test-pathmatch.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
-
cpio/test/bsdcpio_test-main.o: cpio/test/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-main.Po
@@ -2216,6 +3162,20 @@ cpio/test/bsdcpio_test-test_basic.obj: cpio/test/test_basic.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_basic.obj `if test -f 'cpio/test/test_basic.c'; then $(CYGPATH_W) 'cpio/test/test_basic.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_basic.c'; fi`
+cpio/test/bsdcpio_test-test_cmdline.o: cpio/test/test_cmdline.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_cmdline.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Tpo -c -o cpio/test/bsdcpio_test-test_cmdline.o `test -f 'cpio/test/test_cmdline.c' || echo '$(srcdir)/'`cpio/test/test_cmdline.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_cmdline.c' object='cpio/test/bsdcpio_test-test_cmdline.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_cmdline.o `test -f 'cpio/test/test_cmdline.c' || echo '$(srcdir)/'`cpio/test/test_cmdline.c
+
+cpio/test/bsdcpio_test-test_cmdline.obj: cpio/test/test_cmdline.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_cmdline.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Tpo -c -o cpio/test/bsdcpio_test-test_cmdline.obj `if test -f 'cpio/test/test_cmdline.c'; then $(CYGPATH_W) 'cpio/test/test_cmdline.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_cmdline.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_cmdline.c' object='cpio/test/bsdcpio_test-test_cmdline.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_cmdline.obj `if test -f 'cpio/test/test_cmdline.c'; then $(CYGPATH_W) 'cpio/test/test_cmdline.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_cmdline.c'; fi`
+
cpio/test/bsdcpio_test-test_format_newc.o: cpio/test/test_format_newc.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_format_newc.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo -c -o cpio/test/bsdcpio_test-test_format_newc.o `test -f 'cpio/test/test_format_newc.c' || echo '$(srcdir)/'`cpio/test/test_format_newc.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Po
@@ -2244,6 +3204,76 @@ cpio/test/bsdcpio_test-test_gcpio_compat.obj: cpio/test/test_gcpio_compat.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_gcpio_compat.obj `if test -f 'cpio/test/test_gcpio_compat.c'; then $(CYGPATH_W) 'cpio/test/test_gcpio_compat.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_gcpio_compat.c'; fi`
+cpio/test/bsdcpio_test-test_option_B_upper.o: cpio/test/test_option_B_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_B_upper.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_B_upper.o `test -f 'cpio/test/test_option_B_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_B_upper.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_B_upper.c' object='cpio/test/bsdcpio_test-test_option_B_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_B_upper.o `test -f 'cpio/test/test_option_B_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_B_upper.c
+
+cpio/test/bsdcpio_test-test_option_B_upper.obj: cpio/test/test_option_B_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_B_upper.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_B_upper.obj `if test -f 'cpio/test/test_option_B_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_B_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_B_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_B_upper.c' object='cpio/test/bsdcpio_test-test_option_B_upper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_B_upper.obj `if test -f 'cpio/test/test_option_B_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_B_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_B_upper.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_C_upper.o: cpio/test/test_option_C_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_C_upper.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_C_upper.o `test -f 'cpio/test/test_option_C_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_C_upper.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_C_upper.c' object='cpio/test/bsdcpio_test-test_option_C_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_C_upper.o `test -f 'cpio/test/test_option_C_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_C_upper.c
+
+cpio/test/bsdcpio_test-test_option_C_upper.obj: cpio/test/test_option_C_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_C_upper.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_C_upper.obj `if test -f 'cpio/test/test_option_C_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_C_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_C_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_C_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_C_upper.c' object='cpio/test/bsdcpio_test-test_option_C_upper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_C_upper.obj `if test -f 'cpio/test/test_option_C_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_C_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_C_upper.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_J_upper.o: cpio/test/test_option_J_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_J_upper.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_J_upper.o `test -f 'cpio/test/test_option_J_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_J_upper.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_J_upper.c' object='cpio/test/bsdcpio_test-test_option_J_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_J_upper.o `test -f 'cpio/test/test_option_J_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_J_upper.c
+
+cpio/test/bsdcpio_test-test_option_J_upper.obj: cpio/test/test_option_J_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_J_upper.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_J_upper.obj `if test -f 'cpio/test/test_option_J_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_J_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_J_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_J_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_J_upper.c' object='cpio/test/bsdcpio_test-test_option_J_upper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_J_upper.obj `if test -f 'cpio/test/test_option_J_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_J_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_J_upper.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_L_upper.o: cpio/test/test_option_L_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L_upper.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_L_upper.o `test -f 'cpio/test/test_option_L_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_L_upper.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L_upper.c' object='cpio/test/bsdcpio_test-test_option_L_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L_upper.o `test -f 'cpio/test/test_option_L_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_L_upper.c
+
+cpio/test/bsdcpio_test-test_option_L_upper.obj: cpio/test/test_option_L_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L_upper.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_L_upper.obj `if test -f 'cpio/test/test_option_L_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_L_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L_upper.c' object='cpio/test/bsdcpio_test-test_option_L_upper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L_upper.obj `if test -f 'cpio/test/test_option_L_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_L_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L_upper.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_Z_upper.o: cpio/test/test_option_Z_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_Z_upper.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_Z_upper.o `test -f 'cpio/test/test_option_Z_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_Z_upper.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_Z_upper.c' object='cpio/test/bsdcpio_test-test_option_Z_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_Z_upper.o `test -f 'cpio/test/test_option_Z_upper.c' || echo '$(srcdir)/'`cpio/test/test_option_Z_upper.c
+
+cpio/test/bsdcpio_test-test_option_Z_upper.obj: cpio/test/test_option_Z_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_Z_upper.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Tpo -c -o cpio/test/bsdcpio_test-test_option_Z_upper.obj `if test -f 'cpio/test/test_option_Z_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_Z_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_Z_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_Z_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_Z_upper.c' object='cpio/test/bsdcpio_test-test_option_Z_upper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_Z_upper.obj `if test -f 'cpio/test/test_option_Z_upper.c'; then $(CYGPATH_W) 'cpio/test/test_option_Z_upper.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_Z_upper.c'; fi`
+
cpio/test/bsdcpio_test-test_option_a.o: cpio/test/test_option_a.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_a.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo -c -o cpio/test/bsdcpio_test-test_option_a.o `test -f 'cpio/test/test_option_a.c' || echo '$(srcdir)/'`cpio/test/test_option_a.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Po
@@ -2258,20 +3288,6 @@ cpio/test/bsdcpio_test-test_option_a.obj: cpio/test/test_option_a.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_a.obj `if test -f 'cpio/test/test_option_a.c'; then $(CYGPATH_W) 'cpio/test/test_option_a.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_a.c'; fi`
-cpio/test/bsdcpio_test-test_option_B.o: cpio/test/test_option_B.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_B.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Tpo -c -o cpio/test/bsdcpio_test-test_option_B.o `test -f 'cpio/test/test_option_B.c' || echo '$(srcdir)/'`cpio/test/test_option_B.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_B.c' object='cpio/test/bsdcpio_test-test_option_B.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_B.o `test -f 'cpio/test/test_option_B.c' || echo '$(srcdir)/'`cpio/test/test_option_B.c
-
-cpio/test/bsdcpio_test-test_option_B.obj: cpio/test/test_option_B.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_B.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Tpo -c -o cpio/test/bsdcpio_test-test_option_B.obj `if test -f 'cpio/test/test_option_B.c'; then $(CYGPATH_W) 'cpio/test/test_option_B.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_B.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_B.c' object='cpio/test/bsdcpio_test-test_option_B.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_B.obj `if test -f 'cpio/test/test_option_B.c'; then $(CYGPATH_W) 'cpio/test/test_option_B.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_B.c'; fi`
-
cpio/test/bsdcpio_test-test_option_c.o: cpio/test/test_option_c.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_c.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo -c -o cpio/test/bsdcpio_test-test_option_c.o `test -f 'cpio/test/test_option_c.c' || echo '$(srcdir)/'`cpio/test/test_option_c.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Po
@@ -2328,33 +3344,33 @@ cpio/test/bsdcpio_test-test_option_help.obj: cpio/test/test_option_help.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_help.obj `if test -f 'cpio/test/test_option_help.c'; then $(CYGPATH_W) 'cpio/test/test_option_help.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_help.c'; fi`
-cpio/test/bsdcpio_test-test_option_L.o: cpio/test/test_option_L.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo -c -o cpio/test/bsdcpio_test-test_option_L.o `test -f 'cpio/test/test_option_L.c' || echo '$(srcdir)/'`cpio/test/test_option_L.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L.c' object='cpio/test/bsdcpio_test-test_option_L.o' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_l.o: cpio/test/test_option_l.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_l.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Tpo -c -o cpio/test/bsdcpio_test-test_option_l.o `test -f 'cpio/test/test_option_l.c' || echo '$(srcdir)/'`cpio/test/test_option_l.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_l.c' object='cpio/test/bsdcpio_test-test_option_l.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L.o `test -f 'cpio/test/test_option_L.c' || echo '$(srcdir)/'`cpio/test/test_option_L.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_l.o `test -f 'cpio/test/test_option_l.c' || echo '$(srcdir)/'`cpio/test/test_option_l.c
-cpio/test/bsdcpio_test-test_option_L.obj: cpio/test/test_option_L.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo -c -o cpio/test/bsdcpio_test-test_option_L.obj `if test -f 'cpio/test/test_option_L.c'; then $(CYGPATH_W) 'cpio/test/test_option_L.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L.c' object='cpio/test/bsdcpio_test-test_option_L.obj' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_l.obj: cpio/test/test_option_l.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_l.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Tpo -c -o cpio/test/bsdcpio_test-test_option_l.obj `if test -f 'cpio/test/test_option_l.c'; then $(CYGPATH_W) 'cpio/test/test_option_l.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_l.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_l.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_l.c' object='cpio/test/bsdcpio_test-test_option_l.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L.obj `if test -f 'cpio/test/test_option_L.c'; then $(CYGPATH_W) 'cpio/test/test_option_L.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_l.obj `if test -f 'cpio/test/test_option_l.c'; then $(CYGPATH_W) 'cpio/test/test_option_l.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_l.c'; fi`
-cpio/test/bsdcpio_test-test_option_ell.o: cpio/test/test_option_ell.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_ell.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo -c -o cpio/test/bsdcpio_test-test_option_ell.o `test -f 'cpio/test/test_option_ell.c' || echo '$(srcdir)/'`cpio/test/test_option_ell.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_ell.c' object='cpio/test/bsdcpio_test-test_option_ell.o' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_lzma.o: cpio/test/test_option_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_lzma.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Tpo -c -o cpio/test/bsdcpio_test-test_option_lzma.o `test -f 'cpio/test/test_option_lzma.c' || echo '$(srcdir)/'`cpio/test/test_option_lzma.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_lzma.c' object='cpio/test/bsdcpio_test-test_option_lzma.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_ell.o `test -f 'cpio/test/test_option_ell.c' || echo '$(srcdir)/'`cpio/test/test_option_ell.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_lzma.o `test -f 'cpio/test/test_option_lzma.c' || echo '$(srcdir)/'`cpio/test/test_option_lzma.c
-cpio/test/bsdcpio_test-test_option_ell.obj: cpio/test/test_option_ell.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_ell.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo -c -o cpio/test/bsdcpio_test-test_option_ell.obj `if test -f 'cpio/test/test_option_ell.c'; then $(CYGPATH_W) 'cpio/test/test_option_ell.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_ell.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_ell.c' object='cpio/test/bsdcpio_test-test_option_ell.obj' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_lzma.obj: cpio/test/test_option_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_lzma.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Tpo -c -o cpio/test/bsdcpio_test-test_option_lzma.obj `if test -f 'cpio/test/test_option_lzma.c'; then $(CYGPATH_W) 'cpio/test/test_option_lzma.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_lzma.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_lzma.c' object='cpio/test/bsdcpio_test-test_option_lzma.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_ell.obj `if test -f 'cpio/test/test_option_ell.c'; then $(CYGPATH_W) 'cpio/test/test_option_ell.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_ell.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_lzma.obj `if test -f 'cpio/test/test_option_lzma.c'; then $(CYGPATH_W) 'cpio/test/test_option_lzma.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_lzma.c'; fi`
cpio/test/bsdcpio_test-test_option_m.o: cpio/test/test_option_m.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_m.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Tpo -c -o cpio/test/bsdcpio_test-test_option_m.o `test -f 'cpio/test/test_option_m.c' || echo '$(srcdir)/'`cpio/test/test_option_m.c
@@ -2454,6 +3470,34 @@ cpio/test/bsdcpio_test-test_owner_parse.obj: cpio/test/test_owner_parse.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_owner_parse.obj `if test -f 'cpio/test/test_owner_parse.c'; then $(CYGPATH_W) 'cpio/test/test_owner_parse.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_owner_parse.c'; fi`
+cpio/test/bsdcpio_test-test_passthrough_dotdot.o: cpio/test/test_passthrough_dotdot.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_passthrough_dotdot.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Tpo -c -o cpio/test/bsdcpio_test-test_passthrough_dotdot.o `test -f 'cpio/test/test_passthrough_dotdot.c' || echo '$(srcdir)/'`cpio/test/test_passthrough_dotdot.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_passthrough_dotdot.c' object='cpio/test/bsdcpio_test-test_passthrough_dotdot.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_passthrough_dotdot.o `test -f 'cpio/test/test_passthrough_dotdot.c' || echo '$(srcdir)/'`cpio/test/test_passthrough_dotdot.c
+
+cpio/test/bsdcpio_test-test_passthrough_dotdot.obj: cpio/test/test_passthrough_dotdot.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_passthrough_dotdot.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Tpo -c -o cpio/test/bsdcpio_test-test_passthrough_dotdot.obj `if test -f 'cpio/test/test_passthrough_dotdot.c'; then $(CYGPATH_W) 'cpio/test/test_passthrough_dotdot.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_passthrough_dotdot.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_dotdot.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_passthrough_dotdot.c' object='cpio/test/bsdcpio_test-test_passthrough_dotdot.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_passthrough_dotdot.obj `if test -f 'cpio/test/test_passthrough_dotdot.c'; then $(CYGPATH_W) 'cpio/test/test_passthrough_dotdot.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_passthrough_dotdot.c'; fi`
+
+cpio/test/bsdcpio_test-test_passthrough_reverse.o: cpio/test/test_passthrough_reverse.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_passthrough_reverse.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Tpo -c -o cpio/test/bsdcpio_test-test_passthrough_reverse.o `test -f 'cpio/test/test_passthrough_reverse.c' || echo '$(srcdir)/'`cpio/test/test_passthrough_reverse.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_passthrough_reverse.c' object='cpio/test/bsdcpio_test-test_passthrough_reverse.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_passthrough_reverse.o `test -f 'cpio/test/test_passthrough_reverse.c' || echo '$(srcdir)/'`cpio/test/test_passthrough_reverse.c
+
+cpio/test/bsdcpio_test-test_passthrough_reverse.obj: cpio/test/test_passthrough_reverse.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_passthrough_reverse.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Tpo -c -o cpio/test/bsdcpio_test-test_passthrough_reverse.obj `if test -f 'cpio/test/test_passthrough_reverse.c'; then $(CYGPATH_W) 'cpio/test/test_passthrough_reverse.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_passthrough_reverse.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_passthrough_reverse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_passthrough_reverse.c' object='cpio/test/bsdcpio_test-test_passthrough_reverse.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_passthrough_reverse.obj `if test -f 'cpio/test/test_passthrough_reverse.c'; then $(CYGPATH_W) 'cpio/test/test_passthrough_reverse.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_passthrough_reverse.c'; fi`
+
cpio/test/bsdcpio_test-test_pathmatch.o: cpio/test/test_pathmatch.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_pathmatch.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_pathmatch.Tpo -c -o cpio/test/bsdcpio_test-test_pathmatch.o `test -f 'cpio/test/test_pathmatch.c' || echo '$(srcdir)/'`cpio/test/test_pathmatch.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_pathmatch.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_pathmatch.Po
@@ -2482,6 +3526,20 @@ tar/bsdtar-bsdtar.obj: tar/bsdtar.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-bsdtar.obj `if test -f 'tar/bsdtar.c'; then $(CYGPATH_W) 'tar/bsdtar.c'; else $(CYGPATH_W) '$(srcdir)/tar/bsdtar.c'; fi`
+tar/bsdtar-cmdline.o: tar/cmdline.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-cmdline.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-cmdline.Tpo -c -o tar/bsdtar-cmdline.o `test -f 'tar/cmdline.c' || echo '$(srcdir)/'`tar/cmdline.c
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-cmdline.Tpo tar/$(DEPDIR)/bsdtar-cmdline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/cmdline.c' object='tar/bsdtar-cmdline.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-cmdline.o `test -f 'tar/cmdline.c' || echo '$(srcdir)/'`tar/cmdline.c
+
+tar/bsdtar-cmdline.obj: tar/cmdline.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-cmdline.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-cmdline.Tpo -c -o tar/bsdtar-cmdline.obj `if test -f 'tar/cmdline.c'; then $(CYGPATH_W) 'tar/cmdline.c'; else $(CYGPATH_W) '$(srcdir)/tar/cmdline.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-cmdline.Tpo tar/$(DEPDIR)/bsdtar-cmdline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/cmdline.c' object='tar/bsdtar-cmdline.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-cmdline.obj `if test -f 'tar/cmdline.c'; then $(CYGPATH_W) 'tar/cmdline.c'; else $(CYGPATH_W) '$(srcdir)/tar/cmdline.c'; fi`
+
tar/bsdtar-getdate.o: tar/getdate.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-getdate.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-getdate.Tpo -c -o tar/bsdtar-getdate.o `test -f 'tar/getdate.c' || echo '$(srcdir)/'`tar/getdate.c
@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-getdate.Tpo tar/$(DEPDIR)/bsdtar-getdate.Po
@@ -2496,20 +3554,6 @@ tar/bsdtar-getdate.obj: tar/getdate.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-getdate.obj `if test -f 'tar/getdate.c'; then $(CYGPATH_W) 'tar/getdate.c'; else $(CYGPATH_W) '$(srcdir)/tar/getdate.c'; fi`
-tar/bsdtar-matching.o: tar/matching.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-matching.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-matching.Tpo -c -o tar/bsdtar-matching.o `test -f 'tar/matching.c' || echo '$(srcdir)/'`tar/matching.c
-@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-matching.Tpo tar/$(DEPDIR)/bsdtar-matching.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/matching.c' object='tar/bsdtar-matching.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-matching.o `test -f 'tar/matching.c' || echo '$(srcdir)/'`tar/matching.c
-
-tar/bsdtar-matching.obj: tar/matching.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-matching.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-matching.Tpo -c -o tar/bsdtar-matching.obj `if test -f 'tar/matching.c'; then $(CYGPATH_W) 'tar/matching.c'; else $(CYGPATH_W) '$(srcdir)/tar/matching.c'; fi`
-@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-matching.Tpo tar/$(DEPDIR)/bsdtar-matching.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/matching.c' object='tar/bsdtar-matching.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-matching.obj `if test -f 'tar/matching.c'; then $(CYGPATH_W) 'tar/matching.c'; else $(CYGPATH_W) '$(srcdir)/tar/matching.c'; fi`
-
tar/bsdtar-read.o: tar/read.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-read.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-read.Tpo -c -o tar/bsdtar-read.o `test -f 'tar/read.c' || echo '$(srcdir)/'`tar/read.c
@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-read.Tpo tar/$(DEPDIR)/bsdtar-read.Po
@@ -2524,20 +3568,6 @@ tar/bsdtar-read.obj: tar/read.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-read.obj `if test -f 'tar/read.c'; then $(CYGPATH_W) 'tar/read.c'; else $(CYGPATH_W) '$(srcdir)/tar/read.c'; fi`
-tar/bsdtar-siginfo.o: tar/siginfo.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-siginfo.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-siginfo.Tpo -c -o tar/bsdtar-siginfo.o `test -f 'tar/siginfo.c' || echo '$(srcdir)/'`tar/siginfo.c
-@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-siginfo.Tpo tar/$(DEPDIR)/bsdtar-siginfo.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/siginfo.c' object='tar/bsdtar-siginfo.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-siginfo.o `test -f 'tar/siginfo.c' || echo '$(srcdir)/'`tar/siginfo.c
-
-tar/bsdtar-siginfo.obj: tar/siginfo.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-siginfo.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-siginfo.Tpo -c -o tar/bsdtar-siginfo.obj `if test -f 'tar/siginfo.c'; then $(CYGPATH_W) 'tar/siginfo.c'; else $(CYGPATH_W) '$(srcdir)/tar/siginfo.c'; fi`
-@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-siginfo.Tpo tar/$(DEPDIR)/bsdtar-siginfo.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/siginfo.c' object='tar/bsdtar-siginfo.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-siginfo.obj `if test -f 'tar/siginfo.c'; then $(CYGPATH_W) 'tar/siginfo.c'; else $(CYGPATH_W) '$(srcdir)/tar/siginfo.c'; fi`
-
tar/bsdtar-subst.o: tar/subst.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-subst.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-subst.Tpo -c -o tar/bsdtar-subst.o `test -f 'tar/subst.c' || echo '$(srcdir)/'`tar/subst.c
@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-subst.Tpo tar/$(DEPDIR)/bsdtar-subst.Po
@@ -2594,6 +3624,20 @@ tar/bsdtar-write.obj: tar/write.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-write.obj `if test -f 'tar/write.c'; then $(CYGPATH_W) 'tar/write.c'; else $(CYGPATH_W) '$(srcdir)/tar/write.c'; fi`
+tar/bsdtar-bsdtar_windows.o: tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-bsdtar_windows.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-bsdtar_windows.Tpo -c -o tar/bsdtar-bsdtar_windows.o `test -f 'tar/bsdtar_windows.c' || echo '$(srcdir)/'`tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-bsdtar_windows.Tpo tar/$(DEPDIR)/bsdtar-bsdtar_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/bsdtar_windows.c' object='tar/bsdtar-bsdtar_windows.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-bsdtar_windows.o `test -f 'tar/bsdtar_windows.c' || echo '$(srcdir)/'`tar/bsdtar_windows.c
+
+tar/bsdtar-bsdtar_windows.obj: tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-bsdtar_windows.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-bsdtar_windows.Tpo -c -o tar/bsdtar-bsdtar_windows.obj `if test -f 'tar/bsdtar_windows.c'; then $(CYGPATH_W) 'tar/bsdtar_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/bsdtar_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-bsdtar_windows.Tpo tar/$(DEPDIR)/bsdtar-bsdtar_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/bsdtar_windows.c' object='tar/bsdtar-bsdtar_windows.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-bsdtar_windows.obj `if test -f 'tar/bsdtar_windows.c'; then $(CYGPATH_W) 'tar/bsdtar_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/bsdtar_windows.c'; fi`
+
tar/bsdtar_test-getdate.o: tar/getdate.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar_test-getdate.o -MD -MP -MF tar/$(DEPDIR)/bsdtar_test-getdate.Tpo -c -o tar/bsdtar_test-getdate.o `test -f 'tar/getdate.c' || echo '$(srcdir)/'`tar/getdate.c
@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar_test-getdate.Tpo tar/$(DEPDIR)/bsdtar_test-getdate.Po
@@ -2664,6 +3708,20 @@ tar/test/bsdtar_test-test_copy.obj: tar/test/test_copy.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_copy.obj `if test -f 'tar/test/test_copy.c'; then $(CYGPATH_W) 'tar/test/test_copy.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_copy.c'; fi`
+tar/test/bsdtar_test-test_empty_mtree.o: tar/test/test_empty_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_empty_mtree.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Tpo -c -o tar/test/bsdtar_test-test_empty_mtree.o `test -f 'tar/test/test_empty_mtree.c' || echo '$(srcdir)/'`tar/test/test_empty_mtree.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_empty_mtree.c' object='tar/test/bsdtar_test-test_empty_mtree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_empty_mtree.o `test -f 'tar/test/test_empty_mtree.c' || echo '$(srcdir)/'`tar/test/test_empty_mtree.c
+
+tar/test/bsdtar_test-test_empty_mtree.obj: tar/test/test_empty_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_empty_mtree.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Tpo -c -o tar/test/bsdtar_test-test_empty_mtree.obj `if test -f 'tar/test/test_empty_mtree.c'; then $(CYGPATH_W) 'tar/test/test_empty_mtree.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_empty_mtree.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_empty_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_empty_mtree.c' object='tar/test/bsdtar_test-test_empty_mtree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_empty_mtree.obj `if test -f 'tar/test/test_empty_mtree.c'; then $(CYGPATH_W) 'tar/test/test_empty_mtree.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_empty_mtree.c'; fi`
+
tar/test/bsdtar_test-test_getdate.o: tar/test/test_getdate.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_getdate.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo -c -o tar/test/bsdtar_test-test_getdate.o `test -f 'tar/test/test_getdate.c' || echo '$(srcdir)/'`tar/test/test_getdate.c
@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Po
@@ -2692,19 +3750,61 @@ tar/test/bsdtar_test-test_help.obj: tar/test/test_help.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_help.obj `if test -f 'tar/test/test_help.c'; then $(CYGPATH_W) 'tar/test/test_help.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_help.c'; fi`
-tar/test/bsdtar_test-test_option_T.o: tar/test/test_option_T.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo -c -o tar/test/bsdtar_test-test_option_T.o `test -f 'tar/test/test_option_T.c' || echo '$(srcdir)/'`tar/test/test_option_T.c
-@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T.c' object='tar/test/bsdtar_test-test_option_T.o' libtool=no @AMDEPBACKSLASH@
+tar/test/bsdtar_test-test_option_T_upper.o: tar/test/test_option_T_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T_upper.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Tpo -c -o tar/test/bsdtar_test-test_option_T_upper.o `test -f 'tar/test/test_option_T_upper.c' || echo '$(srcdir)/'`tar/test/test_option_T_upper.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T_upper.c' object='tar/test/bsdtar_test-test_option_T_upper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_T_upper.o `test -f 'tar/test/test_option_T_upper.c' || echo '$(srcdir)/'`tar/test/test_option_T_upper.c
+
+tar/test/bsdtar_test-test_option_T_upper.obj: tar/test/test_option_T_upper.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T_upper.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Tpo -c -o tar/test/bsdtar_test-test_option_T_upper.obj `if test -f 'tar/test/test_option_T_upper.c'; then $(CYGPATH_W) 'tar/test/test_option_T_upper.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T_upper.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T_upper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T_upper.c' object='tar/test/bsdtar_test-test_option_T_upper.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_T.o `test -f 'tar/test/test_option_T.c' || echo '$(srcdir)/'`tar/test/test_option_T.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_T_upper.obj `if test -f 'tar/test/test_option_T_upper.c'; then $(CYGPATH_W) 'tar/test/test_option_T_upper.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T_upper.c'; fi`
-tar/test/bsdtar_test-test_option_T.obj: tar/test/test_option_T.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo -c -o tar/test/bsdtar_test-test_option_T.obj `if test -f 'tar/test/test_option_T.c'; then $(CYGPATH_W) 'tar/test/test_option_T.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T.c'; fi`
-@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T.c' object='tar/test/bsdtar_test-test_option_T.obj' libtool=no @AMDEPBACKSLASH@
+tar/test/bsdtar_test-test_option_q.o: tar/test/test_option_q.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_q.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Tpo -c -o tar/test/bsdtar_test-test_option_q.o `test -f 'tar/test/test_option_q.c' || echo '$(srcdir)/'`tar/test/test_option_q.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_q.c' object='tar/test/bsdtar_test-test_option_q.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_T.obj `if test -f 'tar/test/test_option_T.c'; then $(CYGPATH_W) 'tar/test/test_option_T.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_q.o `test -f 'tar/test/test_option_q.c' || echo '$(srcdir)/'`tar/test/test_option_q.c
+
+tar/test/bsdtar_test-test_option_q.obj: tar/test/test_option_q.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_q.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Tpo -c -o tar/test/bsdtar_test-test_option_q.obj `if test -f 'tar/test/test_option_q.c'; then $(CYGPATH_W) 'tar/test/test_option_q.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_q.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_q.c' object='tar/test/bsdtar_test-test_option_q.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_q.obj `if test -f 'tar/test/test_option_q.c'; then $(CYGPATH_W) 'tar/test/test_option_q.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_q.c'; fi`
+
+tar/test/bsdtar_test-test_option_r.o: tar/test/test_option_r.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_r.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Tpo -c -o tar/test/bsdtar_test-test_option_r.o `test -f 'tar/test/test_option_r.c' || echo '$(srcdir)/'`tar/test/test_option_r.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_r.c' object='tar/test/bsdtar_test-test_option_r.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_r.o `test -f 'tar/test/test_option_r.c' || echo '$(srcdir)/'`tar/test/test_option_r.c
+
+tar/test/bsdtar_test-test_option_r.obj: tar/test/test_option_r.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_r.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Tpo -c -o tar/test/bsdtar_test-test_option_r.obj `if test -f 'tar/test/test_option_r.c'; then $(CYGPATH_W) 'tar/test/test_option_r.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_r.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_r.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_r.c' object='tar/test/bsdtar_test-test_option_r.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_r.obj `if test -f 'tar/test/test_option_r.c'; then $(CYGPATH_W) 'tar/test/test_option_r.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_r.c'; fi`
+
+tar/test/bsdtar_test-test_option_s.o: tar/test/test_option_s.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_s.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Tpo -c -o tar/test/bsdtar_test-test_option_s.o `test -f 'tar/test/test_option_s.c' || echo '$(srcdir)/'`tar/test/test_option_s.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_s.c' object='tar/test/bsdtar_test-test_option_s.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_s.o `test -f 'tar/test/test_option_s.c' || echo '$(srcdir)/'`tar/test/test_option_s.c
+
+tar/test/bsdtar_test-test_option_s.obj: tar/test/test_option_s.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_s.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Tpo -c -o tar/test/bsdtar_test-test_option_s.obj `if test -f 'tar/test/test_option_s.c'; then $(CYGPATH_W) 'tar/test/test_option_s.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_s.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_s.c' object='tar/test/bsdtar_test-test_option_s.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_s.obj `if test -f 'tar/test/test_option_s.c'; then $(CYGPATH_W) 'tar/test/test_option_s.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_s.c'; fi`
tar/test/bsdtar_test-test_patterns.o: tar/test/test_patterns.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_patterns.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Tpo -c -o tar/test/bsdtar_test-test_patterns.o `test -f 'tar/test/test_patterns.c' || echo '$(srcdir)/'`tar/test/test_patterns.c
@@ -2734,6 +3834,34 @@ tar/test/bsdtar_test-test_stdio.obj: tar/test/test_stdio.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_stdio.obj `if test -f 'tar/test/test_stdio.c'; then $(CYGPATH_W) 'tar/test/test_stdio.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_stdio.c'; fi`
+tar/test/bsdtar_test-test_strip_components.o: tar/test/test_strip_components.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_strip_components.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Tpo -c -o tar/test/bsdtar_test-test_strip_components.o `test -f 'tar/test/test_strip_components.c' || echo '$(srcdir)/'`tar/test/test_strip_components.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_strip_components.c' object='tar/test/bsdtar_test-test_strip_components.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_strip_components.o `test -f 'tar/test/test_strip_components.c' || echo '$(srcdir)/'`tar/test/test_strip_components.c
+
+tar/test/bsdtar_test-test_strip_components.obj: tar/test/test_strip_components.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_strip_components.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Tpo -c -o tar/test/bsdtar_test-test_strip_components.obj `if test -f 'tar/test/test_strip_components.c'; then $(CYGPATH_W) 'tar/test/test_strip_components.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_strip_components.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_strip_components.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_strip_components.c' object='tar/test/bsdtar_test-test_strip_components.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_strip_components.obj `if test -f 'tar/test/test_strip_components.c'; then $(CYGPATH_W) 'tar/test/test_strip_components.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_strip_components.c'; fi`
+
+tar/test/bsdtar_test-test_symlink_dir.o: tar/test/test_symlink_dir.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_symlink_dir.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Tpo -c -o tar/test/bsdtar_test-test_symlink_dir.o `test -f 'tar/test/test_symlink_dir.c' || echo '$(srcdir)/'`tar/test/test_symlink_dir.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_symlink_dir.c' object='tar/test/bsdtar_test-test_symlink_dir.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_symlink_dir.o `test -f 'tar/test/test_symlink_dir.c' || echo '$(srcdir)/'`tar/test/test_symlink_dir.c
+
+tar/test/bsdtar_test-test_symlink_dir.obj: tar/test/test_symlink_dir.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_symlink_dir.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Tpo -c -o tar/test/bsdtar_test-test_symlink_dir.obj `if test -f 'tar/test/test_symlink_dir.c'; then $(CYGPATH_W) 'tar/test/test_symlink_dir.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_symlink_dir.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_symlink_dir.c' object='tar/test/bsdtar_test-test_symlink_dir.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_symlink_dir.obj `if test -f 'tar/test/test_symlink_dir.c'; then $(CYGPATH_W) 'tar/test/test_symlink_dir.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_symlink_dir.c'; fi`
+
tar/test/bsdtar_test-test_version.o: tar/test/test_version.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_version.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo -c -o tar/test/bsdtar_test-test_version.o `test -f 'tar/test/test_version.c' || echo '$(srcdir)/'`tar/test/test_version.c
@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_version.Po
@@ -2748,6 +3876,34 @@ tar/test/bsdtar_test-test_version.obj: tar/test/test_version.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_version.obj `if test -f 'tar/test/test_version.c'; then $(CYGPATH_W) 'tar/test/test_version.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_version.c'; fi`
+tar/test/bsdtar_test-test_windows.o: tar/test/test_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_windows.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_windows.Tpo -c -o tar/test/bsdtar_test-test_windows.o `test -f 'tar/test/test_windows.c' || echo '$(srcdir)/'`tar/test/test_windows.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_windows.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_windows.c' object='tar/test/bsdtar_test-test_windows.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_windows.o `test -f 'tar/test/test_windows.c' || echo '$(srcdir)/'`tar/test/test_windows.c
+
+tar/test/bsdtar_test-test_windows.obj: tar/test/test_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_windows.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_windows.Tpo -c -o tar/test/bsdtar_test-test_windows.obj `if test -f 'tar/test/test_windows.c'; then $(CYGPATH_W) 'tar/test/test_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_windows.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_windows.c' object='tar/test/bsdtar_test-test_windows.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_windows.obj `if test -f 'tar/test/test_windows.c'; then $(CYGPATH_W) 'tar/test/test_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_windows.c'; fi`
+
+tar/bsdtar_test-bsdtar_windows.o: tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar_test-bsdtar_windows.o -MD -MP -MF tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Tpo -c -o tar/bsdtar_test-bsdtar_windows.o `test -f 'tar/bsdtar_windows.c' || echo '$(srcdir)/'`tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Tpo tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/bsdtar_windows.c' object='tar/bsdtar_test-bsdtar_windows.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar_test-bsdtar_windows.o `test -f 'tar/bsdtar_windows.c' || echo '$(srcdir)/'`tar/bsdtar_windows.c
+
+tar/bsdtar_test-bsdtar_windows.obj: tar/bsdtar_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar_test-bsdtar_windows.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Tpo -c -o tar/bsdtar_test-bsdtar_windows.obj `if test -f 'tar/bsdtar_windows.c'; then $(CYGPATH_W) 'tar/bsdtar_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/bsdtar_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Tpo tar/$(DEPDIR)/bsdtar_test-bsdtar_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/bsdtar_windows.c' object='tar/bsdtar_test-bsdtar_windows.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar_test-bsdtar_windows.obj `if test -f 'tar/bsdtar_windows.c'; then $(CYGPATH_W) 'tar/bsdtar_windows.c'; else $(CYGPATH_W) '$(srcdir)/tar/bsdtar_windows.c'; fi`
+
libarchive/libarchive_test-archive_check_magic.o: libarchive/archive_check_magic.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_check_magic.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Tpo -c -o libarchive/libarchive_test-archive_check_magic.o `test -f 'libarchive/archive_check_magic.c' || echo '$(srcdir)/'`libarchive/archive_check_magic.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Po
@@ -2832,6 +3988,20 @@ libarchive/libarchive_test-archive_entry_strmode.obj: libarchive/archive_entry_s
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_entry_strmode.obj `if test -f 'libarchive/archive_entry_strmode.c'; then $(CYGPATH_W) 'libarchive/archive_entry_strmode.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_entry_strmode.c'; fi`
+libarchive/libarchive_test-archive_entry_xattr.o: libarchive/archive_entry_xattr.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_entry_xattr.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Tpo -c -o libarchive/libarchive_test-archive_entry_xattr.o `test -f 'libarchive/archive_entry_xattr.c' || echo '$(srcdir)/'`libarchive/archive_entry_xattr.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_xattr.c' object='libarchive/libarchive_test-archive_entry_xattr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_entry_xattr.o `test -f 'libarchive/archive_entry_xattr.c' || echo '$(srcdir)/'`libarchive/archive_entry_xattr.c
+
+libarchive/libarchive_test-archive_entry_xattr.obj: libarchive/archive_entry_xattr.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_entry_xattr.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Tpo -c -o libarchive/libarchive_test-archive_entry_xattr.obj `if test -f 'libarchive/archive_entry_xattr.c'; then $(CYGPATH_W) 'libarchive/archive_entry_xattr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_entry_xattr.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_entry_xattr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_xattr.c' object='libarchive/libarchive_test-archive_entry_xattr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_entry_xattr.obj `if test -f 'libarchive/archive_entry_xattr.c'; then $(CYGPATH_W) 'libarchive/archive_entry_xattr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_entry_xattr.c'; fi`
+
libarchive/libarchive_test-archive_read.o: libarchive/archive_read.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read.Tpo -c -o libarchive/libarchive_test-archive_read.o `test -f 'libarchive/archive_read.c' || echo '$(srcdir)/'`libarchive/archive_read.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read.Po
@@ -2860,6 +4030,48 @@ libarchive/libarchive_test-archive_read_data_into_fd.obj: libarchive/archive_rea
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_data_into_fd.obj `if test -f 'libarchive/archive_read_data_into_fd.c'; then $(CYGPATH_W) 'libarchive/archive_read_data_into_fd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_data_into_fd.c'; fi`
+libarchive/libarchive_test-archive_read_disk.o: libarchive/archive_read_disk.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Tpo -c -o libarchive/libarchive_test-archive_read_disk.o `test -f 'libarchive/archive_read_disk.c' || echo '$(srcdir)/'`libarchive/archive_read_disk.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk.c' object='libarchive/libarchive_test-archive_read_disk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk.o `test -f 'libarchive/archive_read_disk.c' || echo '$(srcdir)/'`libarchive/archive_read_disk.c
+
+libarchive/libarchive_test-archive_read_disk.obj: libarchive/archive_read_disk.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Tpo -c -o libarchive/libarchive_test-archive_read_disk.obj `if test -f 'libarchive/archive_read_disk.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk.c' object='libarchive/libarchive_test-archive_read_disk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk.obj `if test -f 'libarchive/archive_read_disk.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk.c'; fi`
+
+libarchive/libarchive_test-archive_read_disk_entry_from_file.o: libarchive/archive_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk_entry_from_file.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Tpo -c -o libarchive/libarchive_test-archive_read_disk_entry_from_file.o `test -f 'libarchive/archive_read_disk_entry_from_file.c' || echo '$(srcdir)/'`libarchive/archive_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk_entry_from_file.c' object='libarchive/libarchive_test-archive_read_disk_entry_from_file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk_entry_from_file.o `test -f 'libarchive/archive_read_disk_entry_from_file.c' || echo '$(srcdir)/'`libarchive/archive_read_disk_entry_from_file.c
+
+libarchive/libarchive_test-archive_read_disk_entry_from_file.obj: libarchive/archive_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk_entry_from_file.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Tpo -c -o libarchive/libarchive_test-archive_read_disk_entry_from_file.obj `if test -f 'libarchive/archive_read_disk_entry_from_file.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk_entry_from_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk_entry_from_file.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_entry_from_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk_entry_from_file.c' object='libarchive/libarchive_test-archive_read_disk_entry_from_file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk_entry_from_file.obj `if test -f 'libarchive/archive_read_disk_entry_from_file.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk_entry_from_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk_entry_from_file.c'; fi`
+
+libarchive/libarchive_test-archive_read_disk_set_standard_lookup.o: libarchive/archive_read_disk_set_standard_lookup.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk_set_standard_lookup.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Tpo -c -o libarchive/libarchive_test-archive_read_disk_set_standard_lookup.o `test -f 'libarchive/archive_read_disk_set_standard_lookup.c' || echo '$(srcdir)/'`libarchive/archive_read_disk_set_standard_lookup.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk_set_standard_lookup.c' object='libarchive/libarchive_test-archive_read_disk_set_standard_lookup.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk_set_standard_lookup.o `test -f 'libarchive/archive_read_disk_set_standard_lookup.c' || echo '$(srcdir)/'`libarchive/archive_read_disk_set_standard_lookup.c
+
+libarchive/libarchive_test-archive_read_disk_set_standard_lookup.obj: libarchive/archive_read_disk_set_standard_lookup.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_disk_set_standard_lookup.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Tpo -c -o libarchive/libarchive_test-archive_read_disk_set_standard_lookup.obj `if test -f 'libarchive/archive_read_disk_set_standard_lookup.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk_set_standard_lookup.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk_set_standard_lookup.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_disk_set_standard_lookup.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_disk_set_standard_lookup.c' object='libarchive/libarchive_test-archive_read_disk_set_standard_lookup.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_disk_set_standard_lookup.obj `if test -f 'libarchive/archive_read_disk_set_standard_lookup.c'; then $(CYGPATH_W) 'libarchive/archive_read_disk_set_standard_lookup.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_disk_set_standard_lookup.c'; fi`
+
libarchive/libarchive_test-archive_read_extract.o: libarchive/archive_read_extract.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_extract.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_extract.Tpo -c -o libarchive/libarchive_test-archive_read_extract.o `test -f 'libarchive/archive_read_extract.c' || echo '$(srcdir)/'`libarchive/archive_read_extract.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_extract.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_extract.Po
@@ -3014,6 +4226,48 @@ libarchive/libarchive_test-archive_read_support_compression_program.obj: libarch
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_program.obj `if test -f 'libarchive/archive_read_support_compression_program.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_program.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_program.c'; fi`
+libarchive/libarchive_test-archive_read_support_compression_rpm.o: libarchive/archive_read_support_compression_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_rpm.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_rpm.o `test -f 'libarchive/archive_read_support_compression_rpm.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_rpm.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_rpm.c' object='libarchive/libarchive_test-archive_read_support_compression_rpm.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_rpm.o `test -f 'libarchive/archive_read_support_compression_rpm.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_rpm.c
+
+libarchive/libarchive_test-archive_read_support_compression_rpm.obj: libarchive/archive_read_support_compression_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_rpm.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_rpm.obj `if test -f 'libarchive/archive_read_support_compression_rpm.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_rpm.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_rpm.c' object='libarchive/libarchive_test-archive_read_support_compression_rpm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_rpm.obj `if test -f 'libarchive/archive_read_support_compression_rpm.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_rpm.c'; fi`
+
+libarchive/libarchive_test-archive_read_support_compression_uu.o: libarchive/archive_read_support_compression_uu.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_uu.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_uu.o `test -f 'libarchive/archive_read_support_compression_uu.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_uu.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_uu.c' object='libarchive/libarchive_test-archive_read_support_compression_uu.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_uu.o `test -f 'libarchive/archive_read_support_compression_uu.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_uu.c
+
+libarchive/libarchive_test-archive_read_support_compression_uu.obj: libarchive/archive_read_support_compression_uu.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_uu.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_uu.obj `if test -f 'libarchive/archive_read_support_compression_uu.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_uu.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_uu.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_uu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_uu.c' object='libarchive/libarchive_test-archive_read_support_compression_uu.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_uu.obj `if test -f 'libarchive/archive_read_support_compression_uu.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_uu.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_uu.c'; fi`
+
+libarchive/libarchive_test-archive_read_support_compression_xz.o: libarchive/archive_read_support_compression_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_xz.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_xz.o `test -f 'libarchive/archive_read_support_compression_xz.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_xz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_xz.c' object='libarchive/libarchive_test-archive_read_support_compression_xz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_xz.o `test -f 'libarchive/archive_read_support_compression_xz.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_xz.c
+
+libarchive/libarchive_test-archive_read_support_compression_xz.obj: libarchive/archive_read_support_compression_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_compression_xz.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Tpo -c -o libarchive/libarchive_test-archive_read_support_compression_xz.obj `if test -f 'libarchive/archive_read_support_compression_xz.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_xz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_compression_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_xz.c' object='libarchive/libarchive_test-archive_read_support_compression_xz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_compression_xz.obj `if test -f 'libarchive/archive_read_support_compression_xz.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_compression_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_compression_xz.c'; fi`
+
libarchive/libarchive_test-archive_read_support_format_all.o: libarchive/archive_read_support_format_all.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_all.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_all.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_all.o `test -f 'libarchive/archive_read_support_format_all.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_all.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_all.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_all.Po
@@ -3098,6 +4352,20 @@ libarchive/libarchive_test-archive_read_support_format_mtree.obj: libarchive/arc
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_mtree.obj `if test -f 'libarchive/archive_read_support_format_mtree.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_mtree.c'; fi`
+libarchive/libarchive_test-archive_read_support_format_raw.o: libarchive/archive_read_support_format_raw.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_raw.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_raw.o `test -f 'libarchive/archive_read_support_format_raw.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_raw.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_raw.c' object='libarchive/libarchive_test-archive_read_support_format_raw.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_raw.o `test -f 'libarchive/archive_read_support_format_raw.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_raw.c
+
+libarchive/libarchive_test-archive_read_support_format_raw.obj: libarchive/archive_read_support_format_raw.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_raw.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_raw.obj `if test -f 'libarchive/archive_read_support_format_raw.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_raw.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_raw.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_raw.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_raw.c' object='libarchive/libarchive_test-archive_read_support_format_raw.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_raw.obj `if test -f 'libarchive/archive_read_support_format_raw.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_raw.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_raw.c'; fi`
+
libarchive/libarchive_test-archive_read_support_format_tar.o: libarchive/archive_read_support_format_tar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_tar.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_tar.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_tar.o `test -f 'libarchive/archive_read_support_format_tar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_tar.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_tar.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_tar.Po
@@ -3112,6 +4380,20 @@ libarchive/libarchive_test-archive_read_support_format_tar.obj: libarchive/archi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_tar.obj `if test -f 'libarchive/archive_read_support_format_tar.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_tar.c'; fi`
+libarchive/libarchive_test-archive_read_support_format_xar.o: libarchive/archive_read_support_format_xar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_xar.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_xar.o `test -f 'libarchive/archive_read_support_format_xar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_xar.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_xar.c' object='libarchive/libarchive_test-archive_read_support_format_xar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_xar.o `test -f 'libarchive/archive_read_support_format_xar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_xar.c
+
+libarchive/libarchive_test-archive_read_support_format_xar.obj: libarchive/archive_read_support_format_xar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_xar.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_xar.obj `if test -f 'libarchive/archive_read_support_format_xar.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_xar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_xar.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_xar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_xar.c' object='libarchive/libarchive_test-archive_read_support_format_xar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_read_support_format_xar.obj `if test -f 'libarchive/archive_read_support_format_xar.c'; then $(CYGPATH_W) 'libarchive/archive_read_support_format_xar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_read_support_format_xar.c'; fi`
+
libarchive/libarchive_test-archive_read_support_format_zip.o: libarchive/archive_read_support_format_zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_read_support_format_zip.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_zip.Tpo -c -o libarchive/libarchive_test-archive_read_support_format_zip.o `test -f 'libarchive/archive_read_support_format_zip.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_zip.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_zip.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_read_support_format_zip.Po
@@ -3350,6 +4632,20 @@ libarchive/libarchive_test-archive_write_set_compression_program.obj: libarchive
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_compression_program.obj `if test -f 'libarchive/archive_write_set_compression_program.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_program.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_program.c'; fi`
+libarchive/libarchive_test-archive_write_set_compression_xz.o: libarchive/archive_write_set_compression_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_compression_xz.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Tpo -c -o libarchive/libarchive_test-archive_write_set_compression_xz.o `test -f 'libarchive/archive_write_set_compression_xz.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_xz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_xz.c' object='libarchive/libarchive_test-archive_write_set_compression_xz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_compression_xz.o `test -f 'libarchive/archive_write_set_compression_xz.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_xz.c
+
+libarchive/libarchive_test-archive_write_set_compression_xz.obj: libarchive/archive_write_set_compression_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_compression_xz.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Tpo -c -o libarchive/libarchive_test-archive_write_set_compression_xz.obj `if test -f 'libarchive/archive_write_set_compression_xz.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_xz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_xz.c' object='libarchive/libarchive_test-archive_write_set_compression_xz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_compression_xz.obj `if test -f 'libarchive/archive_write_set_compression_xz.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_xz.c'; fi`
+
libarchive/libarchive_test-archive_write_set_format.o: libarchive/archive_write_set_format.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format.Tpo -c -o libarchive/libarchive_test-archive_write_set_format.o `test -f 'libarchive/archive_write_set_format.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format.Po
@@ -3420,6 +4716,20 @@ libarchive/libarchive_test-archive_write_set_format_cpio_newc.obj: libarchive/ar
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_cpio_newc.obj `if test -f 'libarchive/archive_write_set_format_cpio_newc.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_cpio_newc.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_cpio_newc.c'; fi`
+libarchive/libarchive_test-archive_write_set_format_mtree.o: libarchive/archive_write_set_format_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format_mtree.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Tpo -c -o libarchive/libarchive_test-archive_write_set_format_mtree.o `test -f 'libarchive/archive_write_set_format_mtree.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_mtree.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_mtree.c' object='libarchive/libarchive_test-archive_write_set_format_mtree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_mtree.o `test -f 'libarchive/archive_write_set_format_mtree.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_mtree.c
+
+libarchive/libarchive_test-archive_write_set_format_mtree.obj: libarchive/archive_write_set_format_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format_mtree.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Tpo -c -o libarchive/libarchive_test-archive_write_set_format_mtree.obj `if test -f 'libarchive/archive_write_set_format_mtree.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_mtree.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_mtree.c' object='libarchive/libarchive_test-archive_write_set_format_mtree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_mtree.obj `if test -f 'libarchive/archive_write_set_format_mtree.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_mtree.c'; fi`
+
libarchive/libarchive_test-archive_write_set_format_pax.o: libarchive/archive_write_set_format_pax.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format_pax.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_pax.Tpo -c -o libarchive/libarchive_test-archive_write_set_format_pax.o `test -f 'libarchive/archive_write_set_format_pax.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_pax.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_pax.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_pax.Po
@@ -3462,6 +4772,20 @@ libarchive/libarchive_test-archive_write_set_format_ustar.obj: libarchive/archiv
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_ustar.obj `if test -f 'libarchive/archive_write_set_format_ustar.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_ustar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_ustar.c'; fi`
+libarchive/libarchive_test-archive_write_set_format_zip.o: libarchive/archive_write_set_format_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format_zip.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Tpo -c -o libarchive/libarchive_test-archive_write_set_format_zip.o `test -f 'libarchive/archive_write_set_format_zip.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_zip.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_zip.c' object='libarchive/libarchive_test-archive_write_set_format_zip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_zip.o `test -f 'libarchive/archive_write_set_format_zip.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_zip.c
+
+libarchive/libarchive_test-archive_write_set_format_zip.obj: libarchive/archive_write_set_format_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_format_zip.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Tpo -c -o libarchive/libarchive_test-archive_write_set_format_zip.obj `if test -f 'libarchive/archive_write_set_format_zip.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_zip.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_format_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_zip.c' object='libarchive/libarchive_test-archive_write_set_format_zip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_set_format_zip.obj `if test -f 'libarchive/archive_write_set_format_zip.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_format_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_format_zip.c'; fi`
+
libarchive/libarchive_test-filter_fork.o: libarchive/filter_fork.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-filter_fork.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-filter_fork.Tpo -c -o libarchive/libarchive_test-filter_fork.o `test -f 'libarchive/filter_fork.c' || echo '$(srcdir)/'`libarchive/filter_fork.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-filter_fork.Tpo libarchive/$(DEPDIR)/libarchive_test-filter_fork.Po
@@ -3476,6 +4800,48 @@ libarchive/libarchive_test-filter_fork.obj: libarchive/filter_fork.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-filter_fork.obj `if test -f 'libarchive/filter_fork.c'; then $(CYGPATH_W) 'libarchive/filter_fork.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/filter_fork.c'; fi`
+libarchive/libarchive_test-archive_entry_copy_bhfi.o: libarchive/archive_entry_copy_bhfi.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_entry_copy_bhfi.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Tpo -c -o libarchive/libarchive_test-archive_entry_copy_bhfi.o `test -f 'libarchive/archive_entry_copy_bhfi.c' || echo '$(srcdir)/'`libarchive/archive_entry_copy_bhfi.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_copy_bhfi.c' object='libarchive/libarchive_test-archive_entry_copy_bhfi.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_entry_copy_bhfi.o `test -f 'libarchive/archive_entry_copy_bhfi.c' || echo '$(srcdir)/'`libarchive/archive_entry_copy_bhfi.c
+
+libarchive/libarchive_test-archive_entry_copy_bhfi.obj: libarchive/archive_entry_copy_bhfi.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_entry_copy_bhfi.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Tpo -c -o libarchive/libarchive_test-archive_entry_copy_bhfi.obj `if test -f 'libarchive/archive_entry_copy_bhfi.c'; then $(CYGPATH_W) 'libarchive/archive_entry_copy_bhfi.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_entry_copy_bhfi.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_copy_bhfi.c' object='libarchive/libarchive_test-archive_entry_copy_bhfi.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_entry_copy_bhfi.obj `if test -f 'libarchive/archive_entry_copy_bhfi.c'; then $(CYGPATH_W) 'libarchive/archive_entry_copy_bhfi.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_entry_copy_bhfi.c'; fi`
+
+libarchive/libarchive_test-archive_windows.o: libarchive/archive_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_windows.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_windows.Tpo -c -o libarchive/libarchive_test-archive_windows.o `test -f 'libarchive/archive_windows.c' || echo '$(srcdir)/'`libarchive/archive_windows.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_windows.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_windows.c' object='libarchive/libarchive_test-archive_windows.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_windows.o `test -f 'libarchive/archive_windows.c' || echo '$(srcdir)/'`libarchive/archive_windows.c
+
+libarchive/libarchive_test-archive_windows.obj: libarchive/archive_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_windows.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_windows.Tpo -c -o libarchive/libarchive_test-archive_windows.obj `if test -f 'libarchive/archive_windows.c'; then $(CYGPATH_W) 'libarchive/archive_windows.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_windows.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_windows.c' object='libarchive/libarchive_test-archive_windows.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_windows.obj `if test -f 'libarchive/archive_windows.c'; then $(CYGPATH_W) 'libarchive/archive_windows.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_windows.c'; fi`
+
+libarchive/libarchive_test-filter_fork_windows.o: libarchive/filter_fork_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-filter_fork_windows.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Tpo -c -o libarchive/libarchive_test-filter_fork_windows.o `test -f 'libarchive/filter_fork_windows.c' || echo '$(srcdir)/'`libarchive/filter_fork_windows.c
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Tpo libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/filter_fork_windows.c' object='libarchive/libarchive_test-filter_fork_windows.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-filter_fork_windows.o `test -f 'libarchive/filter_fork_windows.c' || echo '$(srcdir)/'`libarchive/filter_fork_windows.c
+
+libarchive/libarchive_test-filter_fork_windows.obj: libarchive/filter_fork_windows.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-filter_fork_windows.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Tpo -c -o libarchive/libarchive_test-filter_fork_windows.obj `if test -f 'libarchive/filter_fork_windows.c'; then $(CYGPATH_W) 'libarchive/filter_fork_windows.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/filter_fork_windows.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Tpo libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/filter_fork_windows.c' object='libarchive/libarchive_test-filter_fork_windows.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-filter_fork_windows.obj `if test -f 'libarchive/filter_fork_windows.c'; then $(CYGPATH_W) 'libarchive/filter_fork_windows.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/filter_fork_windows.c'; fi`
+
libarchive/test/libarchive_test-main.o: libarchive/test/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-main.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo -c -o libarchive/test/libarchive_test-main.o `test -f 'libarchive/test/main.c' || echo '$(srcdir)/'`libarchive/test/main.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo libarchive/test/$(DEPDIR)/libarchive_test-main.Po
@@ -3518,6 +4884,20 @@ libarchive/test/libarchive_test-test_acl_basic.obj: libarchive/test/test_acl_bas
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_basic.obj `if test -f 'libarchive/test/test_acl_basic.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_basic.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_basic.c'; fi`
+libarchive/test/libarchive_test-test_acl_freebsd.o: libarchive/test/test_acl_freebsd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd.o `test -f 'libarchive/test/test_acl_freebsd.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_acl_freebsd.c' object='libarchive/test/libarchive_test-test_acl_freebsd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd.o `test -f 'libarchive/test/test_acl_freebsd.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd.c
+
+libarchive/test/libarchive_test-test_acl_freebsd.obj: libarchive/test/test_acl_freebsd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd.obj `if test -f 'libarchive/test/test_acl_freebsd.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_acl_freebsd.c' object='libarchive/test/libarchive_test-test_acl_freebsd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd.obj `if test -f 'libarchive/test/test_acl_freebsd.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd.c'; fi`
+
libarchive/test/libarchive_test-test_acl_pax.o: libarchive/test/test_acl_pax.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_pax.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Tpo -c -o libarchive/test/libarchive_test-test_acl_pax.o `test -f 'libarchive/test/test_acl_pax.c' || echo '$(srcdir)/'`libarchive/test/test_acl_pax.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Po
@@ -3560,6 +4940,34 @@ libarchive/test/libarchive_test-test_bad_fd.obj: libarchive/test/test_bad_fd.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_bad_fd.obj `if test -f 'libarchive/test/test_bad_fd.c'; then $(CYGPATH_W) 'libarchive/test/test_bad_fd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_bad_fd.c'; fi`
+libarchive/test/libarchive_test-test_compat_bzip2.o: libarchive/test/test_compat_bzip2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_bzip2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Tpo -c -o libarchive/test/libarchive_test-test_compat_bzip2.o `test -f 'libarchive/test/test_compat_bzip2.c' || echo '$(srcdir)/'`libarchive/test/test_compat_bzip2.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_bzip2.c' object='libarchive/test/libarchive_test-test_compat_bzip2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_bzip2.o `test -f 'libarchive/test/test_compat_bzip2.c' || echo '$(srcdir)/'`libarchive/test/test_compat_bzip2.c
+
+libarchive/test/libarchive_test-test_compat_bzip2.obj: libarchive/test/test_compat_bzip2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_bzip2.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Tpo -c -o libarchive/test/libarchive_test-test_compat_bzip2.obj `if test -f 'libarchive/test/test_compat_bzip2.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_bzip2.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_bzip2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_bzip2.c' object='libarchive/test/libarchive_test-test_compat_bzip2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_bzip2.obj `if test -f 'libarchive/test/test_compat_bzip2.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_bzip2.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_cpio.o: libarchive/test/test_compat_cpio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_cpio.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Tpo -c -o libarchive/test/libarchive_test-test_compat_cpio.o `test -f 'libarchive/test/test_compat_cpio.c' || echo '$(srcdir)/'`libarchive/test/test_compat_cpio.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_cpio.c' object='libarchive/test/libarchive_test-test_compat_cpio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_cpio.o `test -f 'libarchive/test/test_compat_cpio.c' || echo '$(srcdir)/'`libarchive/test/test_compat_cpio.c
+
+libarchive/test/libarchive_test-test_compat_cpio.obj: libarchive/test/test_compat_cpio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_cpio.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Tpo -c -o libarchive/test/libarchive_test-test_compat_cpio.obj `if test -f 'libarchive/test/test_compat_cpio.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_cpio.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_cpio.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_cpio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_cpio.c' object='libarchive/test/libarchive_test-test_compat_cpio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_cpio.obj `if test -f 'libarchive/test/test_compat_cpio.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_cpio.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_cpio.c'; fi`
+
libarchive/test/libarchive_test-test_compat_gtar.o: libarchive/test/test_compat_gtar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_gtar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo -c -o libarchive/test/libarchive_test-test_compat_gtar.o `test -f 'libarchive/test/test_compat_gtar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_gtar.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Po
@@ -3574,6 +4982,48 @@ libarchive/test/libarchive_test-test_compat_gtar.obj: libarchive/test/test_compa
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_gtar.obj `if test -f 'libarchive/test/test_compat_gtar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_gtar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_gtar.c'; fi`
+libarchive/test/libarchive_test-test_compat_gzip.o: libarchive/test/test_compat_gzip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_gzip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Tpo -c -o libarchive/test/libarchive_test-test_compat_gzip.o `test -f 'libarchive/test/test_compat_gzip.c' || echo '$(srcdir)/'`libarchive/test/test_compat_gzip.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_gzip.c' object='libarchive/test/libarchive_test-test_compat_gzip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_gzip.o `test -f 'libarchive/test/test_compat_gzip.c' || echo '$(srcdir)/'`libarchive/test/test_compat_gzip.c
+
+libarchive/test/libarchive_test-test_compat_gzip.obj: libarchive/test/test_compat_gzip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_gzip.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Tpo -c -o libarchive/test/libarchive_test-test_compat_gzip.obj `if test -f 'libarchive/test/test_compat_gzip.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_gzip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_gzip.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gzip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_gzip.c' object='libarchive/test/libarchive_test-test_compat_gzip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_gzip.obj `if test -f 'libarchive/test/test_compat_gzip.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_gzip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_gzip.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_lzma.o: libarchive/test/test_compat_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_lzma.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Tpo -c -o libarchive/test/libarchive_test-test_compat_lzma.o `test -f 'libarchive/test/test_compat_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_compat_lzma.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_lzma.c' object='libarchive/test/libarchive_test-test_compat_lzma.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_lzma.o `test -f 'libarchive/test/test_compat_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_compat_lzma.c
+
+libarchive/test/libarchive_test-test_compat_lzma.obj: libarchive/test/test_compat_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_lzma.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Tpo -c -o libarchive/test/libarchive_test-test_compat_lzma.obj `if test -f 'libarchive/test/test_compat_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_lzma.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_lzma.c' object='libarchive/test/libarchive_test-test_compat_lzma.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_lzma.obj `if test -f 'libarchive/test/test_compat_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_lzma.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o: libarchive/test/test_compat_solaris_tar_acl.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo -c -o libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o `test -f 'libarchive/test/test_compat_solaris_tar_acl.c' || echo '$(srcdir)/'`libarchive/test/test_compat_solaris_tar_acl.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_solaris_tar_acl.c' object='libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o `test -f 'libarchive/test/test_compat_solaris_tar_acl.c' || echo '$(srcdir)/'`libarchive/test/test_compat_solaris_tar_acl.c
+
+libarchive/test/libarchive_test-test_compat_solaris_tar_acl.obj: libarchive/test/test_compat_solaris_tar_acl.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_solaris_tar_acl.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo -c -o libarchive/test/libarchive_test-test_compat_solaris_tar_acl.obj `if test -f 'libarchive/test/test_compat_solaris_tar_acl.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_solaris_tar_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_solaris_tar_acl.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_solaris_tar_acl.c' object='libarchive/test/libarchive_test-test_compat_solaris_tar_acl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_solaris_tar_acl.obj `if test -f 'libarchive/test/test_compat_solaris_tar_acl.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_solaris_tar_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_solaris_tar_acl.c'; fi`
+
libarchive/test/libarchive_test-test_compat_tar_hardlink.o: libarchive/test/test_compat_tar_hardlink.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_tar_hardlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.o `test -f 'libarchive/test/test_compat_tar_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_compat_tar_hardlink.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po
@@ -3588,6 +5038,20 @@ libarchive/test/libarchive_test-test_compat_tar_hardlink.obj: libarchive/test/te
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.obj `if test -f 'libarchive/test/test_compat_tar_hardlink.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_tar_hardlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_tar_hardlink.c'; fi`
+libarchive/test/libarchive_test-test_compat_xz.o: libarchive/test/test_compat_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_xz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Tpo -c -o libarchive/test/libarchive_test-test_compat_xz.o `test -f 'libarchive/test/test_compat_xz.c' || echo '$(srcdir)/'`libarchive/test/test_compat_xz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_xz.c' object='libarchive/test/libarchive_test-test_compat_xz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_xz.o `test -f 'libarchive/test/test_compat_xz.c' || echo '$(srcdir)/'`libarchive/test/test_compat_xz.c
+
+libarchive/test/libarchive_test-test_compat_xz.obj: libarchive/test/test_compat_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_xz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Tpo -c -o libarchive/test/libarchive_test-test_compat_xz.obj `if test -f 'libarchive/test/test_compat_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_xz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_xz.c' object='libarchive/test/libarchive_test-test_compat_xz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_xz.obj `if test -f 'libarchive/test/test_compat_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_xz.c'; fi`
+
libarchive/test/libarchive_test-test_compat_zip.o: libarchive/test/test_compat_zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_zip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo -c -o libarchive/test/libarchive_test-test_compat_zip.o `test -f 'libarchive/test/test_compat_zip.c' || echo '$(srcdir)/'`libarchive/test/test_compat_zip.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Po
@@ -3630,6 +5094,34 @@ libarchive/test/libarchive_test-test_entry.obj: libarchive/test/test_entry.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_entry.obj `if test -f 'libarchive/test/test_entry.c'; then $(CYGPATH_W) 'libarchive/test/test_entry.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_entry.c'; fi`
+libarchive/test/libarchive_test-test_extattr_freebsd.o: libarchive/test/test_extattr_freebsd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_extattr_freebsd.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Tpo -c -o libarchive/test/libarchive_test-test_extattr_freebsd.o `test -f 'libarchive/test/test_extattr_freebsd.c' || echo '$(srcdir)/'`libarchive/test/test_extattr_freebsd.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_extattr_freebsd.c' object='libarchive/test/libarchive_test-test_extattr_freebsd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_extattr_freebsd.o `test -f 'libarchive/test/test_extattr_freebsd.c' || echo '$(srcdir)/'`libarchive/test/test_extattr_freebsd.c
+
+libarchive/test/libarchive_test-test_extattr_freebsd.obj: libarchive/test/test_extattr_freebsd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_extattr_freebsd.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Tpo -c -o libarchive/test/libarchive_test-test_extattr_freebsd.obj `if test -f 'libarchive/test/test_extattr_freebsd.c'; then $(CYGPATH_W) 'libarchive/test/test_extattr_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_extattr_freebsd.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_extattr_freebsd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_extattr_freebsd.c' object='libarchive/test/libarchive_test-test_extattr_freebsd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_extattr_freebsd.obj `if test -f 'libarchive/test/test_extattr_freebsd.c'; then $(CYGPATH_W) 'libarchive/test/test_extattr_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_extattr_freebsd.c'; fi`
+
+libarchive/test/libarchive_test-test_fuzz.o: libarchive/test/test_fuzz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_fuzz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Tpo -c -o libarchive/test/libarchive_test-test_fuzz.o `test -f 'libarchive/test/test_fuzz.c' || echo '$(srcdir)/'`libarchive/test/test_fuzz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_fuzz.c' object='libarchive/test/libarchive_test-test_fuzz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_fuzz.o `test -f 'libarchive/test/test_fuzz.c' || echo '$(srcdir)/'`libarchive/test/test_fuzz.c
+
+libarchive/test/libarchive_test-test_fuzz.obj: libarchive/test/test_fuzz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_fuzz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Tpo -c -o libarchive/test/libarchive_test-test_fuzz.obj `if test -f 'libarchive/test/test_fuzz.c'; then $(CYGPATH_W) 'libarchive/test/test_fuzz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_fuzz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_fuzz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_fuzz.c' object='libarchive/test/libarchive_test-test_fuzz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_fuzz.obj `if test -f 'libarchive/test/test_fuzz.c'; then $(CYGPATH_W) 'libarchive/test/test_fuzz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_fuzz.c'; fi`
+
libarchive/test/libarchive_test-test_entry_strmode.o: libarchive/test/test_entry_strmode.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_entry_strmode.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_entry_strmode.Tpo -c -o libarchive/test/libarchive_test-test_entry_strmode.o `test -f 'libarchive/test/test_entry_strmode.c' || echo '$(srcdir)/'`libarchive/test/test_entry_strmode.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_entry_strmode.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_entry_strmode.Po
@@ -3658,6 +5150,48 @@ libarchive/test/libarchive_test-test_link_resolver.obj: libarchive/test/test_lin
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_link_resolver.obj `if test -f 'libarchive/test/test_link_resolver.c'; then $(CYGPATH_W) 'libarchive/test/test_link_resolver.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_link_resolver.c'; fi`
+libarchive/test/libarchive_test-test_open_fd.o: libarchive/test/test_open_fd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_fd.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Tpo -c -o libarchive/test/libarchive_test-test_open_fd.o `test -f 'libarchive/test/test_open_fd.c' || echo '$(srcdir)/'`libarchive/test/test_open_fd.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_fd.c' object='libarchive/test/libarchive_test-test_open_fd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_fd.o `test -f 'libarchive/test/test_open_fd.c' || echo '$(srcdir)/'`libarchive/test/test_open_fd.c
+
+libarchive/test/libarchive_test-test_open_fd.obj: libarchive/test/test_open_fd.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_fd.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Tpo -c -o libarchive/test/libarchive_test-test_open_fd.obj `if test -f 'libarchive/test/test_open_fd.c'; then $(CYGPATH_W) 'libarchive/test/test_open_fd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_fd.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_fd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_fd.c' object='libarchive/test/libarchive_test-test_open_fd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_fd.obj `if test -f 'libarchive/test/test_open_fd.c'; then $(CYGPATH_W) 'libarchive/test/test_open_fd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_fd.c'; fi`
+
+libarchive/test/libarchive_test-test_open_file.o: libarchive/test/test_open_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_file.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Tpo -c -o libarchive/test/libarchive_test-test_open_file.o `test -f 'libarchive/test/test_open_file.c' || echo '$(srcdir)/'`libarchive/test/test_open_file.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_file.c' object='libarchive/test/libarchive_test-test_open_file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_file.o `test -f 'libarchive/test/test_open_file.c' || echo '$(srcdir)/'`libarchive/test/test_open_file.c
+
+libarchive/test/libarchive_test-test_open_file.obj: libarchive/test/test_open_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_file.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Tpo -c -o libarchive/test/libarchive_test-test_open_file.obj `if test -f 'libarchive/test/test_open_file.c'; then $(CYGPATH_W) 'libarchive/test/test_open_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_file.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_file.c' object='libarchive/test/libarchive_test-test_open_file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_file.obj `if test -f 'libarchive/test/test_open_file.c'; then $(CYGPATH_W) 'libarchive/test/test_open_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_file.c'; fi`
+
+libarchive/test/libarchive_test-test_open_filename.o: libarchive/test/test_open_filename.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_filename.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Tpo -c -o libarchive/test/libarchive_test-test_open_filename.o `test -f 'libarchive/test/test_open_filename.c' || echo '$(srcdir)/'`libarchive/test/test_open_filename.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_filename.c' object='libarchive/test/libarchive_test-test_open_filename.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_filename.o `test -f 'libarchive/test/test_open_filename.c' || echo '$(srcdir)/'`libarchive/test/test_open_filename.c
+
+libarchive/test/libarchive_test-test_open_filename.obj: libarchive/test/test_open_filename.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_open_filename.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Tpo -c -o libarchive/test/libarchive_test-test_open_filename.obj `if test -f 'libarchive/test/test_open_filename.c'; then $(CYGPATH_W) 'libarchive/test/test_open_filename.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_filename.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_open_filename.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_open_filename.c' object='libarchive/test/libarchive_test-test_open_filename.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_open_filename.obj `if test -f 'libarchive/test/test_open_filename.c'; then $(CYGPATH_W) 'libarchive/test/test_open_filename.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_open_filename.c'; fi`
+
libarchive/test/libarchive_test-test_pax_filename_encoding.o: libarchive/test/test_pax_filename_encoding.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_pax_filename_encoding.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo -c -o libarchive/test/libarchive_test-test_pax_filename_encoding.o `test -f 'libarchive/test/test_pax_filename_encoding.c' || echo '$(srcdir)/'`libarchive/test/test_pax_filename_encoding.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Po
@@ -3700,6 +5234,34 @@ libarchive/test/libarchive_test-test_read_data_large.obj: libarchive/test/test_r
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_data_large.obj `if test -f 'libarchive/test/test_read_data_large.c'; then $(CYGPATH_W) 'libarchive/test/test_read_data_large.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_data_large.c'; fi`
+libarchive/test/libarchive_test-test_read_disk.o: libarchive/test/test_read_disk.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_disk.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Tpo -c -o libarchive/test/libarchive_test-test_read_disk.o `test -f 'libarchive/test/test_read_disk.c' || echo '$(srcdir)/'`libarchive/test/test_read_disk.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_disk.c' object='libarchive/test/libarchive_test-test_read_disk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_disk.o `test -f 'libarchive/test/test_read_disk.c' || echo '$(srcdir)/'`libarchive/test/test_read_disk.c
+
+libarchive/test/libarchive_test-test_read_disk.obj: libarchive/test/test_read_disk.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_disk.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Tpo -c -o libarchive/test/libarchive_test-test_read_disk.obj `if test -f 'libarchive/test/test_read_disk.c'; then $(CYGPATH_W) 'libarchive/test/test_read_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_disk.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_disk.c' object='libarchive/test/libarchive_test-test_read_disk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_disk.obj `if test -f 'libarchive/test/test_read_disk.c'; then $(CYGPATH_W) 'libarchive/test/test_read_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_disk.c'; fi`
+
+libarchive/test/libarchive_test-test_read_disk_entry_from_file.o: libarchive/test/test_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_disk_entry_from_file.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Tpo -c -o libarchive/test/libarchive_test-test_read_disk_entry_from_file.o `test -f 'libarchive/test/test_read_disk_entry_from_file.c' || echo '$(srcdir)/'`libarchive/test/test_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_disk_entry_from_file.c' object='libarchive/test/libarchive_test-test_read_disk_entry_from_file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_disk_entry_from_file.o `test -f 'libarchive/test/test_read_disk_entry_from_file.c' || echo '$(srcdir)/'`libarchive/test/test_read_disk_entry_from_file.c
+
+libarchive/test/libarchive_test-test_read_disk_entry_from_file.obj: libarchive/test/test_read_disk_entry_from_file.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_disk_entry_from_file.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Tpo -c -o libarchive/test/libarchive_test-test_read_disk_entry_from_file.obj `if test -f 'libarchive/test/test_read_disk_entry_from_file.c'; then $(CYGPATH_W) 'libarchive/test/test_read_disk_entry_from_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_disk_entry_from_file.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_disk_entry_from_file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_disk_entry_from_file.c' object='libarchive/test/libarchive_test-test_read_disk_entry_from_file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_disk_entry_from_file.obj `if test -f 'libarchive/test/test_read_disk_entry_from_file.c'; then $(CYGPATH_W) 'libarchive/test/test_read_disk_entry_from_file.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_disk_entry_from_file.c'; fi`
+
libarchive/test/libarchive_test-test_read_extract.o: libarchive/test/test_read_extract.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_extract.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_extract.Tpo -c -o libarchive/test/libarchive_test-test_read_extract.o `test -f 'libarchive/test/test_read_extract.c' || echo '$(srcdir)/'`libarchive/test/test_read_extract.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_extract.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_extract.Po
@@ -3714,6 +5276,20 @@ libarchive/test/libarchive_test-test_read_extract.obj: libarchive/test/test_read
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_extract.obj `if test -f 'libarchive/test/test_read_extract.c'; then $(CYGPATH_W) 'libarchive/test/test_read_extract.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_extract.c'; fi`
+libarchive/test/libarchive_test-test_read_file_nonexistent.o: libarchive/test/test_read_file_nonexistent.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_file_nonexistent.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Tpo -c -o libarchive/test/libarchive_test-test_read_file_nonexistent.o `test -f 'libarchive/test/test_read_file_nonexistent.c' || echo '$(srcdir)/'`libarchive/test/test_read_file_nonexistent.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_file_nonexistent.c' object='libarchive/test/libarchive_test-test_read_file_nonexistent.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_file_nonexistent.o `test -f 'libarchive/test/test_read_file_nonexistent.c' || echo '$(srcdir)/'`libarchive/test/test_read_file_nonexistent.c
+
+libarchive/test/libarchive_test-test_read_file_nonexistent.obj: libarchive/test/test_read_file_nonexistent.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_file_nonexistent.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Tpo -c -o libarchive/test/libarchive_test-test_read_file_nonexistent.obj `if test -f 'libarchive/test/test_read_file_nonexistent.c'; then $(CYGPATH_W) 'libarchive/test/test_read_file_nonexistent.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_file_nonexistent.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_file_nonexistent.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_file_nonexistent.c' object='libarchive/test/libarchive_test-test_read_file_nonexistent.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_file_nonexistent.obj `if test -f 'libarchive/test/test_read_file_nonexistent.c'; then $(CYGPATH_W) 'libarchive/test/test_read_file_nonexistent.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_file_nonexistent.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_ar.o: libarchive/test/test_read_format_ar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_ar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_ar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_ar.o `test -f 'libarchive/test/test_read_format_ar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_ar.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_ar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_ar.Po
@@ -3756,6 +5332,20 @@ libarchive/test/libarchive_test-test_read_format_cpio_bin_Z.obj: libarchive/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_Z.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_Z.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_Z.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_Z.c'; fi`
+libarchive/test/libarchive_test-test_read_format_cpio_bin_be.o: libarchive/test/test_read_format_cpio_bin_be.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_be.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_be.o `test -f 'libarchive/test/test_read_format_cpio_bin_be.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_be.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_be.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_be.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_be.o `test -f 'libarchive/test/test_read_format_cpio_bin_be.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_be.c
+
+libarchive/test/libarchive_test-test_read_format_cpio_bin_be.obj: libarchive/test/test_read_format_cpio_bin_be.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_be.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_be.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_be.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_be.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_be.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_be.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_be.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_be.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_be.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_be.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_be.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_be.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.o: libarchive/test/test_read_format_cpio_bin_bz2.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_bz2.o `test -f 'libarchive/test/test_read_format_cpio_bin_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_bz2.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_bz2.Po
@@ -3784,6 +5374,34 @@ libarchive/test/libarchive_test-test_read_format_cpio_bin_gz.obj: libarchive/tes
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_gz.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_gz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_gz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_gz.c'; fi`
+libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.o: libarchive/test/test_read_format_cpio_bin_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.o `test -f 'libarchive/test/test_read_format_cpio_bin_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_lzma.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_lzma.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.o `test -f 'libarchive/test/test_read_format_cpio_bin_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_lzma.c
+
+libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.obj: libarchive/test/test_read_format_cpio_bin_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_lzma.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_lzma.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_lzma.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_lzma.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.o: libarchive/test/test_read_format_cpio_bin_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.o `test -f 'libarchive/test/test_read_format_cpio_bin_xz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_xz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_xz.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.o `test -f 'libarchive/test/test_read_format_cpio_bin_xz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_bin_xz.c
+
+libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.obj: libarchive/test/test_read_format_cpio_bin_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_xz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_bin_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_bin_xz.c' object='libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_bin_xz.obj `if test -f 'libarchive/test/test_read_format_cpio_bin_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_bin_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_bin_xz.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_cpio_odc.o: libarchive/test/test_read_format_cpio_odc.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_odc.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_odc.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_odc.o `test -f 'libarchive/test/test_read_format_cpio_odc.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_odc.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_odc.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_odc.Po
@@ -3798,6 +5416,20 @@ libarchive/test/libarchive_test-test_read_format_cpio_odc.obj: libarchive/test/t
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_odc.obj `if test -f 'libarchive/test/test_read_format_cpio_odc.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_odc.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_odc.c'; fi`
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.o: libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.o `test -f 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c' object='libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.o `test -f 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
+
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.obj: libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.obj `if test -f 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c' object='libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_bzip2_rpm.obj `if test -f 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.o: libarchive/test/test_read_format_cpio_svr4_gzip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.o `test -f 'libarchive/test/test_read_format_cpio_svr4_gzip.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4_gzip.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip.Po
@@ -3812,6 +5444,20 @@ libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.obj: libarchive/
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip.obj `if test -f 'libarchive/test/test_read_format_cpio_svr4_gzip.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_svr4_gzip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_svr4_gzip.c'; fi`
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.o: libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.o `test -f 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c' object='libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.o `test -f 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
+
+libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.obj: libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.obj `if test -f 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c' object='libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4_gzip_rpm.obj `if test -f 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.o: libarchive/test/test_read_format_cpio_svr4c_Z.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4c_Z.Tpo -c -o libarchive/test/libarchive_test-test_read_format_cpio_svr4c_Z.o `test -f 'libarchive/test/test_read_format_cpio_svr4c_Z.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_cpio_svr4c_Z.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4c_Z.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_cpio_svr4c_Z.Po
@@ -3854,6 +5500,20 @@ libarchive/test/libarchive_test-test_read_format_gtar_gz.obj: libarchive/test/te
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_gtar_gz.obj `if test -f 'libarchive/test/test_read_format_gtar_gz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_gtar_gz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_gtar_gz.c'; fi`
+libarchive/test/libarchive_test-test_read_format_gtar_lzma.o: libarchive/test/test_read_format_gtar_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_gtar_lzma.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Tpo -c -o libarchive/test/libarchive_test-test_read_format_gtar_lzma.o `test -f 'libarchive/test/test_read_format_gtar_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_gtar_lzma.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_gtar_lzma.c' object='libarchive/test/libarchive_test-test_read_format_gtar_lzma.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_gtar_lzma.o `test -f 'libarchive/test/test_read_format_gtar_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_gtar_lzma.c
+
+libarchive/test/libarchive_test-test_read_format_gtar_lzma.obj: libarchive/test/test_read_format_gtar_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_gtar_lzma.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Tpo -c -o libarchive/test/libarchive_test-test_read_format_gtar_lzma.obj `if test -f 'libarchive/test/test_read_format_gtar_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_gtar_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_gtar_lzma.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_gtar_lzma.c' object='libarchive/test/libarchive_test-test_read_format_gtar_lzma.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_gtar_lzma.obj `if test -f 'libarchive/test/test_read_format_gtar_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_gtar_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_gtar_lzma.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_gtar_sparse.o: libarchive/test/test_read_format_gtar_sparse.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_gtar_sparse.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_sparse.Tpo -c -o libarchive/test/libarchive_test-test_read_format_gtar_sparse.o `test -f 'libarchive/test/test_read_format_gtar_sparse.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_gtar_sparse.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_sparse.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_gtar_sparse.Po
@@ -3882,6 +5542,62 @@ libarchive/test/libarchive_test-test_read_format_iso_gz.obj: libarchive/test/tes
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_iso_gz.obj `if test -f 'libarchive/test/test_read_format_iso_gz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_iso_gz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_iso_gz.c'; fi`
+libarchive/test/libarchive_test-test_read_format_iso_multi_extent.o: libarchive/test/test_read_format_iso_multi_extent.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_iso_multi_extent.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Tpo -c -o libarchive/test/libarchive_test-test_read_format_iso_multi_extent.o `test -f 'libarchive/test/test_read_format_iso_multi_extent.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_iso_multi_extent.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_iso_multi_extent.c' object='libarchive/test/libarchive_test-test_read_format_iso_multi_extent.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_iso_multi_extent.o `test -f 'libarchive/test/test_read_format_iso_multi_extent.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_iso_multi_extent.c
+
+libarchive/test/libarchive_test-test_read_format_iso_multi_extent.obj: libarchive/test/test_read_format_iso_multi_extent.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_iso_multi_extent.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Tpo -c -o libarchive/test/libarchive_test-test_read_format_iso_multi_extent.obj `if test -f 'libarchive/test/test_read_format_iso_multi_extent.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_iso_multi_extent.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_iso_multi_extent.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_iso_multi_extent.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_iso_multi_extent.c' object='libarchive/test/libarchive_test-test_read_format_iso_multi_extent.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_iso_multi_extent.obj `if test -f 'libarchive/test/test_read_format_iso_multi_extent.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_iso_multi_extent.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_iso_multi_extent.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.o: libarchive/test/test_read_format_isojoliet_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.o `test -f 'libarchive/test/test_read_format_isojoliet_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_bz2.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.o `test -f 'libarchive/test/test_read_format_isojoliet_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_bz2.c
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.obj: libarchive/test/test_read_format_isojoliet_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.obj `if test -f 'libarchive/test/test_read_format_isojoliet_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_bz2.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_bz2.obj `if test -f 'libarchive/test/test_read_format_isojoliet_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_bz2.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_long.o: libarchive/test/test_read_format_isojoliet_long.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_long.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_long.o `test -f 'libarchive/test/test_read_format_isojoliet_long.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_long.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_long.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_long.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_long.o `test -f 'libarchive/test/test_read_format_isojoliet_long.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_long.c
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_long.obj: libarchive/test/test_read_format_isojoliet_long.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_long.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_long.obj `if test -f 'libarchive/test/test_read_format_isojoliet_long.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_long.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_long.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_long.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_long.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_long.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_long.obj `if test -f 'libarchive/test/test_read_format_isojoliet_long.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_long.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_long.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_rr.o: libarchive/test/test_read_format_isojoliet_rr.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_rr.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_rr.o `test -f 'libarchive/test/test_read_format_isojoliet_rr.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_rr.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_rr.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_rr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_rr.o `test -f 'libarchive/test/test_read_format_isojoliet_rr.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isojoliet_rr.c
+
+libarchive/test/libarchive_test-test_read_format_isojoliet_rr.obj: libarchive/test/test_read_format_isojoliet_rr.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isojoliet_rr.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_rr.obj `if test -f 'libarchive/test/test_read_format_isojoliet_rr.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_rr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_rr.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isojoliet_rr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isojoliet_rr.c' object='libarchive/test/libarchive_test-test_read_format_isojoliet_rr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isojoliet_rr.obj `if test -f 'libarchive/test/test_read_format_isojoliet_rr.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isojoliet_rr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isojoliet_rr.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_isorr_bz2.o: libarchive/test/test_read_format_isorr_bz2.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_bz2.o `test -f 'libarchive/test/test_read_format_isorr_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_bz2.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_bz2.Po
@@ -3896,6 +5612,62 @@ libarchive/test/libarchive_test-test_read_format_isorr_bz2.obj: libarchive/test/
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_bz2.obj `if test -f 'libarchive/test/test_read_format_isorr_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_bz2.c'; fi`
+libarchive/test/libarchive_test-test_read_format_isorr_ce.o: libarchive/test/test_read_format_isorr_ce.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_ce.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_ce.o `test -f 'libarchive/test/test_read_format_isorr_ce.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_ce.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_ce.c' object='libarchive/test/libarchive_test-test_read_format_isorr_ce.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_ce.o `test -f 'libarchive/test/test_read_format_isorr_ce.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_ce.c
+
+libarchive/test/libarchive_test-test_read_format_isorr_ce.obj: libarchive/test/test_read_format_isorr_ce.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_ce.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_ce.obj `if test -f 'libarchive/test/test_read_format_isorr_ce.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_ce.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_ce.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_ce.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_ce.c' object='libarchive/test/libarchive_test-test_read_format_isorr_ce.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_ce.obj `if test -f 'libarchive/test/test_read_format_isorr_ce.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_ce.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_ce.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.o: libarchive/test/test_read_format_isorr_new_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.o `test -f 'libarchive/test/test_read_format_isorr_new_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_new_bz2.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_new_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.o `test -f 'libarchive/test/test_read_format_isorr_new_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_new_bz2.c
+
+libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.obj: libarchive/test/test_read_format_isorr_new_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.obj `if test -f 'libarchive/test/test_read_format_isorr_new_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_new_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_new_bz2.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_new_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_new_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_new_bz2.obj `if test -f 'libarchive/test/test_read_format_isorr_new_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_new_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_new_bz2.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.o: libarchive/test/test_read_format_isorr_rr_moved.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.o `test -f 'libarchive/test/test_read_format_isorr_rr_moved.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_rr_moved.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_rr_moved.c' object='libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.o `test -f 'libarchive/test/test_read_format_isorr_rr_moved.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isorr_rr_moved.c
+
+libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.obj: libarchive/test/test_read_format_isorr_rr_moved.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.obj `if test -f 'libarchive/test/test_read_format_isorr_rr_moved.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_rr_moved.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_rr_moved.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isorr_rr_moved.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isorr_rr_moved.c' object='libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isorr_rr_moved.obj `if test -f 'libarchive/test/test_read_format_isorr_rr_moved.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isorr_rr_moved.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isorr_rr_moved.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.o: libarchive/test/test_read_format_isozisofs_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.o `test -f 'libarchive/test/test_read_format_isozisofs_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isozisofs_bz2.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isozisofs_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.o `test -f 'libarchive/test/test_read_format_isozisofs_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_isozisofs_bz2.c
+
+libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.obj: libarchive/test/test_read_format_isozisofs_bz2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.obj `if test -f 'libarchive/test/test_read_format_isozisofs_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isozisofs_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isozisofs_bz2.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_isozisofs_bz2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_isozisofs_bz2.c' object='libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_isozisofs_bz2.obj `if test -f 'libarchive/test/test_read_format_isozisofs_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_isozisofs_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_isozisofs_bz2.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_mtree.o: libarchive/test/test_read_format_mtree.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_mtree.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Tpo -c -o libarchive/test/libarchive_test-test_read_format_mtree.o `test -f 'libarchive/test/test_read_format_mtree.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_mtree.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Po
@@ -3924,6 +5696,20 @@ libarchive/test/libarchive_test-test_read_format_pax_bz2.obj: libarchive/test/te
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_pax_bz2.obj `if test -f 'libarchive/test/test_read_format_pax_bz2.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_pax_bz2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_pax_bz2.c'; fi`
+libarchive/test/libarchive_test-test_read_format_raw.o: libarchive/test/test_read_format_raw.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_raw.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Tpo -c -o libarchive/test/libarchive_test-test_read_format_raw.o `test -f 'libarchive/test/test_read_format_raw.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_raw.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_raw.c' object='libarchive/test/libarchive_test-test_read_format_raw.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_raw.o `test -f 'libarchive/test/test_read_format_raw.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_raw.c
+
+libarchive/test/libarchive_test-test_read_format_raw.obj: libarchive/test/test_read_format_raw.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_raw.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Tpo -c -o libarchive/test/libarchive_test-test_read_format_raw.obj `if test -f 'libarchive/test/test_read_format_raw.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_raw.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_raw.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_raw.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_raw.c' object='libarchive/test/libarchive_test-test_read_format_raw.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_raw.obj `if test -f 'libarchive/test/test_read_format_raw.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_raw.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_raw.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_tar.o: libarchive/test/test_read_format_tar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tar.o `test -f 'libarchive/test/test_read_format_tar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tar.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar.Po
@@ -3980,6 +5766,34 @@ libarchive/test/libarchive_test-test_read_format_tgz.obj: libarchive/test/test_r
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_tgz.obj `if test -f 'libarchive/test/test_read_format_tgz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tgz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tgz.c'; fi`
+libarchive/test/libarchive_test-test_read_format_tlz.o: libarchive/test/test_read_format_tlz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tlz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tlz.o `test -f 'libarchive/test/test_read_format_tlz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tlz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_tlz.c' object='libarchive/test/libarchive_test-test_read_format_tlz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_tlz.o `test -f 'libarchive/test/test_read_format_tlz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tlz.c
+
+libarchive/test/libarchive_test-test_read_format_tlz.obj: libarchive/test/test_read_format_tlz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tlz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tlz.obj `if test -f 'libarchive/test/test_read_format_tlz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tlz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tlz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tlz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_tlz.c' object='libarchive/test/libarchive_test-test_read_format_tlz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_tlz.obj `if test -f 'libarchive/test/test_read_format_tlz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tlz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tlz.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_txz.o: libarchive/test/test_read_format_txz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_txz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_txz.o `test -f 'libarchive/test/test_read_format_txz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_txz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_txz.c' object='libarchive/test/libarchive_test-test_read_format_txz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_txz.o `test -f 'libarchive/test/test_read_format_txz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_txz.c
+
+libarchive/test/libarchive_test-test_read_format_txz.obj: libarchive/test/test_read_format_txz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_txz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_txz.obj `if test -f 'libarchive/test/test_read_format_txz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_txz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_txz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_txz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_txz.c' object='libarchive/test/libarchive_test-test_read_format_txz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_txz.obj `if test -f 'libarchive/test/test_read_format_txz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_txz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_txz.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_tz.o: libarchive/test/test_read_format_tz.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tz.o `test -f 'libarchive/test/test_read_format_tz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tz.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tz.Po
@@ -3994,6 +5808,20 @@ libarchive/test/libarchive_test-test_read_format_tz.obj: libarchive/test/test_re
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_tz.obj `if test -f 'libarchive/test/test_read_format_tz.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tz.c'; fi`
+libarchive/test/libarchive_test-test_read_format_xar.o: libarchive/test/test_read_format_xar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_xar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_xar.o `test -f 'libarchive/test/test_read_format_xar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_xar.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_xar.c' object='libarchive/test/libarchive_test-test_read_format_xar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_xar.o `test -f 'libarchive/test/test_read_format_xar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_xar.c
+
+libarchive/test/libarchive_test-test_read_format_xar.obj: libarchive/test/test_read_format_xar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_xar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_xar.obj `if test -f 'libarchive/test/test_read_format_xar.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_xar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_xar.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_xar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_xar.c' object='libarchive/test/libarchive_test-test_read_format_xar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_xar.obj `if test -f 'libarchive/test/test_read_format_xar.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_xar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_xar.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_zip.o: libarchive/test/test_read_format_zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip.o `test -f 'libarchive/test/test_read_format_zip.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip.Po
@@ -4064,6 +5892,20 @@ libarchive/test/libarchive_test-test_read_truncated.obj: libarchive/test/test_re
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_truncated.obj `if test -f 'libarchive/test/test_read_truncated.c'; then $(CYGPATH_W) 'libarchive/test/test_read_truncated.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_truncated.c'; fi`
+libarchive/test/libarchive_test-test_read_uu.o: libarchive/test/test_read_uu.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_uu.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Tpo -c -o libarchive/test/libarchive_test-test_read_uu.o `test -f 'libarchive/test/test_read_uu.c' || echo '$(srcdir)/'`libarchive/test/test_read_uu.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_uu.c' object='libarchive/test/libarchive_test-test_read_uu.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_uu.o `test -f 'libarchive/test/test_read_uu.c' || echo '$(srcdir)/'`libarchive/test/test_read_uu.c
+
+libarchive/test/libarchive_test-test_read_uu.obj: libarchive/test/test_read_uu.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_uu.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Tpo -c -o libarchive/test/libarchive_test-test_read_uu.obj `if test -f 'libarchive/test/test_read_uu.c'; then $(CYGPATH_W) 'libarchive/test/test_read_uu.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_uu.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_uu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_uu.c' object='libarchive/test/libarchive_test-test_read_uu.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_uu.obj `if test -f 'libarchive/test/test_read_uu.c'; then $(CYGPATH_W) 'libarchive/test/test_read_uu.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_uu.c'; fi`
+
libarchive/test/libarchive_test-test_tar_filenames.o: libarchive/test/test_tar_filenames.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_tar_filenames.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_tar_filenames.Tpo -c -o libarchive/test/libarchive_test-test_tar_filenames.o `test -f 'libarchive/test/test_tar_filenames.c' || echo '$(srcdir)/'`libarchive/test/test_tar_filenames.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_tar_filenames.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_tar_filenames.Po
@@ -4120,6 +5962,48 @@ libarchive/test/libarchive_test-test_write_compress.obj: libarchive/test/test_wr
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress.obj `if test -f 'libarchive/test/test_write_compress.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress.c'; fi`
+libarchive/test/libarchive_test-test_write_compress_bzip2.o: libarchive/test/test_write_compress_bzip2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_bzip2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_bzip2.o `test -f 'libarchive/test/test_write_compress_bzip2.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_bzip2.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_bzip2.c' object='libarchive/test/libarchive_test-test_write_compress_bzip2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_bzip2.o `test -f 'libarchive/test/test_write_compress_bzip2.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_bzip2.c
+
+libarchive/test/libarchive_test-test_write_compress_bzip2.obj: libarchive/test/test_write_compress_bzip2.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_bzip2.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_bzip2.obj `if test -f 'libarchive/test/test_write_compress_bzip2.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_bzip2.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_bzip2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_bzip2.c' object='libarchive/test/libarchive_test-test_write_compress_bzip2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_bzip2.obj `if test -f 'libarchive/test/test_write_compress_bzip2.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_bzip2.c'; fi`
+
+libarchive/test/libarchive_test-test_write_compress_gzip.o: libarchive/test/test_write_compress_gzip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_gzip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_gzip.o `test -f 'libarchive/test/test_write_compress_gzip.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_gzip.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_gzip.c' object='libarchive/test/libarchive_test-test_write_compress_gzip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_gzip.o `test -f 'libarchive/test/test_write_compress_gzip.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_gzip.c
+
+libarchive/test/libarchive_test-test_write_compress_gzip.obj: libarchive/test/test_write_compress_gzip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_gzip.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_gzip.obj `if test -f 'libarchive/test/test_write_compress_gzip.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_gzip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_gzip.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_gzip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_gzip.c' object='libarchive/test/libarchive_test-test_write_compress_gzip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_gzip.obj `if test -f 'libarchive/test/test_write_compress_gzip.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_gzip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_gzip.c'; fi`
+
+libarchive/test/libarchive_test-test_write_compress_lzma.o: libarchive/test/test_write_compress_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_lzma.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_lzma.o `test -f 'libarchive/test/test_write_compress_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_lzma.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_lzma.c' object='libarchive/test/libarchive_test-test_write_compress_lzma.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_lzma.o `test -f 'libarchive/test/test_write_compress_lzma.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_lzma.c
+
+libarchive/test/libarchive_test-test_write_compress_lzma.obj: libarchive/test/test_write_compress_lzma.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_lzma.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_lzma.obj `if test -f 'libarchive/test/test_write_compress_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_lzma.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_lzma.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_lzma.c' object='libarchive/test/libarchive_test-test_write_compress_lzma.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_lzma.obj `if test -f 'libarchive/test/test_write_compress_lzma.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_lzma.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_lzma.c'; fi`
+
libarchive/test/libarchive_test-test_write_compress_program.o: libarchive/test/test_write_compress_program.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_program.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_program.o `test -f 'libarchive/test/test_write_compress_program.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_program.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Po
@@ -4134,6 +6018,20 @@ libarchive/test/libarchive_test-test_write_compress_program.obj: libarchive/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_program.obj `if test -f 'libarchive/test/test_write_compress_program.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_program.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_program.c'; fi`
+libarchive/test/libarchive_test-test_write_compress_xz.o: libarchive/test/test_write_compress_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_xz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_xz.o `test -f 'libarchive/test/test_write_compress_xz.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_xz.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_xz.c' object='libarchive/test/libarchive_test-test_write_compress_xz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_xz.o `test -f 'libarchive/test/test_write_compress_xz.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_xz.c
+
+libarchive/test/libarchive_test-test_write_compress_xz.obj: libarchive/test/test_write_compress_xz.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_xz.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_xz.obj `if test -f 'libarchive/test/test_write_compress_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_xz.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_xz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress_xz.c' object='libarchive/test/libarchive_test-test_write_compress_xz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_compress_xz.obj `if test -f 'libarchive/test/test_write_compress_xz.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress_xz.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress_xz.c'; fi`
+
libarchive/test/libarchive_test-test_write_disk.o: libarchive/test/test_write_disk.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk.Tpo -c -o libarchive/test/libarchive_test-test_write_disk.o `test -f 'libarchive/test/test_write_disk.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk.Po
@@ -4148,6 +6046,20 @@ libarchive/test/libarchive_test-test_write_disk.obj: libarchive/test/test_write_
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk.obj `if test -f 'libarchive/test/test_write_disk.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk.c'; fi`
+libarchive/test/libarchive_test-test_write_disk_failures.o: libarchive/test/test_write_disk_failures.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_failures.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_failures.o `test -f 'libarchive/test/test_write_disk_failures.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_failures.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_failures.c' object='libarchive/test/libarchive_test-test_write_disk_failures.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_failures.o `test -f 'libarchive/test/test_write_disk_failures.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_failures.c
+
+libarchive/test/libarchive_test-test_write_disk_failures.obj: libarchive/test/test_write_disk_failures.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_failures.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_failures.obj `if test -f 'libarchive/test/test_write_disk_failures.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_failures.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_failures.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_failures.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_failures.c' object='libarchive/test/libarchive_test-test_write_disk_failures.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_failures.obj `if test -f 'libarchive/test/test_write_disk_failures.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_failures.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_failures.c'; fi`
+
libarchive/test/libarchive_test-test_write_disk_hardlink.o: libarchive/test/test_write_disk_hardlink.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_hardlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_hardlink.o `test -f 'libarchive/test/test_write_disk_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_hardlink.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Po
@@ -4190,6 +6102,48 @@ libarchive/test/libarchive_test-test_write_disk_secure.obj: libarchive/test/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure.obj `if test -f 'libarchive/test/test_write_disk_secure.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure.c'; fi`
+libarchive/test/libarchive_test-test_write_disk_sparse.o: libarchive/test/test_write_disk_sparse.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_sparse.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_sparse.o `test -f 'libarchive/test/test_write_disk_sparse.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_sparse.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_sparse.c' object='libarchive/test/libarchive_test-test_write_disk_sparse.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_sparse.o `test -f 'libarchive/test/test_write_disk_sparse.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_sparse.c
+
+libarchive/test/libarchive_test-test_write_disk_sparse.obj: libarchive/test/test_write_disk_sparse.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_sparse.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_sparse.obj `if test -f 'libarchive/test/test_write_disk_sparse.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_sparse.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_sparse.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_sparse.c' object='libarchive/test/libarchive_test-test_write_disk_sparse.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_sparse.obj `if test -f 'libarchive/test/test_write_disk_sparse.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_sparse.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_sparse.c'; fi`
+
+libarchive/test/libarchive_test-test_write_disk_symlink.o: libarchive/test/test_write_disk_symlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_symlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_symlink.o `test -f 'libarchive/test/test_write_disk_symlink.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_symlink.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_symlink.c' object='libarchive/test/libarchive_test-test_write_disk_symlink.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_symlink.o `test -f 'libarchive/test/test_write_disk_symlink.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_symlink.c
+
+libarchive/test/libarchive_test-test_write_disk_symlink.obj: libarchive/test/test_write_disk_symlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_symlink.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_symlink.obj `if test -f 'libarchive/test/test_write_disk_symlink.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_symlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_symlink.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_symlink.c' object='libarchive/test/libarchive_test-test_write_disk_symlink.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_symlink.obj `if test -f 'libarchive/test/test_write_disk_symlink.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_symlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_symlink.c'; fi`
+
+libarchive/test/libarchive_test-test_write_disk_times.o: libarchive/test/test_write_disk_times.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_times.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_times.o `test -f 'libarchive/test/test_write_disk_times.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_times.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_times.c' object='libarchive/test/libarchive_test-test_write_disk_times.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_times.o `test -f 'libarchive/test/test_write_disk_times.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_times.c
+
+libarchive/test/libarchive_test-test_write_disk_times.obj: libarchive/test/test_write_disk_times.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_times.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_times.obj `if test -f 'libarchive/test/test_write_disk_times.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_times.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_times.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_times.c' object='libarchive/test/libarchive_test-test_write_disk_times.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_times.obj `if test -f 'libarchive/test/test_write_disk_times.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_times.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_times.c'; fi`
+
libarchive/test/libarchive_test-test_write_format_ar.o: libarchive/test/test_write_format_ar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_ar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_ar.Tpo -c -o libarchive/test/libarchive_test-test_write_format_ar.o `test -f 'libarchive/test/test_write_format_ar.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_ar.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_ar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_ar.Po
@@ -4260,6 +6214,34 @@ libarchive/test/libarchive_test-test_write_format_cpio_newc.obj: libarchive/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_cpio_newc.obj `if test -f 'libarchive/test/test_write_format_cpio_newc.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_cpio_newc.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_cpio_newc.c'; fi`
+libarchive/test/libarchive_test-test_write_format_mtree.o: libarchive/test/test_write_format_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_mtree.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Tpo -c -o libarchive/test/libarchive_test-test_write_format_mtree.o `test -f 'libarchive/test/test_write_format_mtree.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_mtree.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_mtree.c' object='libarchive/test/libarchive_test-test_write_format_mtree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_mtree.o `test -f 'libarchive/test/test_write_format_mtree.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_mtree.c
+
+libarchive/test/libarchive_test-test_write_format_mtree.obj: libarchive/test/test_write_format_mtree.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_mtree.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Tpo -c -o libarchive/test/libarchive_test-test_write_format_mtree.obj `if test -f 'libarchive/test/test_write_format_mtree.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_mtree.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_mtree.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_mtree.c' object='libarchive/test/libarchive_test-test_write_format_mtree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_mtree.obj `if test -f 'libarchive/test/test_write_format_mtree.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_mtree.c'; fi`
+
+libarchive/test/libarchive_test-test_write_format_pax.o: libarchive/test/test_write_format_pax.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_pax.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Tpo -c -o libarchive/test/libarchive_test-test_write_format_pax.o `test -f 'libarchive/test/test_write_format_pax.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_pax.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_pax.c' object='libarchive/test/libarchive_test-test_write_format_pax.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_pax.o `test -f 'libarchive/test/test_write_format_pax.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_pax.c
+
+libarchive/test/libarchive_test-test_write_format_pax.obj: libarchive/test/test_write_format_pax.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_pax.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Tpo -c -o libarchive/test/libarchive_test-test_write_format_pax.obj `if test -f 'libarchive/test/test_write_format_pax.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_pax.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_pax.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_pax.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_pax.c' object='libarchive/test/libarchive_test-test_write_format_pax.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_pax.obj `if test -f 'libarchive/test/test_write_format_pax.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_pax.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_pax.c'; fi`
+
libarchive/test/libarchive_test-test_write_format_shar_empty.o: libarchive/test/test_write_format_shar_empty.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_shar_empty.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_shar_empty.Tpo -c -o libarchive/test/libarchive_test-test_write_format_shar_empty.o `test -f 'libarchive/test/test_write_format_shar_empty.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_shar_empty.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_shar_empty.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_shar_empty.Po
@@ -4316,6 +6298,48 @@ libarchive/test/libarchive_test-test_write_format_tar_ustar.obj: libarchive/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_tar_ustar.obj `if test -f 'libarchive/test/test_write_format_tar_ustar.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_tar_ustar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_tar_ustar.c'; fi`
+libarchive/test/libarchive_test-test_write_format_zip.o: libarchive/test/test_write_format_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip.o `test -f 'libarchive/test/test_write_format_zip.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip.c' object='libarchive/test/libarchive_test-test_write_format_zip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip.o `test -f 'libarchive/test/test_write_format_zip.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip.c
+
+libarchive/test/libarchive_test-test_write_format_zip.obj: libarchive/test/test_write_format_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip.obj `if test -f 'libarchive/test/test_write_format_zip.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip.c' object='libarchive/test/libarchive_test-test_write_format_zip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip.obj `if test -f 'libarchive/test/test_write_format_zip.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip.c'; fi`
+
+libarchive/test/libarchive_test-test_write_format_zip_empty.o: libarchive/test/test_write_format_zip_empty.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip_empty.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip_empty.o `test -f 'libarchive/test/test_write_format_zip_empty.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip_empty.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip_empty.c' object='libarchive/test/libarchive_test-test_write_format_zip_empty.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip_empty.o `test -f 'libarchive/test/test_write_format_zip_empty.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip_empty.c
+
+libarchive/test/libarchive_test-test_write_format_zip_empty.obj: libarchive/test/test_write_format_zip_empty.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip_empty.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip_empty.obj `if test -f 'libarchive/test/test_write_format_zip_empty.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip_empty.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip_empty.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_empty.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip_empty.c' object='libarchive/test/libarchive_test-test_write_format_zip_empty.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip_empty.obj `if test -f 'libarchive/test/test_write_format_zip_empty.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip_empty.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip_empty.c'; fi`
+
+libarchive/test/libarchive_test-test_write_format_zip_no_compression.o: libarchive/test/test_write_format_zip_no_compression.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip_no_compression.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip_no_compression.o `test -f 'libarchive/test/test_write_format_zip_no_compression.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip_no_compression.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip_no_compression.c' object='libarchive/test/libarchive_test-test_write_format_zip_no_compression.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip_no_compression.o `test -f 'libarchive/test/test_write_format_zip_no_compression.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_zip_no_compression.c
+
+libarchive/test/libarchive_test-test_write_format_zip_no_compression.obj: libarchive/test/test_write_format_zip_no_compression.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_zip_no_compression.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Tpo -c -o libarchive/test/libarchive_test-test_write_format_zip_no_compression.obj `if test -f 'libarchive/test/test_write_format_zip_no_compression.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip_no_compression.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip_no_compression.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_no_compression.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_zip_no_compression.c' object='libarchive/test/libarchive_test-test_write_format_zip_no_compression.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_format_zip_no_compression.obj `if test -f 'libarchive/test/test_write_format_zip_no_compression.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_zip_no_compression.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_zip_no_compression.c'; fi`
+
libarchive/test/libarchive_test-test_write_open_memory.o: libarchive/test/test_write_open_memory.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_open_memory.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Tpo -c -o libarchive/test/libarchive_test-test_write_open_memory.o `test -f 'libarchive/test/test_write_open_memory.c' || echo '$(srcdir)/'`libarchive/test/test_write_open_memory.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Po
@@ -4330,15 +6354,13 @@ libarchive/test/libarchive_test-test_write_open_memory.obj: libarchive/test/test
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_open_memory.obj `if test -f 'libarchive/test/test_write_open_memory.c'; then $(CYGPATH_W) 'libarchive/test/test_write_open_memory.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_open_memory.c'; fi`
-.y.c:
- $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
-
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf libarchive/.libs libarchive/_libs
+ -rm -rf libarchive_fe/.libs libarchive_fe/_libs
distclean-libtool:
-rm -f libtool
@@ -4477,6 +6499,23 @@ uninstall-man5:
echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
done
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+ @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@@ -4500,8 +6539,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -4513,8 +6552,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -4524,13 +6563,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -4660,6 +6698,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -4686,6 +6728,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -4699,6 +6743,7 @@ distcheck: dist
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
@@ -4749,12 +6794,12 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \
config.h
install-binPROGRAMS: install-libLTLIBRARIES
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -4786,6 +6831,8 @@ distclean-generic:
-rm -f libarchive/$(am__dirstamp)
-rm -f libarchive/test/$(DEPDIR)/$(am__dirstamp)
-rm -f libarchive/test/$(am__dirstamp)
+ -rm -f libarchive_fe/$(DEPDIR)/$(am__dirstamp)
+ -rm -f libarchive_fe/$(am__dirstamp)
-rm -f tar/$(DEPDIR)/$(am__dirstamp)
-rm -f tar/$(am__dirstamp)
-rm -f tar/test/$(DEPDIR)/$(am__dirstamp)
@@ -4795,16 +6842,16 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
- -rm -f tar/getdate.c
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
- clean-libLTLIBRARIES clean-libtool mostlyclean-am
+ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
+ -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) libarchive_fe/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-local distclean-tags
@@ -4819,7 +6866,8 @@ info: info-am
info-am:
-install-data-am: install-includeHEADERS install-man
+install-data-am: install-includeHEADERS install-man \
+ install-pkgconfigDATA
install-dvi: install-dvi-am
@@ -4840,7 +6888,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
+ -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) libarchive_fe/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -4858,7 +6906,7 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-man
+ uninstall-libLTLIBRARIES uninstall-man uninstall-pkgconfigDATA
uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5
@@ -4866,24 +6914,26 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5
.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags dist dist-all \
- dist-bzip2 dist-gzip dist-hook dist-shar dist-tarZ dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-local distclean-tags \
+ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+ ctags dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzma \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-local distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-libLTLIBRARIES install-man install-man1 install-man3 \
- install-man5 install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \
- uninstall-man3 uninstall-man5
+ install-man5 install-pdf install-pdf-am install-pkgconfigDATA \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+ uninstall-man uninstall-man1 uninstall-man3 uninstall-man5 \
+ uninstall-pkgconfigDATA
# a) Clean out some unneeded files and directories
@@ -4897,6 +6947,12 @@ dist-hook:
-rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile
cd $(distdir)/doc && /bin/sh update.sh
+# Verify cmake builds as part of the acceptance
+distcheck-hook:
+ mkdir $(distdir)/_build/cmtest
+ cd $(distdir)/_build/cmtest && cmake ../.. && make && make test
+ rm -rf $(distdir)/_build/cmtest
+
distclean-local:
-rm -rf .ref
-rm -rf autom4te.cache/
diff --git a/archivers/libarchive/files/NEWS b/archivers/libarchive/files/NEWS
index 36005fd1e9c..f7b9d3c3c5f 100644
--- a/archivers/libarchive/files/NEWS
+++ b/archivers/libarchive/files/NEWS
@@ -1,3 +1,94 @@
+Feb 04, 2010: libarchive 2.8.0 released
+Jan 17, 2010: Fix error handling for 'echo nonexistent | cpio -o'
+Jan 17, 2010: Don't use futimes() on Cygwin
+
+Jan 02, 2010: libarchive 2.7.902a released (test release for 2.8)
+Jan 02, 2010: Fix tar/test/test_windows on MinGW
+Jan 02, 2010: Fix memory leaks in libarchive tests
+Jan 01, 2010: Fix memory leak when filter startup fails
+
+Dec 27, 2009: libarchive 2.7.901a released (test release for 2.8)
+
+Aug 04, 2009: libarchive 2.7.1 released
+Jul 20, 2009: Suppress bogus warning about unxz
+Jul 19, 2009: Support Cygwin 1.7
+Jun 11, 2009: Support lzma/xz files compressed with larger buffer sizes.
+May 24, 2009: Handle gzip files signed with OpenBSD "gzsig" program.
+May 07, 2009: Avoid false failures when reading from pipe.
+
+Apr 16, 2009: libarchive 2.7.0 released
+
+Apr 10, 2009: libarchive 2.6.992a released
+Apr 09, 2009: Fix SIGPIPE issue building with MSVC.
+Apr 09, 2009: Fix several minor memory leaks in libarchive and libarchive_test
+
+Apr 08, 2009: libarchive 2.6.991a released
+Apr 07, 2009: Additional tests added to bsdcpio_test
+
+Apr 01, 2009: libarchive 2.6.990a released
+Apr 01, 2009: Use command-line gunzip, bunzip2, unxz, unlzma for
+ decompression if the library is built without suitable
+ libraries. The setup functions return ARCHIVE_WARN
+ in this case so clients can adapt if necessary.
+Apr 01, 2009: Use getpw*_r and getgr*_r functions for thread-safety.
+Mar 24, 2009: Add archive_read_next_header2(), which is up to 25%
+ more efficient for some clients; from Brian Harring.
+Mar 22, 2009: PDF versions of manpages are now included in the distribution.
+Mar, 2009: Major work to improve Cygwin build by Charles Wilson.
+Feb/Mar, 2009: Major work on cmake build support, mostly by Michihiro NAKAJIMA.
+Feb/Mar, 2009: Major work on Visual Studio support by Michihiro NAKAJIMA.
+ All tests now pass.
+Feb 25, 2009: Fix Debian Bug #516577
+Feb 21, 2009: Yacc is no longer needed to build; date parser rewritten in C.
+Jan/Feb, 2009: Mtree work by Michihiro.
+Feb, 2009: Joliet support by Andreas Henriksson.
+Jan/Feb, 2009: New options framework by Michihiro.
+Feb, 2009: High-res timestamps on Tru64, AIX, and GNU Hurd, by Björn Jacke.
+Jan 18, 2009: Extended attributes work on FreeBSD and Linux now with pax format.
+Jan 07, 2009: New archive_read_disk_entry_from_file() knows about ACLs,
+ extended attributes, etc so that bsdtar and bsdcpio don't require
+ such system-specific knowledge.
+Jan 03, 2009: Read filter system extensively refactored. In particular,
+ read filter pipelines are now built out automatically and individual
+ filters should be much easier to implement. Documentation on the
+ Googlecode Wiki explains how to implement new filters.
+Dec 28, 2008: Many Windows/Visual Studio fixes from Michihiro NAKAJIMA.
+
+Dec 28, 2008: Main libarchive development moved from FreeBSD Perforce
+ server to Google Code. This should make it easier for more
+ people to participate in libarchive development.
+
+Dec 28, 2008: libarchive 2.6.0 released
+Dec 25, 2008: libarchive 2.5.905a released
+Dec 10, 2008: libarchive 2.5.904a released
+Dec 04, 2008: libarchive 2.5.903a released
+Nov 09, 2008: libarchive 2.5.902a released
+Nov 08, 2008: libarchive 2.5.901a released
+Nov 08, 2008: Start of pre-release testing for libarchive 2.6
+
+Nov 07, 2008: Read filter refactor: The decompression routines just
+ consume and produce arbitrarily-sized blocks. The reblocking
+ from read_support_compression_none() has been pulled into the
+ read core. Also, the decompression bid now makes multiple
+ passes and stacks read filters.
+Oct 21, 2008: bsdcpio: New command-line parser.
+Oct 19, 2008: Internal read_ahead change: short reads are now an error
+Oct 06, 2008: bsdtar: option parser no longer uses getopt_long(),
+ gives consistent option parsing on all platforms.
+Sep 19, 2008: Jaakko Heinonen: shar utility built on libarchive
+Sep 17, 2008: Pedro Giffuni: birthtime support
+Sep 17, 2008: Miklos Vajna: lzma reader and test. Note: I still have
+ some concerns about the auto-detection (LZMA file format
+ doesn't support auto-detection well), so this is not yet
+ enabled under archive_read_support_compression_all(). For
+ now, you must call archive_read_support_compression_lzma() if
+ you want LZMA read support.
+Sep 11, 2008: Ivailo Petrov: Many fixes to Windows build, new solution files
+Jul 26, 2008: archive_entry now tracks which values have not been set.
+ This helps zip extraction (file size is often "unknown") and
+ time restores (tar usually doesn't know atime).
+Jul 26, 2008: Joerg Sonnenberger: Performance improvements to shar writer
+Jul 25, 2008: Joerg Sonnenberger: mtree write support
Jul 02, 2008: libarchive 2.5.5 released
@@ -323,7 +414,7 @@ Feb 27, 2007: Make the GID restore checks more robust by checking
Feb 26, 2007: libarchive 2.0b15 released
Feb 26, 2007: Don't lose symlinks when extracting from ISOs.
- Thanks to Diego "Flameeyes" Pettenò for telling me about the
+ Thanks to Diego "Flameeyes" Pettenò for telling me about the
broken testcase on Gentoo that (finally!) led me to the cause
of this long-standing bug.
diff --git a/archivers/libarchive/files/README b/archivers/libarchive/files/README
index 50a9d628f30..03e47e85497 100644
--- a/archivers/libarchive/files/README
+++ b/archivers/libarchive/files/README
@@ -1,7 +1,11 @@
README for libarchive bundle.
-This distribution bundle includes the following components:
+Questions? Issues?
+ * http://libarchive.googlecode.com/ is the home for ongoing
+ libarchive development, including issue tracker, additional
+ documentation, and links to the libarchive mailing lists.
+This distribution bundle includes the following components:
* libarchive: a library for reading and writing streaming archives
* tar: the 'bsdtar' program is a full-featured 'tar'
replacement built on libarchive
@@ -20,38 +24,41 @@ The top-level directory contains the following information files:
* INSTALL - installation instructions
* README - this file
* configure - configuration script, see INSTALL for details.
+ * CMakeLists.txt - input for "cmake" build tool, see INSTALL
The following files in the top-level directory are used by the
'configure' script:
-
* Makefile.am, aclocal.m4, configure.ac
- used to build this distribution, only needed by maintainers
* Makefile.in, config.h.in
- templates used by configure script
- * config.aux/* - auxiliary scripts used by build system
Guide to Documentation installed by this system:
* bsdtar.1 explains the use of the bsdtar program
* bsdcpio.1 explains the use of the bsdcpio program
* libarchive.3 gives an overview of the library as a whole
- * archive_read.3, archive_write.3, and archive_write_disk.3 provide
- detailed calling sequences for the read and write APIs
+ * archive_read.3, archive_write.3, archive_write_disk.3, and
+ archive_read_disk.3 provide detailed calling sequences for the read
+ and write APIs
* archive_entry.3 details the "struct archive_entry" utility class
* archive_internals.3 provides some insight into libarchive's
internal structure and operation.
* libarchive-formats.5 documents the file formats supported by the library
- * cpio.5, mtree.5, and tar.5 provide detailed information about a
- variety of different archive formats, including hard-to-find details
- about modern cpio and tar variants.
+ * cpio.5, mtree.5, and tar.5 provide detailed information about these
+ popular archive formats, including hard-to-find details about
+ modern cpio and tar variants.
+The manual pages above are provided in the 'doc' directory in
+a number of different formats.
-You should also read the copious comments in "archive.h" and the source
-code for the sample "bsdtar" program for more details. Please let me know
-about any errors or omissions you find.
+You should also read the copious comments in "archive.h" and the
+source code for the sample programs for more details. Please let me
+know about any errors or omissions you find.
Currently, the library automatically detects and reads the following:
* gzip compression
* bzip2 compression
* compress/LZW compression
+ * lzma and xz compression
* GNU tar format (including GNU long filenames, long link names, and
sparse files)
* Solaris 9 extended tar format (including ACLs)
@@ -60,8 +67,9 @@ Currently, the library automatically detects and reads the following:
* POSIX pax interchange format
* POSIX octet-oriented cpio
* SVR4 ASCII cpio
+ * POSIX octet-oriented cpio
* Binary cpio (big-endian or little-endian)
- * ISO9660 CD-ROM images (with optional Rockridge extensions)
+ * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
* ZIP archives (with uncompressed or "deflate" compressed entries)
* GNU and BSD 'ar' archives
* 'mtree' format
@@ -70,6 +78,7 @@ The library can write:
* gzip compression
* bzip2 compression
* compress/LZW compression
+ * lzma and xz compression
* POSIX ustar
* POSIX pax interchange format
* "restricted" pax format, which will create ustar archives except for
@@ -77,19 +86,20 @@ The library can write:
* POSIX octet-oriented cpio
* SVR4 "newc" cpio
* shar archives
+ * ZIP archives (with uncompressed or "deflate" compressed entries)
* GNU and BSD 'ar' archives
+ * 'mtree' format
Notes about the library architecture:
* This is a heavily stream-oriented system. There is no direct
- support for in-place modification or random access and no intention
- of ever adding such support. Adding such support would require
- sacrificing a lot of other features, so don't bother asking.
+ support for in-place modification or random access.
* The library is designed to be extended with new compression and
archive formats. The only requirement is that the format be
readable or writable as a stream and that each archive entry be
- independent.
+ independent. There are articles on the libarchive Wiki explaining
+ how to extend libarchive.
* On read, compression and format are always detected automatically.
@@ -103,7 +113,7 @@ Notes about the library architecture:
environments where that matters.
* On read, the library accepts whatever blocks you hand it.
- Your read callback is free to pass the library a byte at a time[1]
+ Your read callback is free to pass the library a byte at a time
or mmap the entire archive and give it to the library at once.
On write, the library always produces correctly-blocked output.
@@ -125,11 +135,3 @@ Notes about the library architecture:
* Note: "pax interchange format" is really an extended tar format,
despite what the name says.
-
-[1] Gzip and compress formats are identical in the first byte.
-For that reason, the first block must be at least two bytes if
-you have both of these formats enabled at read time. This is
-currently the only restriction on block size. (This restriction
-could be lifted by buffering the initial blocks prior to the
-compression tasting step, but it doesn't really seem worth the
-effort.)
diff --git a/archivers/libarchive/files/aclocal.m4 b/archivers/libarchive/files/aclocal.m4
index 0d4f6fd10d6..0cffd9cf73f 100644
--- a/archivers/libarchive/files/aclocal.m4
+++ b/archivers/libarchive/files/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,740 +11,858 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf. If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.62],,
+[m4_warning([this file was generated for autoconf 2.62.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
+# This file is part of GNU Libtool.
#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
])
-# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
-# serial 8
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+_LT_SETUP
-# serial 9
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-# _AM_DEPENDENCIES(NAME)
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
+_LT_CHECK_OBJDIR
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ ;;
+esac
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-])
+# Global variables:
+ofile=libtool
+can_build_shared=yes
-# Generate code to set up dependency tracking. -*- Autoconf -*-
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+with_gnu_ld="$lt_cv_prog_gnu_ld"
-#serial 3
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+ ;;
+esac
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
-# AM_OUTPUT_DEPENDENCY_COMMANDS
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
])
-# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-# serial 12
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
])
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
-# serial 2
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 48 AC_PROG_LIBTOOL
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
+_LT_OUTPUT_LIBTOOL_INIT
+])
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
+Usage: $[0] [[OPTIONS]]
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+Report bugs to <bug-libtool@gnu.org>."
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
-# Constants:
-rm="rm -f"
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+ lt_cl_success=:
+ test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+ exec AS_MESSAGE_LOG_FD>/dev/null
+ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+ exec AS_MESSAGE_LOG_FD>>config.log
+ $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
-if test -n "$RANLIB"; then
case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-_LT_CC_BASENAME([$compiler])
+ _LT_PROG_LTMAIN
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
+ _LT_PROG_XSI_SHELLFNS
-AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
-AC_ARG_WITH([pic],
- [AC_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
@@ -753,35 +871,20 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
+])# _LT_TAG_COMPILER
# _LT_COMPILER_BOILERPLATE
# ------------------------
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
])# _LT_COMPILER_BOILERPLATE
@@ -789,70 +892,203 @@ $rm conftest*
# ----------------------
# Check for linker boilerplate output or warnings with
# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
+])# _LT_SYS_MODULE_PATH_AIX
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
[ifdef([AC_DIVERSION_NOTICE],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
$1
AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
+])# _LT_SHELL_INIT
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
-case X$ECHO in
+case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
;;
esac
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
if test "X[$]1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X[$]1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
:
else
# Restart under the correct shell.
@@ -862,9 +1098,9 @@ fi
if test "X[$]1" = X--fallback-echo; then
# used as fallback echo
shift
- cat <<EOF
+ cat <<_LT_EOF
[$]*
-EOF
+_LT_EOF
exit 0
fi
@@ -872,124 +1108,127 @@ fi
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
else
- # maybe with a smaller string...
- prev=:
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
fi
fi
fi
fi
-fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
[AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
@@ -1000,12 +1239,12 @@ ia64-*-hpux*)
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
esac
fi
rm -rf conftest*
@@ -1014,72 +1253,79 @@ ia64-*-hpux*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
fi
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
esac
fi
rm -rf conftest*
@@ -1091,7 +1337,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_LANG_PUSH(C)
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_POP])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
@@ -1106,38 +1352,75 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
fi
rm -rf conftest*
;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
esac
need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
-])# _LT_AC_LOCK
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
# ----------------------------------------------------------------
# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -1156,40 +1439,47 @@ AC_CACHE_CHECK([$1], [$2],
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
fi
- $rm conftest*
+ $RM conftest*
])
if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
+ m4_if([$5], , :, [$5])
else
- ifelse([$6], , :, [$6])
+ m4_if([$6], , :, [$6])
fi
-])# AC_LIBTOOL_COMPILER_OPTION
+])# _LT_COMPILER_OPTION
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
@@ -1198,22 +1488,28 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
$2=yes
fi
fi
- $rm conftest*
+ $RM -r conftest*
LDFLAGS="$save_LDFLAGS"
])
if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
+ m4_if([$4], , :, [$4])
else
- ifelse([$5], , :, [$5])
+ m4_if([$5], , :, [$5])
fi
-])# AC_LIBTOOL_LINKER_OPTION
+])# _LT_LINKER_OPTION
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0
@@ -1235,7 +1531,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw*)
+ cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -1290,30 +1586,41 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
])
@@ -1322,27 +1629,35 @@ if test -n $lt_cv_sys_max_cmd_len ; then
else
AC_MSG_RESULT(none)
fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
if test "$cross_compiling" = yes; then :
[$4]
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
+ cat > conftest.$ac_ext <<_LT_EOF
[#line __oline__ "configure"
#include "confdefs.h"
@@ -1384,10 +1699,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -1403,9 +1714,9 @@ int main ()
else
puts (dlerror ());
- exit (status);
+ return status;
}]
-EOF
+_LT_EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
lt_status=$?
@@ -1420,13 +1731,13 @@ EOF
fi
fi
rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
+])# _LT_TRY_DLOPEN_SELF
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
@@ -1442,15 +1753,15 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32*)
+ mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
- ;;
+ ;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
- ;;
+ ;;
darwin*)
# if libdl is installed we need to link against it
@@ -1460,13 +1771,13 @@ else
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
])
- ;;
+ ;;
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
@@ -1474,7 +1785,7 @@ else
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
@@ -1502,7 +1813,7 @@ else
AC_CACHE_CHECK([whether a program can dlopen itself],
lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
+ _LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
@@ -1510,8 +1821,8 @@ else
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
])
@@ -1533,22 +1844,36 @@ else
*) enable_dlopen_self_static=unknown ;;
esac
fi
-])# AC_LIBTOOL_DLOPEN_SELF
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -1568,37 +1893,41 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
fi
fi
chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $rm conftest*
+ $RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
cd ..
- rmdir conftest
- $rm conftest*
+ $RM -r conftest
+ $RM conftest*
])
-])# AC_LIBTOOL_PROG_CC_C_O
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
AC_MSG_CHECKING([if we can lock with hard links])
hard_links=yes
- $rm conftest*
+ $RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
@@ -1611,12 +1940,13 @@ if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks"
else
need_locks=no
fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
[rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
@@ -1628,40 +1958,46 @@ else
fi
rmdir .libs 2>/dev/null])
objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
- # We can hardcode non-existant directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
# Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ _LT_TAGVAR(hardcode_action, $1)=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ _LT_TAGVAR(hardcode_action, $1)=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
@@ -1669,43 +2005,107 @@ elif test "$shlibpath_overrides_runpath" = yes ||
# Fast installation is not necessary
enable_fast_install=needless
fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
;;
esac
fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# _LT_SYS_DYNAMIC_LINKER([TAG])
# -----------------------------
# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -1719,20 +2119,6 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -1750,7 +2136,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1769,7 +2155,7 @@ aix4* | aix5*)
aix4 | aix4.[[01]] | aix4.[[01]].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -1795,9 +2181,18 @@ aix4* | aix5*)
;;
amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
;;
beos*)
@@ -1820,25 +2215,28 @@ bsdi[[45]]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
- $rm \$dlpath'
+ $RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
@@ -1847,20 +2245,20 @@ cygwin* | mingw* | pw32*)
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
- mingw*)
+ mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
# It is most probably a Windows format PATH printed by
# mingw gcc, but we are running on Cygwin. Gcc prints its search
# path with ; separators, and with drive letters. We can handle the
# drive letters (cygwin fileutils understands them), so leave them,
# especially as we might pass files found there to a mingw objdump,
# which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
;;
pw32*)
@@ -1884,17 +2282,13 @@ darwin* | rhapsody*)
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -1911,18 +2305,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -1960,7 +2342,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -1999,18 +2381,18 @@ hpux9* | hpux10* | hpux11*)
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
@@ -2023,7 +2405,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -2078,7 +2460,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -2087,6 +2469,17 @@ linux*)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
@@ -2094,7 +2487,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -2107,23 +2500,11 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
@@ -2144,14 +2525,16 @@ newsos6)
shlibpath_overrides_runpath=yes
;;
-nto-qnx*)
- version_type=linux
+*nto* | *qnx*)
+ version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
;;
openbsd*)
@@ -2160,13 +2543,13 @@ openbsd*)
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[[89]] | openbsd2.[[89]].*)
shlibpath_overrides_runpath=no
@@ -2200,6 +2583,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -2234,7 +2621,6 @@ sysv4 | sysv4.3*)
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
@@ -2265,13 +2651,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -2281,6 +2666,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
sys_lib_dlsearch_path_spec='/usr/lib'
;;
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2299,276 +2695,54 @@ variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
- [include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name \"$tagname\" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-# AC_LIBTOOL_PICMODE([MODE])
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
@@ -2581,7 +2755,7 @@ AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
@@ -2596,7 +2770,7 @@ dnl not every word. This closes a longstanding sh security hole.
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -2607,7 +2781,7 @@ dnl not every word. This closes a longstanding sh security hole.
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-EOF
+_LT_EOF
fi ;;
esac
fi
@@ -2624,37 +2798,47 @@ if test -n "$MAGIC_CMD"; then
else
AC_MSG_RESULT(no)
fi
-])# AC_PATH_TOOL_PREFIX
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
else
MAGIC_CMD=:
fi
fi
-])# AC_PATH_MAGIC
+])# _LT_PATH_MAGIC
-# AC_PROG_LD
+# LT_PATH_LD
# ----------
# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AC_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
@@ -2671,9 +2855,9 @@ if test "$GCC" = yes; then
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -2723,15 +2907,24 @@ else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
@@ -2742,14 +2935,14 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac])
with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
+])# _LT_PATH_LD_GNU
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
+# _LT_CMD_RELOAD
+# --------------
# find reload flag for linker
# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+m4_defun([_LT_CMD_RELOAD],
[AC_CACHE_CHECK([for $LD option to reload object files],
lt_cv_ld_reload_flag,
[lt_cv_ld_reload_flag='-r'])
@@ -2768,15 +2961,19 @@ case $host_os in
fi
;;
esac
-])# AC_PROG_LD_RELOAD_FLAG
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
# how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -2793,7 +2990,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[[4-9]]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2815,8 +3012,20 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
@@ -2824,8 +3033,8 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
@@ -2862,7 +3071,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
@@ -2878,12 +3087,12 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
@@ -2896,12 +3105,12 @@ newos6*)
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
;;
openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -2912,10 +3121,18 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
@@ -2943,7 +3160,7 @@ sysv4 | sysv4.3*)
esac
;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
@@ -2951,20 +3168,26 @@ esac
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
-# AC_PROG_NM
+
+# LT_PATH_NM
# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
@@ -3000,16 +3223,51 @@ else
done
IFS="$lt_save_ifs"
done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+ : ${lt_cv_path_NM=no}
fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
-# AC_CHECK_LIBM
-# -------------
+
+# LT_LIB_M
+# --------
# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
+AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
@@ -3024,2104 +3282,46 @@ case $host in
AC_CHECK_LIB(m, cos, LIBM="-lm")
;;
esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!). If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- ;;
- *)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- interix3*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
+AC_SUBST([LIBM])
+])# LT_LIB_M
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
[-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
@@ -5135,33 +3335,18 @@ symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
# Define system-specific variables.
case $host_os in
aix*)
symcode='[[BCDT]]'
;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
-hpux*) # Its linker distinguishes data from code symbols
+hpux*)
if test "$host_cpu" = ia64; then
symcode='[[ABCDEGRST]]'
fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
;;
irix* | nonstopux*)
symcode='[[BCDEGRST]]'
@@ -5186,44 +3371,72 @@ sysv4)
;;
esac
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
+# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
- cat > conftest.$ac_ext <<EOF
+ cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
+_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
@@ -5237,48 +3450,50 @@ EOF
fi
# Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
-EOF
+_LT_EOF
# Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+ cat <<_LT_EOF >> conftest.$ac_ext
-/* The mapping between symbol names and symbols. */
+/* The mapping between symbol names and symbols. */
const struct {
const char *name;
- lt_ptr_t address;
+ void *address;
}
-lt_preloaded_symbols[[]] =
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
};
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
#ifdef __cplusplus
}
#endif
-EOF
+_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_save_LIBS="$LIBS"
lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
@@ -5297,7 +3512,7 @@ EOF
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -5315,141 +3530,162 @@ if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; the
else
AC_MSG_RESULT(ok)
fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
+m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
+
amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
sysv4*MP*)
if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
case $host_cpu in
- hppa*64*|ia64*)
+ hppa*64*)
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
chorus*)
case $cc_basename in
cxch68*)
# Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
;;
esac
;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
dgux*)
case $cc_basename in
ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
ghcx*)
# Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
fi
;;
aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
;;
@@ -5464,41 +3700,62 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
irix5* | irix6* | nonstopux*)
case $cc_basename in
CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
# CC pic flag -KPIC is the default.
;;
*)
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
- pgCC*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
cxx*)
# Compaq C++
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -5509,7 +3766,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
mvs*)
case $cc_basename in
cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
;;
*)
;;
@@ -5517,22 +3774,27 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
netbsd*)
;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
;;
RCC*)
# Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
cxx*)
# Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
;;
@@ -5544,13 +3806,13 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
case $cc_basename in
CC*)
# Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
gcx*)
# Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
;;
*)
;;
@@ -5560,82 +3822,107 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
case $cc_basename in
CC*)
# Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
lcc*)
# Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
*)
;;
esac
;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
vxworks*)
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
],
[
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -5643,64 +3930,48 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
enable_shared=no
;;
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
sysv4*MP*)
if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
case $host_cpu in
@@ -5708,210 +3979,274 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# +Z the default
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
esac
;;
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
case $cc_basename in
f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
esac
;;
sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4*MP*)
if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
;;
esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
#
# Check to make sure the static flag actually works.
#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ cygwin* | mingw* | cegcc*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
-],[
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
+ _LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
+
case $host_os in
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -5928,7 +4263,7 @@ ifelse([$1],[CXX],[
;;
esac
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
if test "$with_gnu_ld" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
@@ -5937,16 +4272,16 @@ ifelse([$1],[CXX],[
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
+ case `$LD -v 2>&1` in
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -5956,11 +4291,11 @@ ifelse([$1],[CXX],[
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
@@ -5968,49 +4303,50 @@ ifelse([$1],[CXX],[
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
-EOF
+_LT_EOF
fi
;;
amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
;;
beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
@@ -6018,70 +4354,109 @@ EOF
fi~
$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
- interix3*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
tmp_addflag=
+ tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
@@ -6090,19 +4465,19 @@ EOF
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
@@ -6115,58 +4490,62 @@ EOF
_LT_EOF
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
fi
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -6176,22 +4555,22 @@ _LT_EOF
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
done
;;
esac
@@ -6206,30 +4585,32 @@ _LT_EOF
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ # We have reworked collect2
+ :
else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
fi
;;
esac
@@ -6240,8 +4621,8 @@ _LT_EOF
else
# not using gcc
if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
@@ -6252,130 +4633,94 @@ _LT_EOF
fi
fi
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
# Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
;;
bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
+ _LT_DARWIN_LINKER_FEATURES($1)
;;
dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
@@ -6383,60 +4728,60 @@ _LT_EOF
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
hpux9*)
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
fi
;;
@@ -6444,45 +4789,45 @@ _LT_EOF
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
fi
@@ -6490,191 +4835,221 @@ _LT_EOF
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
;;
openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
+ _LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
;;
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4)
case $host_vendor in
sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
;;
motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
;;
sysv4*MP*)
if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -6685,50 +5060,65 @@ _LT_EOF
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
fi
])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
#
# Do we need to explicitly link libc?
#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
x|xyes)
# Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ case $_LT_TAGVAR(archive_cmds, $1) in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
@@ -6737,119 +5127,1924 @@ x|xyes)
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ $RM conftest*
+ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
;;
esac
fi
;;
esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=echo
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
])
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
])
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
# macro and use it instead. #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
+
+m4_defun([AC_PROG_SED],
[AC_MSG_CHECKING([for a sed that does not truncate output])
AC_CACHE_VAL(lt_cv_path_SED,
[# Loop through the user's path and test for sed and gsed.
@@ -6867,6 +7062,7 @@ do
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6899,8 +7095,1387 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done
])
SED=$lt_cv_path_SED
+AC_SUBST([SED])
AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]+=\$[2]"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+ ;;
+ esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3017 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+m4_define([LT_PACKAGE_REVISION], [1.3017])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6b'
+macro_revision='1.3017'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
@@ -7171,7 +8746,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
@@ -7271,3 +8846,5 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+m4_include([build/autoconf/check_stdcall_func.m4])
+m4_include([build/autoconf/la_uid_t.m4])
diff --git a/archivers/libarchive/files/build/autoconf/check_stdcall_func.m4 b/archivers/libarchive/files/build/autoconf/check_stdcall_func.m4
new file mode 100644
index 00000000000..926b046c533
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/check_stdcall_func.m4
@@ -0,0 +1,51 @@
+# AC_LANG_STDCALL_FUNC_LINK_TRY(FUNCTION, SIGNATURE)
+# -------------------------------
+# Produce a source which links correctly iff the FUNCTION exists.
+AC_DEFUN([AC_LANG_STDCALL_FUNC_LINK_TRY],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# AC_CHECK_STDCALL_FUNC(FUNCTION, SIGNATURE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------------------------
+AC_DEFUN([AC_CHECK_STDCALL_FUNC],
+[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
+AC_CACHE_CHECK([for $1], ac_var,
+[AC_LINK_IFELSE([AC_LANG_STDCALL_FUNC_LINK_TRY([$1],[$2])],
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
+AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
+
+# AC_LANG_STDCALL_FUNC_LINK_TRY(C)(FUNCTION, SIGNATURE)
+# ----------------------------------
+# Don't include <ctype.h> because on OSF/1 3.0 it includes
+# <sys/types.h> which includes <sys/select.h> which contains a
+# prototype for select. Similarly for bzero.
+m4_define([AC_LANG_STDCALL_FUNC_LINK_TRY(C)],
+[AC_LANG_PROGRAM(
+[/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char __stdcall $1 ( $2 ) below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char __stdcall $1 ( $2 );
+char (*f) ( $2 );
+],
+[/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$1) || defined (__stub___$1)
+choke me
+#else
+f = $1;
+#endif
+])])
+
+# AC_LANG_STDCALL_FUNC_LINK_TRY(C++)(FUNCTION)
+# ------------------------------------
+m4_copy([AC_LANG_STDCALL_FUNC_LINK_TRY(C)], [AC_LANG_STDCALL_FUNC_LINK_TRY(C++)])
+
diff --git a/archivers/libarchive/files/build/autoconf/compile b/archivers/libarchive/files/build/autoconf/compile
new file mode 100755
index 00000000000..1b1d2321695
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/archivers/libarchive/files/build/autoconf/config.guess b/archivers/libarchive/files/build/autoconf/config.guess
new file mode 100755
index 00000000000..0e30d56e94e
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/config.guess
@@ -0,0 +1,1407 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-07-02'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/FreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/archivers/libarchive/files/build/autoconf/config.sub b/archivers/libarchive/files/build/autoconf/config.sub
new file mode 100755
index 00000000000..9d7f7339054
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/config.sub
@@ -0,0 +1,1504 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-07-04'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/archivers/libarchive/files/build/autoconf/depcomp b/archivers/libarchive/files/build/autoconf/depcomp
new file mode 100755
index 00000000000..e5f9736c723
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/depcomp
@@ -0,0 +1,589 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2007-03-29.01
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/archivers/libarchive/files/build/autoconf/install-sh b/archivers/libarchive/files/build/autoconf/install-sh
new file mode 100755
index 00000000000..a5897de6ea7
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/install-sh
@@ -0,0 +1,519 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-12-25.00
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/archivers/libarchive/files/build/autoconf/la_uid_t.m4 b/archivers/libarchive/files/build/autoconf/la_uid_t.m4
new file mode 100644
index 00000000000..31eef5e96fc
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/la_uid_t.m4
@@ -0,0 +1,20 @@
+# la_TYPE_UID_T
+# -------------
+AC_DEFUN([la_TYPE_UID_T],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK(for uid_t in sys/types.h, la_cv_type_uid_t,
+[AC_EGREP_HEADER(uid_t, sys/types.h,
+ la_cv_type_uid_t=yes, la_cv_type_uid_t=no)])
+if test $la_cv_type_uid_t = no; then
+ case $host in
+ *mingw*) def_uid_t=short ;;
+ *) def_uid_t=int ;;
+ esac
+ AC_DEFINE_UNQUOTED(uid_t, [$def_uid_t],
+ [Define to match typeof st_uid field of struct stat if <sys/types.h> doesn't define.])
+ AC_DEFINE_UNQUOTED(gid_t, [$def_uid_t],
+ [Define to match typeof st_gid field of struct stat if <sys/types.h> doesn't define.])
+fi
+])
+AU_ALIAS([AC_TYPE_UID_T], [la_TYPE_UID_T])
+
diff --git a/archivers/libarchive/files/build/autoconf/ltmain.sh b/archivers/libarchive/files/build/autoconf/ltmain.sh
new file mode 100755
index 00000000000..fb6640c90b6
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/ltmain.sh
@@ -0,0 +1,8457 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6b
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print informational messages (default)
+# --version print version information
+# -h, --help print short or long help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.2.6b
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6b
+TIMESTAMP=""
+package_revision=1.3017
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+ -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "X$my_tmpdir" | $Xsed
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "X$1" | $Xsed \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $SED -n '/^# Usage:/,/# -h/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ $ECHO
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ func_error "missing argument for $1"
+ exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ $ECHO "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $ECHO "enable shared libraries"
+ else
+ $ECHO "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $ECHO "enable static libraries"
+ else
+ $ECHO "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# Parse options once, thoroughly. This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Parse non-mode specific arguments:
+ while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --config) func_config ;;
+
+ --debug) preserve_args="$preserve_args $opt"
+ func_echo "enabling shell trace mode"
+ opt_debug='set -x'
+ $opt_debug
+ ;;
+
+ -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ execute_dlfiles="$execute_dlfiles $1"
+ shift
+ ;;
+
+ --dry-run | -n) opt_dry_run=: ;;
+ --features) func_features ;;
+ --finish) mode="finish" ;;
+
+ --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ case $1 in
+ # Valid mode arguments:
+ clean) ;;
+ compile) ;;
+ execute) ;;
+ finish) ;;
+ install) ;;
+ link) ;;
+ relink) ;;
+ uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+
+ mode="$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_duplicate_deps=: ;;
+
+ --quiet|--silent) preserve_args="$preserve_args $opt"
+ opt_silent=:
+ ;;
+
+ --verbose| -v) preserve_args="$preserve_args $opt"
+ opt_silent=false
+ ;;
+
+ --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ preserve_args="$preserve_args $opt $1"
+ func_enable_tag "$1" # tagname is set here
+ shift
+ ;;
+
+ # Separate optargs to long options:
+ -dlopen=*|--mode=*|--tag=*)
+ func_opt_split "$opt"
+ set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) opt_help=: ;;
+ --version) func_version ;;
+
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+
+ *) nonopt="$opt"
+ break
+ ;;
+ esac
+ done
+
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+ ;;
+ esac
+
+ # Having warned about all mis-specified options, bail out if
+ # anything was wrong.
+ $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+$opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_ltwrapper_scriptname_result=""
+ if func_ltwrapper_executable_p "$1"; then
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+
+ # FreeBSD-specific: where we install compilers with non-standard names
+ tag_compilers_CC="*cc cc* *gcc gcc*"
+ tag_compilers_CXX="*c++ c++* *g++ g++*"
+ base_compiler=`set -- "$@"; echo $1`
+
+ # If $tagname isn't set, then try to infer if the default "CC" tag applies
+ if test -z "$tagname"; then
+ for zp in $tag_compilers_CC; do
+ case $base_compiler in
+ $zp) tagname="CC"; break;;
+ esac
+ done
+ fi
+
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+
+ # FreeBSD-specific: try compilers based on inferred tag
+ if test -z "$tagname"; then
+ eval "tag_compilers=\$tag_compilers_${z}"
+ if test -n "$tag_compilers"; then
+ for zp in $tag_compilers; do
+ case $base_compiler in
+ $zp) tagname=$z; break;;
+ esac
+ done
+ if test -n "$tagname"; then
+ break
+ fi
+ fi
+ fi
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ pie_flag="$pie_flag $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$arg"
+ lastarg="$lastarg $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_quote_for_eval "$lastarg"
+ base_compile="$base_compile $func_quote_for_eval_result"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ removelist="$removelist $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ removelist="$removelist $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$mode'"
+ ;;
+ esac
+
+ $ECHO
+ $ECHO "Try \`$progname --help' for more information about other modes."
+
+ exit $?
+}
+
+ # Now that we've collected a possible --mode arg, show help if necessary
+ $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_quote_for_eval "$file"
+ args="$args $func_quote_for_eval_result"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ $ECHO "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ $ECHO "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ $ECHO
+ $ECHO "If you ever happen to want to link against installed libraries"
+ $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+ $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $ECHO "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $ECHO " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
+ $ECHO " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $ECHO
+
+ $ECHO "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ $ECHO "pages."
+ ;;
+ *)
+ $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog$func_quote_for_eval_result"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_verbose "extracting global C symbols from \`$progfile'"
+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs. */"
+ lt_dlsym_const= ;;
+ *osf5*)
+ echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+ lt_dlsym_const= ;;
+ *)
+ lt_dlsym_const=const ;;
+ esac
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) symtab_cflags="$symtab_cflags $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *-*-freebsd*)
+ # FreeBSD doesn't need this...
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+ func_emit_wrapper_part1_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part1_arg1=$1
+ fi
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ ECHO=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$ECHO will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $ECHO "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+ func_emit_wrapper_part2_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part2_arg1=$1
+ fi
+
+ $ECHO "\
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_arg1=$1
+ fi
+
+ # split this up so that func_emit_cwrapperexe_src
+ # can call each part independently.
+ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin. Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+ func_to_host_path_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ case $build in
+ *mingw* ) # actually, msys
+ # awkward: cmd appends spaces to result
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_path_tmp1=`cygpath -w "$1"`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # Unfortunately, winepath does not exit with a non-zero
+ # error code, so we are forced to check the contents of
+ # stdout. On the other hand, if the command is not
+ # found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both
+ # error code of zero AND non-empty stdout, which explains
+ # the odd construction:
+ func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ # Allow warning below.
+ func_to_host_path_result=""
+ fi
+ ;;
+ esac
+ if test -z "$func_to_host_path_result" ; then
+ func_error "Could not determine host path corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_path_result="$1"
+ fi
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+ func_to_host_pathlist_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_to_host_pathlist_tmp2="$1"
+ # Once set for this call, this variable should not be
+ # reassigned. It is used in tha fallback case.
+ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e 's|^:*||' -e 's|:*$||'`
+ case $build in
+ *mingw* ) # Actually, msys.
+ # Awkward: cmd appends spaces to result.
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # unfortunately, winepath doesn't convert pathlists
+ func_to_host_pathlist_result=""
+ func_to_host_pathlist_oldIFS=$IFS
+ IFS=:
+ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+ IFS=$func_to_host_pathlist_oldIFS
+ if test -n "$func_to_host_pathlist_f" ; then
+ func_to_host_path "$func_to_host_pathlist_f"
+ if test -n "$func_to_host_path_result" ; then
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_to_host_pathlist_result="$func_to_host_path_result"
+ else
+ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+ fi
+ fi
+ fi
+ IFS=:
+ done
+ IFS=$func_to_host_pathlist_oldIFS
+ ;;
+ esac
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_error "Could not determine the host path(s) corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This may break if $1 contains DOS-style drive
+ # specifications. The fix is not to complicate the expression
+ # below, but for the user to provide a working wine installation
+ # with winepath so that path translation in the cross-to-mingw
+ # case works properly.
+ lt_replace_pathsep_nix_to_dos="s|:|;|g"
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_replace_pathsep_nix_to_dos"`
+ fi
+ # Now, add the leading and trailing path separators back
+ case "$1" in
+ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+ ;;
+ esac
+ case "$1" in
+ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "$SHELL $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# define HAVE_SETENV
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+ func_emit_wrapper_part1 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+ cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+ func_emit_wrapper_part2 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+
+ cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_pathlist "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_pathlist "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+ /* very simple arg parsing; don't want to rely on getopt */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ printf ("%s", script_text_part1);
+ printf ("%s", script_text_part2);
+ return 0;
+ }
+ }
+
+ newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal ("Couldn't find %s", argv[0]);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+ tmp_pathspec));
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+ actual_cwrapper_path));
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+ target_name));
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+ {
+ if (argv[i][env_set_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_set_opt_len + 1;
+ lt_opt_process_env_set (p);
+ }
+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_set (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_set_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+ {
+ if (argv[i][env_prepend_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_prepend_opt_len + 1;
+ lt_opt_process_env_prepend (p);
+ }
+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_prepend_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+ {
+ if (argv[i][env_append_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_append_opt_len + 1;
+ lt_opt_process_env_append (p);
+ }
+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_append (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_append_opt);
+ continue;
+ }
+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ for (i = 0; i < newargc; i++)
+ {
+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
+ wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+ tmp_pathspec));
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ char *errstr = strerror (errno);
+ lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal ("Could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+ const char *p;
+ int len;
+ if (!arg || !*arg)
+ return 1;
+
+ p = strchr (arg, (int)'=');
+
+ if (!p)
+ return 1;
+
+ *value = xstrdup (++p);
+
+ len = strlen (arg) - strlen (*value);
+ *name = XMALLOC (char, len);
+ strncpy (*name, arg, len-1);
+ (*name)[len - 1] = '\0';
+
+ return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+ }
+
+ lt_setenv (name, value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 1);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ weak_libs="$weak_libs $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname '-L' '' "$arg"
+ dir=$func_stripname_result
+ if test -z "$dir"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ esac
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+ linker_flags="$linker_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_duplicate_deps ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ case $lib in
+ *.la) func_source "$lib" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) deplibs="$deplibs $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ fi
+
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ ;;
+ *)
+ ;;
+ esac # linkmode
+
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ dir=$func_stripname_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $ECHO
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because the file extensions .$libext of this argument makes me believe"
+ $ECHO "*** that it is just a static archive that I should not use here."
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) temp_rpath="$temp_rpath$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ $ECHO
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $ECHO
+ $ECHO "*** And there doesn't seem to be a static archive available"
+ $ECHO "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $ECHO
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $ECHO "*** But as you try to build a module library, libtool will still create "
+ $ECHO "*** a static module, that should work as long as the dlopening application"
+ $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_dirname "$deplib" "" "."
+ dir="$func_dirname_result"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ libobjs="$libobjs $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+ # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which I believe you do not have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+ $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+ $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ $ECHO "*** make it link in! You will probably need to install it or some"
+ $ECHO "*** library that it depends on before this library will be fully"
+ $ECHO "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+ done
+ fi
+ if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
+ $GREP . >/dev/null; then
+ $ECHO
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $ECHO "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $ECHO
+ $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ $ECHO "*** a static module, that should work as long as the dlopening"
+ $ECHO "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $ECHO "*** The inter-library dependencies that have been dropped here will be"
+ $ECHO "*** automatically added whenever a program is linked with this library"
+ $ECHO "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $ECHO
+ $ECHO "*** Since this library must not contain undefined symbols,"
+ $ECHO "*** because either the platform does not support them or"
+ $ECHO "*** it was explicitly requested with -no-undefined,"
+ $ECHO "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ delfiles="$delfiles $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ func_len " $cmd"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ $ECHO 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ $ECHO "$obj" >> $output
+ done
+ $ECHO ')' >> $output
+ delfiles="$delfiles $output"
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ $ECHO "$obj" >> $output
+ done
+ delfiles="$delfiles $output"
+ output=$firstobj\"$file_list_spec$output\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ delfiles="$delfiles $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *cegcc)
+ # Disable wrappers for cegcc, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $ECHO for shipping.
+ if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ oldobjs="$oldobjs $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $ECHO "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlfiles="$newdlfiles $libdir/$name"
+ ;;
+ *) newdlfiles="$newdlfiles $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) RM="$RM $arg"; rmforce=yes ;;
+ -*) RM="$RM $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/archivers/libarchive/files/build/autoconf/missing b/archivers/libarchive/files/build/autoconf/missing
new file mode 100755
index 00000000000..1c8ff7049d8
--- /dev/null
+++ b/archivers/libarchive/files/build/autoconf/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/archivers/libarchive/files/build/autogen.sh b/archivers/libarchive/files/build/autogen.sh
new file mode 100755
index 00000000000..8a9c9deb96c
--- /dev/null
+++ b/archivers/libarchive/files/build/autogen.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+PATH=/usr/local/gnu-autotools/bin/:$PATH
+export PATH
+
+# Start from one level above the build directory
+if [ -f version ]; then
+ cd ..
+fi
+
+if [ \! -f build/version ]; then
+ echo "Can't find source directory"
+ exit 1
+fi
+
+# BSD make's "OBJDIR" support freaks out the automake-generated
+# Makefile. Effectively disable it.
+export MAKEOBJDIRPREFIX=/junk
+
+# Start from the build directory, where the version file is located
+if [ -f build/version ]; then
+ cd build
+fi
+
+if [ \! -f version ]; then
+ echo "Can't find version file"
+ exit 1
+fi
+
+# Update the build number in the 'version' file.
+# Separate number from additional alpha/beta/etc marker
+MARKER=`cat version | sed 's/[0-9.]//g'`
+# Bump the number
+VN=`cat version | sed 's/[^0-9.]//g'`
+# Build out the string.
+VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
+
+cd ..
+
+# Clean up the source dir as much as we can.
+/bin/sh build/clean.sh
+
+# Substitute the integer version into Libarchive's archive.h
+perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h
+perl -p -i -e "s/^(#define\tARCHIVE_VERSION_STRING).*/\$1 \"libarchive $VS\"/" libarchive/archive.h
+# Substitute versions into configure.ac as well
+perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
+perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
+
+set -xe
+aclocal -I build/autoconf
+
+# Note: --automake flag needed only for libtoolize from
+# libtool 1.5.x; in libtool 2.2.x it is a synonym for --quiet
+case `uname` in
+Darwin) glibtoolize --automake -c;;
+*) libtoolize --automake -c;;
+esac
+autoconf
+autoheader
+automake -a -c
+
+./configure
+make distcheck
diff --git a/archivers/libarchive/files/build/bump-version.sh b/archivers/libarchive/files/build/bump-version.sh
new file mode 100644
index 00000000000..0304cf3fb32
--- /dev/null
+++ b/archivers/libarchive/files/build/bump-version.sh
@@ -0,0 +1,36 @@
+#!/bin/sh +v
+
+# Start from the build directory, where the version file is located
+if [ -f build/version ]; then
+ cd build
+fi
+
+if [ \! -f version ]; then
+ echo "Can't find version file"
+ exit 1
+fi
+
+# Update the build number in the 'version' file.
+# Separate number from additional alpha/beta/etc marker
+MARKER=`cat version | sed 's/[0-9.]//g'`
+# Bump the number
+VN=`cat version | sed 's/[^0-9.]//g'`
+# Reassemble and write back out
+VN=$(($VN + 1))
+rm -f version.old
+mv version version.old
+chmod +w version.old
+echo $VN$MARKER > version
+VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
+cd ..
+
+ANNOUNCE=`date +"%b %d, %Y:"`" libarchive $VS released"
+
+echo $ANNOUNCE
+
+# Add a version notice to NEWS
+mv NEWS NEWS.bak
+chmod +w NEWS.bak
+echo > NEWS
+echo $ANNOUNCE >> NEWS
+cat NEWS.bak >> NEWS
diff --git a/archivers/libarchive/files/build/clean.sh b/archivers/libarchive/files/build/clean.sh
new file mode 100644
index 00000000000..5b4c5624a60
--- /dev/null
+++ b/archivers/libarchive/files/build/clean.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+if [ \! -f build/version ]; then
+ echo 'Must run the clean script from the top-level dir of the libarchive distribution' 1>&2
+ exit 1
+fi
+
+#
+# The automake-generated 'maintainer-clean' target does clean up a
+# lot. If that fails, try plain 'clean' in case we're using the cmake
+# or other makefile. But don't worry if we can't...
+#
+make maintainer-clean || make clean || true
+
+# If we're on BSD, blow away the build dir under /usr/obj
+rm -rf /usr/obj`pwd`
+
+#
+# Try to clean up a bit more...
+#
+
+find . -name '*.So' | xargs rm
+find . -name '*.a' | xargs rm
+find . -name '*.la' | xargs rm
+find . -name '*.lo' | xargs rm
+find . -name '*.o' | xargs rm
+find . -name '*.orig' | xargs rm
+find . -name '*.po' | xargs rm
+find . -name '*.rej' | xargs rm
+find . -name '*~' | xargs rm
+find . -name '.depend' | xargs rm
+find . -name '.deps' | xargs rm -rf
+find . -name '.dirstamp' | xargs rm
+find . -name '.libs' | xargs rm -rf
+
+rm -rf autom4te.cache
+
+rm -f Makefile.in
+rm -f aclocal.m4
+rm -f bsdcpio
+rm -f bsdcpio_test
+rm -f bsdtar
+rm -f bsdtar_test
+rm -f build/autoconf/compile
+rm -f build/autoconf/config.*
+rm -f build/autoconf/depcomp
+rm -f build/autoconf/install-sh
+rm -f build/autoconf/libtool.m4
+rm -f build/autoconf/ltmain.sh
+rm -f build/autoconf/ltoptions.m4
+rm -f build/autoconf/ltsugar.m4
+rm -f build/autoconf/ltversion.m4
+rm -f build/autoconf/lt~obsolete.m4
+rm -f build/autoconf/missing
+rm -f build/pkgconfig/libarchive.pc
+rm -f build/version.old
+rm -f config.h
+rm -f config.h.in
+rm -f config.log
+rm -f config.status
+rm -f configure
+rm -f cpio/*.1.gz
+rm -f cpio/bsdcpio
+rm -f cpio/test/bsdcpio_test
+rm -f cpio/test/list.h
+rm -f doc/html/*
+rm -f doc/man/*
+rm -f doc/pdf/*
+rm -f doc/text/*
+rm -f doc/wiki/*
+rm -f libarchive/*.[35].gz
+rm -f libarchive/libarchive.so*
+rm -f libarchive/test/libarchive_test
+rm -f libarchive/test/list.h
+rm -f libarchive_test
+rm -f libtool
+rm -f stamp-h1
+rm -f tar/*.1.gz
+rm -f tar/bsdtar
+rm -f tar/test/bsdtar_test
+rm -f tar/test/list.h
diff --git a/archivers/libarchive/files/build/cmake/AddTest28.cmake b/archivers/libarchive/files/build/cmake/AddTest28.cmake
new file mode 100644
index 00000000000..ab26a9a9b8b
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/AddTest28.cmake
@@ -0,0 +1,107 @@
+# - Macro approximating the CMake 2.8 ADD_TEST(NAME) signature.
+# ADD_TEST_28(NAME <name> COMMAND <command> [arg1 [arg2 ...]])
+# <name> - The name of the test
+# <command> - The test executable
+# [argN...] - Arguments to the test executable
+# This macro approximates the ADD_TEST(NAME) signature provided in
+# CMake 2.8 but works with CMake 2.6 too. See CMake 2.8 documentation
+# of ADD_TEST()for details.
+#
+# This macro automatically replaces a <command> that names an
+# executable target with the target location. A generator expression
+# of the form "$<TARGET_FILE:tgt>" is supported in both the command
+# and arguments of the test. Howerver, this macro only works for
+# targets without per-config output name properties set.
+#
+# Example usage:
+# add_test(NAME mytest COMMAND testDriver --exe $<TARGET_FILE:myexe>)
+# This creates a test "mytest" whose command runs a testDriver tool
+# passing the full path to the executable file produced by target
+# "myexe".
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer
+# in this position and unchanged.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
+
+# CMake 2.8 supports ADD_TEST(NAME) natively.
+IF(NOT "${CMAKE_VERSION}" VERSION_LESS "2.8")
+ MACRO(ADD_TEST_28)
+ ADD_TEST(${ARGV})
+ ENDMACRO()
+ RETURN()
+ENDIF()
+
+# Simulate ADD_TEST(NAME) signature from CMake 2.8.
+MACRO(ADD_TEST_28 NAME name COMMAND command)
+ # Enforce the signature.
+ IF(NOT "x${NAME}" STREQUAL "xNAME")
+ MESSAGE(FATAL_ERROR "First ADD_TEST_28 argument must be \"NAME\"")
+ ENDIF()
+ IF(NOT "x${COMMAND}" STREQUAL "xCOMMAND")
+ MESSAGE(FATAL_ERROR "Third ADD_TEST_28 argument must be \"COMMAND\"")
+ ENDIF()
+
+ # Perform "COMMAND myexe ..." substitution.
+ SET(cmd "${command}")
+ IF(TARGET "${cmd}")
+ _ADD_TEST_28_GET_EXE(${cmd} cmd)
+ ENDIF()
+
+ # Perform "COMMAND ... $<TARGET_FILE:myexe> ..." substitution.
+ SET(target_file "\\$<TARGET_FILE:(.+)>")
+ SET(args)
+ FOREACH(ARG ${cmd} ${ARGN})
+ SET(arg "${ARG}")
+ IF("${arg}" MATCHES "${target_file}")
+ STRING(REGEX REPLACE "${target_file}" "\\1" tgt "${arg}")
+ IF(TARGET "${tgt}")
+ _ADD_TEST_28_GET_EXE(${tgt} exe)
+ STRING(REGEX REPLACE "${target_file}" "${exe}" arg "${arg}")
+ ENDIF()
+ ENDIF()
+ LIST(APPEND args "${arg}")
+ ENDFOREACH()
+
+ # Invoke old ADD_TEST() signature with transformed arguments.
+ ADD_TEST(${name} ${args})
+ENDMACRO()
+
+# Get the test-time location of an executable target.
+MACRO(_ADD_TEST_28_GET_EXE tgt exe_var)
+ # The LOCATION property gives a build-time location.
+ GET_TARGET_PROPERTY(${exe_var} ${tgt} LOCATION)
+
+ # In single-configuration generatrs the build-time and test-time
+ # locations are the same because there is no per-config variable
+ # reference. In multi-configuration generators the following
+ # substitution converts the build-time configuration variable
+ # reference to a test-time configuration variable reference.
+ IF(CMAKE_CONFIGURATION_TYPES)
+ STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CTEST_CONFIGURATION_TYPE}"
+ ${exe_var} "${${exe_var}}")
+ ENDIF(CMAKE_CONFIGURATION_TYPES)
+ENDMACRO()
diff --git a/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.c b/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.c
new file mode 100644
index 00000000000..d948fecf2b4
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.c
@@ -0,0 +1,14 @@
+#include <sys/types.h>
+
+#define KB ((off_t)1024)
+#define MB ((off_t)1024 * KB)
+#define GB ((off_t)1024 * MB)
+#define TB ((off_t)1024 * GB)
+int t2[(((64 * GB -1) % 671088649) == 268434537)
+ && (((TB - (64 * GB -1) + 255) % 1792151290) == 305159546)? 1: -1];
+
+int main()
+{
+ ;
+ return 0;
+}
diff --git a/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.cmake b/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.cmake
new file mode 100644
index 00000000000..4132b387e17
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckFileOffsetBits.cmake
@@ -0,0 +1,44 @@
+# - Check if _FILE_OFFSET_BITS macro needed for large files
+# CHECK_FILE_OFFSET_BITS ()
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# Copyright (c) 2009, Michihiro NAKAJIMA
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+#INCLUDE(CheckCXXSourceCompiles)
+
+GET_FILENAME_COMPONENT(_selfdir_CheckFileOffsetBits
+ "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+MACRO (CHECK_FILE_OFFSET_BITS)
+ IF(NOT DEFINED _FILE_OFFSET_BITS)
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files")
+ TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
+ IF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
+ TRY_COMPILE(__WITH_FILE_OFFSET_BITS_64
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64)
+ ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
+
+ IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - needed")
+ ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - not needed")
+ ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ ENDIF(NOT DEFINED _FILE_OFFSET_BITS)
+
+ENDMACRO (CHECK_FILE_OFFSET_BITS)
+
diff --git a/archivers/libarchive/files/build/cmake/CheckFuncs.cmake b/archivers/libarchive/files/build/cmake/CheckFuncs.cmake
new file mode 100644
index 00000000000..0670df97f86
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckFuncs.cmake
@@ -0,0 +1,49 @@
+# Check if the system has the specified function; treat glibc "stub"
+# functions as nonexistent:
+# CHECK_FUNCTION_EXISTS_GLIBC (FUNCTION FUNCVAR)
+#
+# FUNCTION - the function(s) where the prototype should be declared
+# FUNCVAR - variable to define if the function does exist
+#
+# In particular, this understands the glibc convention of
+# defining macros __stub_XXXX or __stub___XXXX if the function
+# does appear in the library but is merely a stub that does nothing.
+# By detecting this case, we can select alternate behavior on
+# platforms that don't support this functionality.
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# Copyright (c) 2009, Michihiro NAKAJIMA
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+INCLUDE(CheckFunctionExists)
+GET_FILENAME_COMPONENT(_selfdir_CheckFunctionExistsGlibc
+ "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+MACRO (CHECK_FUNCTION_EXISTS_GLIBC _FUNC _FUNCVAR)
+ IF(NOT DEFINED ${_FUNCVAR})
+ SET(CHECK_STUB_FUNC_1 "__stub_${_FUNC}")
+ SET(CHECK_STUB_FUNC_2 "__stub___${_FUNC}")
+ CONFIGURE_FILE( ${_selfdir_CheckFunctionExistsGlibc}/CheckFuncs_stub.c.in
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake.tmp/CheckFuncs_stub.c IMMEDIATE)
+ TRY_COMPILE(__stub
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake.tmp/CheckFuncs_stub.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS
+ -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
+ "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}")
+ IF (__stub)
+ SET("${_FUNCVAR}" "" CACHE INTERNAL "Have function ${_FUNC}")
+ ELSE (__stub)
+ CHECK_FUNCTION_EXISTS("${_FUNC}" "${_FUNCVAR}")
+ ENDIF (__stub)
+ ENDIF(NOT DEFINED ${_FUNCVAR})
+ENDMACRO (CHECK_FUNCTION_EXISTS_GLIBC)
+
diff --git a/archivers/libarchive/files/build/cmake/CheckFuncs_stub.c.in b/archivers/libarchive/files/build/cmake/CheckFuncs_stub.c.in
new file mode 100644
index 00000000000..50da414b5f5
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckFuncs_stub.c.in
@@ -0,0 +1,16 @@
+#ifdef __STDC__
+#include <limits.h>
+#else
+#include <assert.h>
+#endif
+
+int
+main()
+{
+#if defined ${CHECK_STUB_FUNC_1} || defined ${CHECK_STUB_FUNC_2}
+ return 0;
+#else
+this system have stub
+ return 0;
+#endif
+}
diff --git a/archivers/libarchive/files/build/cmake/CheckHeaderDirent.cmake b/archivers/libarchive/files/build/cmake/CheckHeaderDirent.cmake
new file mode 100644
index 00000000000..e9a7ea85532
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckHeaderDirent.cmake
@@ -0,0 +1,32 @@
+# - Check if the system has the specified type
+# CHECK_HEADER_DIRENT (HEADER1 HEARDER2 ...)
+#
+# HEADER - the header(s) where the prototype should be declared
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# Copyright (c) 2009, Michihiro NAKAJIMA
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckTypeExists)
+
+MACRO (CHECK_HEADER_DIRENT)
+ CHECK_TYPE_EXISTS("DIR *" dirent.h HAVE_DIRENT_H)
+ IF(NOT HAVE_DIRENT_H)
+ CHECK_TYPE_EXISTS("DIR *" sys/ndir.h HAVE_SYS_NDIR_H)
+ IF(NOT HAVE_SYS_NDIR_H)
+ CHECK_TYPE_EXISTS("DIR *" ndir.h HAVE_NDIR_H)
+ IF(NOT HAVE_NDIR_H)
+ CHECK_TYPE_EXISTS("DIR *" sys/dir.h HAVE_SYS_DIR_H)
+ ENDIF(NOT HAVE_NDIR_H)
+ ENDIF(NOT HAVE_SYS_NDIR_H)
+ ENDIF(NOT HAVE_DIRENT_H)
+ENDMACRO (CHECK_HEADER_DIRENT)
+
diff --git a/archivers/libarchive/files/build/cmake/CheckStructMember.cmake b/archivers/libarchive/files/build/cmake/CheckStructMember.cmake
new file mode 100644
index 00000000000..05ddb3a11f2
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckStructMember.cmake
@@ -0,0 +1,43 @@
+# - Check if the given struct or class has the specified member variable
+# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
+#
+# STRUCT - the name of the struct or class you are interested in
+# MEMBER - the member which existence you want to check
+# HEADER - the header(s) where the prototype should be declared
+# VARIABLE - variable to store the result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckCSourceCompiles)
+
+MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
+ SET(_INCLUDE_FILES)
+ FOREACH (it ${_HEADER})
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ ENDFOREACH (it)
+
+ SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
+${_INCLUDE_FILES}
+int main()
+{
+ static ${_STRUCT} tmp;
+ if (sizeof(tmp.${_MEMBER}))
+ return 0;
+ return 0;
+}
+")
+ CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
+
+ENDMACRO (CHECK_STRUCT_MEMBER)
+
diff --git a/archivers/libarchive/files/build/cmake/CheckTypeExists.cmake b/archivers/libarchive/files/build/cmake/CheckTypeExists.cmake
new file mode 100644
index 00000000000..b05234fd875
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/CheckTypeExists.cmake
@@ -0,0 +1,42 @@
+# - Check if the system has the specified type
+# CHECK_TYPE_EXISTS (TYPE HEADER VARIABLE)
+#
+# TYPE - the name of the type or struct or class you are interested in
+# HEADER - the header(s) where the prototype should be declared
+# VARIABLE - variable to store the result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# Copyright (c) 2009, Michihiro NAKAJIMA
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckCSourceCompiles)
+
+MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT)
+ SET(_INCLUDE_FILES)
+ FOREACH (it ${_HEADER})
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ ENDFOREACH (it)
+
+ SET(_CHECK_TYPE_EXISTS_SOURCE_CODE "
+${_INCLUDE_FILES}
+int main()
+{
+ static ${_TYPE} tmp;
+ if (sizeof(tmp))
+ return 0;
+ return 0;
+}
+")
+ CHECK_C_SOURCE_COMPILES("${_CHECK_TYPE_EXISTS_SOURCE_CODE}" ${_RESULT})
+
+ENDMACRO (CHECK_TYPE_EXISTS)
+
diff --git a/archivers/libarchive/files/build/cmake/FindLZMA.cmake b/archivers/libarchive/files/build/cmake/FindLZMA.cmake
new file mode 100644
index 00000000000..1d065c4abcc
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/FindLZMA.cmake
@@ -0,0 +1,52 @@
+# - Find lzma and lzmadec
+# Find the native LZMA includes and library
+#
+# LZMA_INCLUDE_DIR - where to find lzma.h, etc.
+# LZMA_LIBRARIES - List of libraries when using liblzma.
+# LZMA_FOUND - True if liblzma found.
+# LZMADEC_INCLUDE_DIR - where to find lzmadec.h, etc.
+# LZMADEC_LIBRARIES - List of libraries when using liblzmadec.
+# LZMADEC_FOUND - True if liblzmadec found.
+
+IF (LZMA_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(LZMA_FIND_QUIETLY TRUE)
+ENDIF (LZMA_INCLUDE_DIR)
+
+FIND_PATH(LZMA_INCLUDE_DIR lzma.h)
+FIND_LIBRARY(LZMA_LIBRARY NAMES lzma )
+
+# handle the QUIETLY and REQUIRED arguments and set LZMA_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMA DEFAULT_MSG LZMA_LIBRARY LZMA_INCLUDE_DIR)
+
+IF(LZMA_FOUND)
+ SET( LZMA_LIBRARIES ${LZMA_LIBRARY} )
+ELSE(LZMA_FOUND)
+ SET( LZMA_LIBRARIES )
+
+ IF (LZMADEC_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(LZMADEC_FIND_QUIETLY TRUE)
+ ENDIF (LZMADEC_INCLUDE_DIR)
+
+ FIND_PATH(LZMADEC_INCLUDE_DIR lzmadec.h)
+ FIND_LIBRARY(LZMADEC_LIBRARY NAMES lzmadec )
+
+ # handle the QUIETLY and REQUIRED arguments and set LZMADEC_FOUND to TRUE if
+ # all listed variables are TRUE
+ INCLUDE(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMADEC DEFAULT_MSG LZMADEC_LIBRARY
+ LZMADEC_INCLUDE_DIR)
+
+ IF(LZMADEC_FOUND)
+ SET( LZMADEC_LIBRARIES ${LZMADEC_LIBRARY} )
+ ELSE(LZMADEC_FOUND)
+ SET( LZMADEC_LIBRARIES )
+ ENDIF(LZMADEC_FOUND)
+ENDIF(LZMA_FOUND)
+
+
+MARK_AS_ADVANCED( LZMA_LIBRARY LZMA_INCLUDE_DIR
+ LZMADEC_LIBRARY LZMADEC_INCLUDE_DIR )
diff --git a/archivers/libarchive/files/build/cmake/config.h.in b/archivers/libarchive/files/build/cmake/config.h.in
new file mode 100644
index 00000000000..2d2a000e400
--- /dev/null
+++ b/archivers/libarchive/files/build/cmake/config.h.in
@@ -0,0 +1,723 @@
+/* config.h. Generated from config.h.cmake by cmake configure */
+
+/* Version number of bsdcpio */
+#cmakedefine BSDCPIO_VERSION_STRING "${BSDCPIO_VERSION_STRING}"
+
+/* Version number of bsdtar */
+#cmakedefine BSDTAR_VERSION_STRING "${BSDTAR_VERSION_STRING}"
+
+/* Define to 1 if you have the `acl_create_entry' function. */
+#cmakedefine HAVE_ACL_CREATE_ENTRY 1
+
+/* Define to 1 if you have the `acl_get_link' function. */
+#cmakedefine HAVE_ACL_GET_LINK 1
+
+/* Define to 1 if you have the `acl_get_link_np' function. */
+#cmakedefine HAVE_ACL_GET_LINK_NP 1
+
+/* Define to 1 if you have the `acl_get_perm' function. */
+#cmakedefine HAVE_ACL_GET_PERM 1
+
+/* Define to 1 if you have the `acl_get_perm_np' function. */
+#cmakedefine HAVE_ACL_GET_PERM_NP 1
+
+/* Define to 1 if you have the `acl_init' function. */
+#cmakedefine HAVE_ACL_INIT 1
+
+/* Define to 1 if you have the <acl/libacl.h> header file. */
+#cmakedefine HAVE_ACL_LIBACL_H 1
+
+/* Define to 1 if the system has the type `acl_permset_t'. */
+#cmakedefine HAVE_ACL_PERMSET_T 1
+
+/* Define to 1 if you have the `acl_set_fd' function. */
+#cmakedefine HAVE_ACL_SET_FD 1
+
+/* Define to 1 if you have the `acl_set_fd_np' function. */
+#cmakedefine HAVE_ACL_SET_FD_NP 1
+
+/* Define to 1 if you have the `acl_set_file' function. */
+#cmakedefine HAVE_ACL_SET_FILE 1
+
+/* True for systems with POSIX ACL support */
+#cmakedefine HAVE_ACL_USER 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 <bsdxml.h> header file. */
+#cmakedefine HAVE_BSDXML_H 1
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+#cmakedefine HAVE_BZLIB_H 1
+
+/* Define to 1 if you have the `chflags' function. */
+#cmakedefine HAVE_CHFLAGS 1
+
+/* Define to 1 if you have the `chown' function. */
+#cmakedefine HAVE_CHOWN 1
+
+/* Define to 1 if you have the `chroot' function. */
+#cmakedefine HAVE_CHROOT 1
+
+/* Define to 1 if you have the `CreateHardLinkA' function. */
+#cmakedefine HAVE_CREATEHARDLINKA 1
+
+/* Define to 1 if you have the `CreateHardLinkW' function. */
+#cmakedefine HAVE_CREATEHARDLINKW 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#cmakedefine HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the `cygwin_conv_path' function. */
+#cmakedefine HAVE_CYGWIN_CONV_PATH 1
+
+/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_INT64_MAX 1
+
+/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_INT64_MIN 1
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_OPTARG 1
+
+/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_OPTIND 1
+
+/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_SIZE_MAX 1
+
+/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_SSIZE_MAX 1
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_STRERROR_R 1
+
+/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_UINT32_MAX 1
+
+/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_UINT64_MAX 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+#cmakedefine HAVE_DIRECT_H 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#cmakedefine HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H 1
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#cmakedefine HAVE_DOPRNT 1
+
+/* Define to 1 if nl_langinfo supports D_MD_ORDER */
+#cmakedefine HAVE_D_MD_ORDER 1
+
+/* A possible errno value for invalid file format errors */
+#cmakedefine HAVE_EFTYPE 1
+
+/* A possible errno value for invalid file format errors */
+#cmakedefine HAVE_EILSEQ 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#cmakedefine HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <expat.h> header file. */
+#cmakedefine HAVE_EXPAT_H 1
+
+/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
+#cmakedefine HAVE_EXT2FS_EXT2_FS_H 1
+
+/* Define to 1 if you have the `extattr_get_file' function. */
+#cmakedefine HAVE_EXTATTR_GET_FILE 1
+
+/* Define to 1 if you have the `extattr_list_file' function. */
+#cmakedefine HAVE_EXTATTR_LIST_FILE 1
+
+/* Define to 1 if you have the `extattr_set_fd' function. */
+#cmakedefine HAVE_EXTATTR_SET_FD 1
+
+/* Define to 1 if you have the `extattr_set_file' function. */
+#cmakedefine HAVE_EXTATTR_SET_FILE 1
+
+/* Define to 1 if you have the `fchdir' function. */
+#cmakedefine HAVE_FCHDIR 1
+
+/* Define to 1 if you have the `fchflags' function. */
+#cmakedefine HAVE_FCHFLAGS 1
+
+/* Define to 1 if you have the `fchmod' function. */
+#cmakedefine HAVE_FCHMOD 1
+
+/* Define to 1 if you have the `fchown' function. */
+#cmakedefine HAVE_FCHOWN 1
+
+/* Define to 1 if you have the `fcntl' function. */
+#cmakedefine HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#cmakedefine HAVE_FORK 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#cmakedefine HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `fsetxattr' function. */
+#cmakedefine HAVE_FSETXATTR 1
+
+/* Define to 1 if you have the `fstat' function. */
+#cmakedefine HAVE_FSTAT 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#cmakedefine HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `futimens' function. */
+#cmakedefine HAVE_FUTIMENS 1
+
+/* Define to 1 if you have the `futimes' function. */
+#cmakedefine HAVE_FUTIMES 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#cmakedefine HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getpid' function. */
+#cmakedefine HAVE_GETPID 1
+
+/* Define to 1 if you have the `getxattr' function. */
+#cmakedefine HAVE_GETXATTR 1
+
+/* Define to 1 if you have the <grp.h> header file. */
+#cmakedefine HAVE_GRP_H 1
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#cmakedefine HAVE_INTMAX_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+#cmakedefine HAVE_IO_H 1
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#cmakedefine HAVE_LANGINFO_H 1
+
+/* Define to 1 if you have the `lchflags' function. */
+#cmakedefine HAVE_LCHFLAGS 1
+
+/* Define to 1 if you have the `lchmod' function. */
+#cmakedefine HAVE_LCHMOD 1
+
+/* Define to 1 if you have the `lchown' function. */
+#cmakedefine HAVE_LCHOWN 1
+
+/* Define to 1 if you have the `lgetxattr' function. */
+#cmakedefine HAVE_LGETXATTR 1
+
+/* Define to 1 if you have the `acl' library (-lacl). */
+#cmakedefine HAVE_LIBACL 1
+
+/* Define to 1 if you have the `attr' library (-lattr). */
+#cmakedefine HAVE_LIBATTR 1
+
+/* Define to 1 if you have the `bsdxml' library (-lbsdxml). */
+#cmakedefine HAVE_LIBBSDXML 1
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+#cmakedefine HAVE_LIBBZ2 1
+
+/* Define to 1 if you have the `expat' library (-lexpat). */
+#cmakedefine HAVE_LIBEXPAT 1
+
+/* Define to 1 if you have the `lzma' library (-llzma). */
+#cmakedefine HAVE_LIBLZMA 1
+
+/* Define to 1 if you have the `lzmadec' library (-llzmadec). */
+#cmakedefine HAVE_LIBLZMADEC 1
+
+/* Define to 1 if you have the `xml2' library (-lxml2). */
+#cmakedefine HAVE_LIBXML2 1
+
+/* Define to 1 if you have the <libxml/xmlreader.h> header file. */
+#cmakedefine HAVE_LIBXML_XMLREADER_H 1
+
+/* Define to 1 if you have the `z' library (-lz). */
+#cmakedefine HAVE_LIBZ 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#cmakedefine HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the link() function. */
+#cmakedefine HAVE_LINK 1
+
+/* Define to 1 if you have the <linux/fs.h> header file. */
+#cmakedefine HAVE_LINUX_FS_H 1
+
+/* Define to 1 if you have the `listxattr' function. */
+#cmakedefine HAVE_LISTXATTR 1
+
+/* Define to 1 if you have the `llistxattr' function. */
+#cmakedefine HAVE_LLISTXATTR 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#cmakedefine HAVE_LOCALE_H 1
+
+/* Define to 1 if the system has the type `long long int'. */
+#cmakedefine HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `lsetxattr' function. */
+#cmakedefine HAVE_LSETXATTR 1
+
+/* Define to 1 if you have the `lstat' function. */
+#cmakedefine HAVE_LSTAT 1
+
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#cmakedefine HAVE_LSTAT_EMPTY_STRING_BUG 1
+
+/* Define to 1 if you have the `lutimes' function. */
+#cmakedefine HAVE_LUTIMES 1
+
+/* Define to 1 if you have the <lzmadec.h> header file. */
+#cmakedefine HAVE_LZMADEC_H 1
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#cmakedefine HAVE_LZMA_H 1
+
+/* Define to 1 if you have the `MD5Init' function. */
+#cmakedefine HAVE_MD5INIT 1
+
+/* Define to 1 if you have the <md5.h> header file. */
+#cmakedefine HAVE_MD5_H 1
+
+/* Define to 1 if you have the `memmove' function. */
+#cmakedefine HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#cmakedefine HAVE_MKDIR 1
+
+/* Define to 1 if you have the `mkfifo' function. */
+#cmakedefine HAVE_MKFIFO 1
+
+/* Define to 1 if you have the `mknod' function. */
+#cmakedefine HAVE_MKNOD 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#cmakedefine HAVE_NDIR_H 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#cmakedefine HAVE_NL_LANGINFO 1
+
+/* Define to 1 if you have the <openssl/md5.h> header file. */
+#cmakedefine HAVE_OPENSSL_MD5_H 1
+
+/* Define to 1 if you have the <openssl/ripemd.h> header file. */
+#cmakedefine HAVE_OPENSSL_RIPEMD_H 1
+
+/* Define to 1 if you have the <openssl/sha.h> header file. */
+#cmakedefine HAVE_OPENSSL_SHA_H 1
+
+/* Define to 1 if your openssl has the `SHA256_Init' function. */
+#cmakedefine HAVE_OPENSSL_SHA256_INIT 1
+
+/* Define to 1 if your openssl has the `SHA384_Init' function. */
+#cmakedefine HAVE_OPENSSL_SHA384_INIT 1
+
+/* Define to 1 if your openssl has the `SHA512_Init' function. */
+#cmakedefine HAVE_OPENSSL_SHA512_INIT 1
+
+/* Define to 1 if you have the <paths.h> header file. */
+#cmakedefine HAVE_PATHS_H 1
+
+/* Define to 1 if you have the `pipe' function. */
+#cmakedefine HAVE_PIPE 1
+
+/* Define to 1 if you have the `poll' function. */
+#cmakedefine HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#cmakedefine HAVE_POLL_H 1
+
+/* Define to 1 if you have the <process.h> header file. */
+#cmakedefine HAVE_PROCESS_H 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#cmakedefine HAVE_PWD_H 1
+
+/* Define to 1 if you have the `readlink' function. */
+#cmakedefine HAVE_READLINK 1
+
+/* Define to 1 if you have the <regex.h> header file. */
+#cmakedefine HAVE_REGEX_H 1
+
+/* Define to 1 if you have the <ripemd.h> header file. */
+#cmakedefine HAVE_RIPEMD_H 1
+
+/* Define to 1 if you have the `RIPEMD160Init' function. */
+#cmakedefine HAVE_RMD160INIT 1
+
+/* Define to 1 if you have the <rmd160.h> header file. */
+#cmakedefine HAVE_RMD160_H 1
+
+/* Define to 1 if you have the `select' function. */
+#cmakedefine HAVE_SELECT 1
+
+/* Define to 1 if you have the `setenv' function. */
+#cmakedefine HAVE_SETENV 1
+
+/* Define to 1 if you have the `setlocale' function. */
+#cmakedefine HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `SHA1Init' function. */
+#cmakedefine HAVE_SHA1INIT 1
+
+/* Define to 1 if you have the `SHA1_Init' function. */
+#cmakedefine HAVE_SHA1_INIT 1
+
+/* Define to 1 if you have the <sha1.h> header file. */
+#cmakedefine HAVE_SHA1_H 1
+
+/* Define to 1 if you have the `SHA256Init' function. */
+#cmakedefine HAVE_SHA256INIT 1
+
+/* Define to 1 if you have the `SHA256_Init' function. */
+#cmakedefine HAVE_SHA256_INIT 1
+
+/* Define to 1 if you have the <sha256.h> header file. */
+#cmakedefine HAVE_SHA256_H 1
+
+/* Define to 1 if you have the <sha2.h> header file. */
+#cmakedefine HAVE_SHA2_H 1
+
+/* Define to 1 if you have the `SHA384Init' function. */
+#cmakedefine HAVE_SHA384INIT 1
+
+/* Define to 1 if you have the `SHA384_Init' function. */
+#cmakedefine HAVE_SHA384_INIT 1
+
+/* Define to 1 if you have the `SHA512Init' function. */
+#cmakedefine HAVE_SHA512INIT 1
+
+/* Define to 1 if you have the `SHA512_Init' function. */
+#cmakedefine HAVE_SHA512_INIT 1
+
+/* Define to 1 if you have the <sha.h> header file. */
+#cmakedefine HAVE_SHA_H 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#cmakedefine HAVE_SIGNAL_H 1
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#cmakedefine HAVE_STAT_EMPTY_STRING_BUG 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#cmakedefine HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#cmakedefine HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#cmakedefine HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#cmakedefine HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+#cmakedefine HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the `strftime' function. */
+#cmakedefine HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#cmakedefine HAVE_STRRCHR 1
+
+/* Define to 1 if `st_birthtime' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_BLKSIZE 1
+
+/* Define to 1 if `st_flags' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_FLAGS 1
+
+/* Define to 1 if `st_mtimespec.tv_nsec' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
+
+/* Define to 1 if `st_mtime_n' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIME_N 1
+
+/* Define to 1 if `st_mtime_usec' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIME_USEC 1
+
+/* Define to 1 if `st_mtim.tv_nsec' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+
+/* Define to 1 if `st_umtime' is member of `struct stat'. */
+#cmakedefine HAVE_STRUCT_STAT_ST_UMTIME 1
+
+/* Define to 1 if you have the symlink() function. */
+#cmakedefine HAVE_SYMLINK 1
+
+/* Define to 1 if you have the <sys/acl.h> header file. */
+#cmakedefine HAVE_SYS_ACL_H 1
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#cmakedefine HAVE_SYS_CDEFS_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#cmakedefine HAVE_SYS_DIR_H 1
+
+/* Define to 1 if you have the <sys/extattr.h> header file. */
+#cmakedefine HAVE_SYS_EXTATTR_H 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#cmakedefine HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+#cmakedefine HAVE_SYS_MKDEV_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#cmakedefine HAVE_SYS_NDIR_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#cmakedefine HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#cmakedefine HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#cmakedefine HAVE_SYS_UTIME_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#cmakedefine HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+#cmakedefine HAVE_SYS_XATTR_H 1
+
+/* Define to 1 if you have the `timegm' function. */
+#cmakedefine HAVE_TIMEGM 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#cmakedefine HAVE_TIME_H 1
+
+/* Define to 1 if you have the `tzset' function. */
+#cmakedefine HAVE_TZSET 1
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#cmakedefine HAVE_UINTMAX_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unsetenv' function. */
+#cmakedefine HAVE_UNSETENV 1
+
+/* Define to 1 if the system has the type `unsigned long long'. */
+#cmakedefine HAVE_UNSIGNED_LONG_LONG 1
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `utime' function. */
+#cmakedefine HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimensat' function. */
+#cmakedefine HAVE_UTIMENSAT 1
+
+/* Define to 1 if you have the `utimes' function. */
+#cmakedefine HAVE_UTIMES 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#cmakedefine HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vfork' function. */
+#cmakedefine HAVE_VFORK 1
+
+/* Define to 1 if you have the `vprintf' function. */
+#cmakedefine HAVE_VPRINTF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#cmakedefine HAVE_WCHAR_H 1
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#cmakedefine HAVE_WCHAR_T 1
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#cmakedefine HAVE_WCRTOMB 1
+
+/* Define to 1 if you have the `wcscpy' function. */
+#cmakedefine HAVE_WCSCPY 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#cmakedefine HAVE_WCSLEN 1
+
+/* Define to 1 if you have the `wctomb' function. */
+#cmakedefine HAVE_WCTOMB 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#cmakedefine HAVE_WCTYPE_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+#cmakedefine HAVE_WINDOWS_H 1
+
+/* Define to 1 if you have _CrtSetReportMode in <crtdbg.h> */
+#cmakedefine HAVE__CrtSetReportMode 1
+
+/* Define to 1 if you have the `wmemcmp' function. */
+#cmakedefine HAVE_WMEMCMP 1
+
+/* Define to 1 if you have the `wmemcpy' function. */
+#cmakedefine HAVE_WMEMCPY 1
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#cmakedefine HAVE_ZLIB_H 1
+
+/* Version number of libarchive as a single integer */
+#cmakedefine LIBARCHIVE_VERSION_NUMBER "${LIBARCHIVE_VERSION_NUMBER}"
+
+/* Version number of libarchive */
+#cmakedefine LIBARCHIVE_VERSION_STRING "${LIBARCHIVE_VERSION_STRING}"
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+#cmakedefine LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+#cmakedefine MAJOR_IN_MKDEV 1
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+#cmakedefine MAJOR_IN_SYSMACROS 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#cmakedefine NO_MINUS_C_MINUS_O 1
+
+/* The size of `wchar_t', as computed by sizeof. */
+#cmakedefine SIZEOF_WCHAR_T ${SIZEOF_WCHAR_T}
+
+/* Define to 1 if strerror_r returns char *. */
+#cmakedefine STRERROR_R_CHAR_P 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#cmakedefine TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#cmakedefine VERSION "${VERSION}"
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS}
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#cmakedefine _LARGEFILE_SOURCE 1
+
+/* Define for large files, on AIX-style hosts. */
+#cmakedefine _LARGE_FILES ${_LARGE_FILES}
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#cmakedefine _UINT64_T
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#cmakedefine const ${const}
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#cmakedefine gid_t ${gid_t}
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#cmakedefine id_t ${id_t}
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#cmakedefine int32_t ${int32_t}
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#cmakedefine int64_t ${int64_t}
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#cmakedefine intmax_t ${intmax_t}
+
+/* Define to `int' if <sys/types.h> does not define. */
+#cmakedefine mode_t ${mode_t}
+
+/* Define to `long long' if <sys/types.h> does not define. */
+#cmakedefine off_t ${off_t}
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#cmakedefine pid_t ${pid_t}
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#cmakedefine size_t ${size_t}
+
+/* Define to `int' if <sys/types.h> does not define. */
+#cmakedefine ssize_t ${ssize_t}
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#cmakedefine uid_t ${uid_t}
+
+/* Define to `unsigned short' if <sys/types.h> doesn't define. */
+#cmakedefine uint16_t ${uint16_t}
+
+/* Define to `unsigned int' if <sys/types.h> doesn't define. */
+#cmakedefine uint32_t ${uint32_t}
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#cmakedefine uint64_t ${uint64_t}
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#cmakedefine uintmax_t ${uintmax_t}
+
+/* Define to `int' if <sys/types.h> does not define. */
+#cmakedefine intptr_t ${intptr_t}
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#cmakedefine uintptr_t ${uintptr_t}
diff --git a/archivers/libarchive/files/build/pkgconfig/libarchive.pc.in b/archivers/libarchive/files/build/pkgconfig/libarchive.pc.in
new file mode 100644
index 00000000000..5f1d6a63d03
--- /dev/null
+++ b/archivers/libarchive/files/build/pkgconfig/libarchive.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libarchive
+Description: library that can create and read several streaming archive formats
+Version: @VERSION@
+Libs: -larchive
+Libs.private: @LIBS@
diff --git a/archivers/libarchive/files/build/version b/archivers/libarchive/files/build/version
new file mode 100644
index 00000000000..c18d3a7e00f
--- /dev/null
+++ b/archivers/libarchive/files/build/version
@@ -0,0 +1 @@
+2008000
diff --git a/archivers/libarchive/files/build/windows/mvcpp.nt b/archivers/libarchive/files/build/windows/mvcpp.nt
new file mode 100644
index 00000000000..1e2d072ff08
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/mvcpp.nt
@@ -0,0 +1,141 @@
+#/* FILE: mvcpp.nt
+# *
+# * Copyright (c) 2008
+# * TouchNet Information Systems, Inc.
+# * All Rights Reserved
+# *
+# * This program is an unpublished copyright work of TouchNet Information
+# * Systems, Inc. of Lenexa, KS. The program, all information disclosed
+# * and the matter shown and described hereon or herewith are confidential
+# * and proprietary to TouchNet Information Systems, Inc.
+# *
+# ******************************************************************************
+# *
+# * $LastChangedBy: kientzle $
+# * $Locker: $
+# * $ProjectName: $
+# * $ProjectRevision: $
+# * $LastChangedRevision: 1827 $
+# * $LastChangedDate: 2010-01-16 16:21:36 -0800 (Sat, 16 Jan 2010) $
+# * $State: Exp $
+# * $RCSfile: mvcpp.nt,v $
+# * $Source: /cvsroot/pkgsrc/archivers/libarchive/files/build/windows/Attic/mvcpp.nt,v $
+# *
+# * Change Log:
+# * $Log: mvcpp.nt,v $
+# * Revision 1.1.1.1 2010/02/20 03:48:54 joerg
+# * Import libarchive 2.8.0:
+# * - Infrastructure:
+# * - Allow command line tools as fallback for missing compression
+# * libraries. If compiled without gzip for example, gunzip will
+# * be used automatically.
+# * - Improved support for a number of platforms like high-resolution
+# * timestamps and Extended Attributes on various Unix systems
+# * - New convience interface for creating archives based on disk content,
+# * complement of the archive_write_disk interface.
+# * - Frontends:
+# * - bsdcpio ready for public consumption
+# * - hand-written date parser replaces the yacc code
+# * - Filter system:
+# * - Simplified read filter chains
+# * - Option support for filters
+# * - LZMA, XZ, uudecode handled
+# * - Format support:
+# * - Write support for mtree files based on file system or archive
+# * content
+# * - Basic read support for Joliet
+# * - Write support for zip files
+# * - Write support for shar archives, both text-only and binary-safe
+# *
+# *
+# */
+
+.SUFFIXES : .c .cpp .obm
+
+ZLIB_INCL=\3rdParty\ZLib\Current\Include
+
+EXTRA_DEFINES=/DLIBARCHIVE_STATIC=1
+
+!ifdef DEBUG
+DEST_PATH=.\lib\mvcpp\debug
+OBJ_DIR=obj\debug
+COMPILE_FLAG=/MTd /DDEBUG=1 $(EXTRA_DEFINES) /Zi /Fd$(OBJ_DIR)\libarchive.pdb
+!else
+DEST_PATH=.\lib\mvcpp
+OBJ_DIR=obj
+COMPILE_FLAG=/MT $(EXTRA_DEFINES) /Fd$(OBJ_DIR)\libarchive.pdb
+!endif
+
+INCLUDE=.;$(MSDEVDIR)\INCLUDE;$(ZLIB_INCL);
+INCLUDE_OPTS=
+
+NT_CPP=cl
+NT_C=cl
+NT_LIBRARIAN=lib
+
+###
+NT_C_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TC /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS)
+NT_CPP_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TP /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS)
+NT_LIB_OPTS=
+
+.cpp{$(OBJ_DIR)}.obm:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_CPP) $(NT_CPP_OPTS) -Fo$*.obm $<
+
+.c{$(OBJ_DIR)}.obm:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_C) $(NT_C_OPTS) -Fo$*.obm $<
+
+
+OBJS=\
+ $(OBJ_DIR)\archive_check_magic.obm $(OBJ_DIR)\archive_entry.obm \
+ $(OBJ_DIR)\archive_entry_copy_stat.obm $(OBJ_DIR)\archive_entry_link_resolver.obm \
+ $(OBJ_DIR)\archive_entry_stat.obm $(OBJ_DIR)\archive_entry_strmode.obm \
+ $(OBJ_DIR)\archive_read.obm $(OBJ_DIR)\archive_read_data_into_fd.obm \
+ $(OBJ_DIR)\archive_read_extract.obm $(OBJ_DIR)\archive_read_open_fd.obm \
+ $(OBJ_DIR)\archive_read_open_file.obm $(OBJ_DIR)\archive_read_open_filename.obm \
+ $(OBJ_DIR)\archive_read_open_memory.obm $(OBJ_DIR)\archive_read_support_compression_all.obm \
+ $(OBJ_DIR)\archive_read_support_compression_bzip2.obm \
+ $(OBJ_DIR)\archive_read_support_compression_compress.obm \
+ $(OBJ_DIR)\archive_read_support_compression_gzip.obm \
+ $(OBJ_DIR)\archive_read_support_compression_none.obm \
+ $(OBJ_DIR)\archive_read_support_compression_program.obm \
+ $(OBJ_DIR)\archive_read_support_format_all.obm \
+ $(OBJ_DIR)\archive_read_support_format_ar.obm \
+ $(OBJ_DIR)\archive_read_support_format_cpio.obm \
+ $(OBJ_DIR)\archive_read_support_format_empty.obm \
+ $(OBJ_DIR)\archive_read_support_format_iso9660.obm \
+ $(OBJ_DIR)\archive_read_support_format_mtree.obm \
+ $(OBJ_DIR)\archive_read_support_format_tar.obm \
+ $(OBJ_DIR)\archive_read_support_format_zip.obm \
+ $(OBJ_DIR)\archive_string.obm $(OBJ_DIR)\archive_string_sprintf.obm \
+ $(OBJ_DIR)\archive_util.obm $(OBJ_DIR)\archive_virtual.obm \
+ $(OBJ_DIR)\archive_write.obm $(OBJ_DIR)\archive_write_disk.obm \
+ $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obm \
+ $(OBJ_DIR)\archive_write_open_fd.obm $(OBJ_DIR)\archive_write_open_file.obm \
+ $(OBJ_DIR)\archive_write_open_filename.obm $(OBJ_DIR)\archive_write_open_memory.obm \
+ $(OBJ_DIR)\archive_write_set_compression_bzip2.obm $(OBJ_DIR)\archive_write_set_compression_compress.obm \
+ $(OBJ_DIR)\archive_write_set_compression_gzip.obm $(OBJ_DIR)\archive_write_set_compression_none.obm \
+ $(OBJ_DIR)\archive_write_set_compression_program.obm $(OBJ_DIR)\archive_write_set_format.obm \
+ $(OBJ_DIR)\archive_write_set_format_ar.obm $(OBJ_DIR)\archive_write_set_format_by_name.obm \
+ $(OBJ_DIR)\archive_write_set_format_cpio.obm $(OBJ_DIR)\archive_write_set_format_cpio_newc.obm \
+ $(OBJ_DIR)\archive_write_set_format_pax.obm $(OBJ_DIR)\archive_write_set_format_shar.obm \
+ $(OBJ_DIR)\archive_write_set_format_ustar.obm $(OBJ_DIR)\filter_fork.obm \
+ $(OBJ_DIR)\libarchive-nonposix.obm
+
+all: CLEAN $(DEST_PATH)\libarchive.lib
+
+$(DEST_PATH)\libarchive.lib :: $(OBJS) $(DEST_PATH)
+
+$(DEST_PATH)\libarchive.lib ::
+ $(NT_LIBRARIAN) $(NT_LIB_OPTS) /OUT:$(DEST_PATH)\libarchive.lib $(OBJS)
+
+$(DEST_PATH):
+ -md $(DEST_PATH) > nul 2>nul
+
+CLEAN:
+!ifdef CLEAN
+ -del $(OBJ_DIR)\*.pd? > nul 2>nul
+ -ren $(OBJ_DIR)\*.pdb *.pd1 > nul 2>nul
+ -ren $(OBJ_DIR)\*.pdb *.pd2 > nul 2>nul
+!endif
diff --git a/archivers/libarchive/files/build/windows/vc71/libarchive.sln b/archivers/libarchive/files/build/windows/vc71/libarchive.sln
new file mode 100644
index 00000000000..aa73e659ed0
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc71/libarchive.sln
@@ -0,0 +1,23 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug.ActiveCfg = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug.Build.0 = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release.ActiveCfg = Release|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/archivers/libarchive/files/build/windows/vc71/libarchive.vcproj b/archivers/libarchive/files/build/windows/vc71/libarchive.vcproj
new file mode 100644
index 00000000000..31505faa0e4
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc71/libarchive.vcproj
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="libarchive"
+ ProjectGUID="{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc71-mt-d.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc71-mt.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\libarchive\archive_check_magic.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_copy_stat.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_link_resolver.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_stat.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_strmode.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_data_into_fd.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_extract.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_fd.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_file.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_filename.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_memory.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_all.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_bzip2.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_compress.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_gzip.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_lzma.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_none.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_program.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_all.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_ar.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_cpio.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_empty.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_iso9660.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_mtree.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_tar.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_zip.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string_sprintf.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_util.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_virtual.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_set_standard_lookup.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_fd.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_file.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_filename.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_memory.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_bzip2.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_compress.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_gzip.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_none.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_program.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ar.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_by_name.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio_newc.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_mtree.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_pax.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_shar.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ustar.c">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath="..\..\libarchive\archive.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_endian.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_platform.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_private.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\config_windows.h">
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/archivers/libarchive/files/build/windows/vc80/libarchive.sln b/archivers/libarchive/files/build/windows/vc80/libarchive.sln
new file mode 100644
index 00000000000..f1d4331ec4f
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc80/libarchive.sln
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive_test", "libarchive_test\libarchive_test.vcproj", "{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.Build.0 = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.ActiveCfg = Release|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.Build.0 = Release|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.Build.0 = Debug|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.ActiveCfg = Release|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/archivers/libarchive/files/build/windows/vc80/libarchive.vcproj b/archivers/libarchive/files/build/windows/vc80/libarchive.vcproj
new file mode 100644
index 00000000000..376af77bd4e
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc80/libarchive.vcproj
@@ -0,0 +1,455 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="libarchive"
+ ProjectGUID="{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ RootNamespace="libarchive"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;;LIBARCHIVE_STATIC"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc80-mt-d.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;;LIBARCHIVE_STATIC"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc80-mt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\libarchive\archive_check_magic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_copy_stat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_link_resolver.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_stat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_strmode.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_data_into_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_extract.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_all.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_lzma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_none.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_all.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_iso9660.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string_sprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_virtual.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_set_standard_lookup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_none.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_by_name.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio_newc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_shar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ustar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\libarchive\archive.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_endian.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\config_windows.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/archivers/libarchive/files/build/windows/vc80/libarchive_test/libarchive_test.vcproj b/archivers/libarchive/files/build/windows/vc80/libarchive_test/libarchive_test.vcproj
new file mode 100644
index 00000000000..02a2a8fb136
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc80/libarchive_test/libarchive_test.vcproj
@@ -0,0 +1,495 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="libarchive_test"
+ ProjectGUID="{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}"
+ RootNamespace="libarchive_test"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\libarchive"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LIBARCHIVE_STATIC"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ CompileAs="1"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ ShowProgress="0"
+ OutputFile="..\..\..\$(ProjectName).exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\libarchive"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LIBARCHIVE_STATIC"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\$(ProjectName).exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\libarchive.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\libarchive\test\main.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\read_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_basic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_freebsd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_archive_api_feature.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_bad_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_gtar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_tar_hardlink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_empty_write.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_entry.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_entry_strmode.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_fuzz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_link_resolver.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_pax_filename_encoding.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_compress_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_data_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_extract.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_Z.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_odc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_svr4_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_svr4c_Z.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_lzma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_sparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_iso_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_isorr_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_pax_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tar_empty_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tbz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tgz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_pax_truncated.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_position.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_truncated.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_tar_filenames.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_tar_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_ustar_filenames.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_compress_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_hardlink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_perms.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_secure.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_times.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_newc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_odc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_shar_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar_ustar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_open_memory.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\libarchive\test\list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/archivers/libarchive/files/build/windows/vc90/libarchive.sln b/archivers/libarchive/files/build/windows/vc90/libarchive.sln
new file mode 100644
index 00000000000..c3e69c81137
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc90/libarchive.sln
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive_test", "libarchive_test\libarchive_test.vcproj", "{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.Build.0 = Debug|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.ActiveCfg = Release|Win32
+ {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.Build.0 = Release|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.Build.0 = Debug|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.ActiveCfg = Release|Win32
+ {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/archivers/libarchive/files/build/windows/vc90/libarchive.vcproj b/archivers/libarchive/files/build/windows/vc90/libarchive.vcproj
new file mode 100644
index 00000000000..6a5499eb098
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc90/libarchive.vcproj
@@ -0,0 +1,456 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libarchive"
+ ProjectGUID="{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ RootNamespace="libarchive"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc90-mt-d.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PLATFORM_CONFIG_H=&quot;\&quot;config_windows.h\&quot;&quot;"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="../../lib/$(ProjectName)-vc90-mt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\libarchive\archive_check_magic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_copy_stat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_link_resolver.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_stat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_strmode.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_data_into_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_extract.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_all.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_lzma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_none.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_compression_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_all.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_iso9660.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_support_format_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string_sprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_virtual.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_set_standard_lookup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_none.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_compression_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_by_name.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_cpio_newc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_shar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_set_format_ustar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\libarchive\archive.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_endian.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_entry_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_disk_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_read_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_windows.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_disk_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\archive_write_private.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\config_windows.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libarchive\filter_fork.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/archivers/libarchive/files/build/windows/vc90/libarchive_test/libarchive_test.vcproj b/archivers/libarchive/files/build/windows/vc90/libarchive_test/libarchive_test.vcproj
new file mode 100644
index 00000000000..5164820eb55
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/vc90/libarchive_test/libarchive_test.vcproj
@@ -0,0 +1,494 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libarchive_test"
+ ProjectGUID="{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}"
+ RootNamespace="libarchive_test"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\libarchive"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LIBARCHIVE_STATIC"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ CompileAs="1"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ ShowProgress="0"
+ OutputFile="..\..\..\$(ProjectName).exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\libarchive"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LIBARCHIVE_STATIC"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\$(ProjectName).exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{0C758FDB-BE1D-47E9-8E18-9168AB34A308}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\libarchive.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\libarchive\test\main.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\read_open_memory.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_basic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_freebsd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_acl_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_archive_api_feature.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_bad_fd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_bzip2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_gtar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_tar_hardlink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_compat_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_empty_write.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_entry.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_entry_strmode.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_fuzz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_link_resolver.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_pax_filename_encoding.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_compress_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_data_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_extract.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_bin_Z.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_odc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_svr4_gzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_cpio_svr4c_Z.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_lzma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_gtar_sparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_iso_gz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_isorr_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_mtree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_pax_bz2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tar_empty_filename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tbz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tgz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_tz.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_format_zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_pax_truncated.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_position.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_read_truncated.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_tar_filenames.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_tar_large.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_ustar_filenames.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_compress_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_hardlink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_perms.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_secure.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_disk_times.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_ar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_newc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_cpio_odc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_pax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_shar_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar_empty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_format_tar_ustar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test_write_open_memory.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\libarchive\test\list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libarchive\test\test.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/archivers/libarchive/files/build/windows/wccpp.nt b/archivers/libarchive/files/build/windows/wccpp.nt
new file mode 100644
index 00000000000..3447c0f22ba
--- /dev/null
+++ b/archivers/libarchive/files/build/windows/wccpp.nt
@@ -0,0 +1,131 @@
+#/* FILE: wccpp.nt
+# *
+# * Copyright (c) 2008
+# * TouchNet Information Systems, Inc.
+# * All Rights Reserved
+# *
+# * This program is an unpublished copyright work of TouchNet Information
+# * Systems, Inc. of Lenexa, KS. The program, all information disclosed
+# * and the matter shown and described hereon or herewith are confidential
+# * and proprietary to TouchNet Information Systems, Inc.
+# *
+# ******************************************************************************
+# *
+# * $LastChangedBy: kientzle $
+# * $Locker: $
+# * $ProjectName: $
+# * $ProjectRevision: $
+# * $LastChangedRevision: 1827 $
+# * $LastChangedDate: 2010-01-16 16:21:36 -0800 (Sat, 16 Jan 2010) $
+# * $State: Exp $
+# * $RCSfile: wccpp.nt,v $
+# * $Source: /cvsroot/pkgsrc/archivers/libarchive/files/build/windows/Attic/wccpp.nt,v $
+# *
+# * Change Log:
+# * $Log: wccpp.nt,v $
+# * Revision 1.1.1.1 2010/02/20 03:48:54 joerg
+# * Import libarchive 2.8.0:
+# * - Infrastructure:
+# * - Allow command line tools as fallback for missing compression
+# * libraries. If compiled without gzip for example, gunzip will
+# * be used automatically.
+# * - Improved support for a number of platforms like high-resolution
+# * timestamps and Extended Attributes on various Unix systems
+# * - New convience interface for creating archives based on disk content,
+# * complement of the archive_write_disk interface.
+# * - Frontends:
+# * - bsdcpio ready for public consumption
+# * - hand-written date parser replaces the yacc code
+# * - Filter system:
+# * - Simplified read filter chains
+# * - Option support for filters
+# * - LZMA, XZ, uudecode handled
+# * - Format support:
+# * - Write support for mtree files based on file system or archive
+# * content
+# * - Basic read support for Joliet
+# * - Write support for zip files
+# * - Write support for shar archives, both text-only and binary-safe
+# *
+# *
+# */
+
+.EXTENSIONS:
+.EXTENSIONS: .obn .cpp .c
+
+ZLIB_INCL=\3rdParty\ZLib\Current\Include
+
+!ifdef DEBUG
+DEST_PATH=.\lib\wccpp\debug
+OBJ_DIR=obj\debug
+EXT_COMPILE_FLAG=-d2 -DLIBARCHIVE_STATIC=1
+!else
+DEST_PATH=.\lib\wccpp
+OBJ_DIR=obj
+EXT_COMPILE_FLAG=-DLIBARCHIVE_STATIC=1
+!endif
+
+# ----- NT compiler options -----------------------------------------------
+NT_CPP=wpp386
+NT_C=wcc386
+NT_LIBRARIAN=wlib
+
+
+###
+INCLUDE_OPTS=/I.;$(%watcom)\h;$(%watcom)\h\nt;$(ZLIB_INCL);
+NT_CPP_OPTS=-ei -wx -xs -xss -xst -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN
+NT_C_OPTS=-ei -wx -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN
+NT_LIB_OPTS=
+
+.cpp{$(OBJ_DIR)}.obn:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_CPP) $(NT_CPP_OPTS) -zp1 -fo=$*.obn $<
+
+.c{$(OBJ_DIR)}.obn:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_C) $(NT_C_OPTS) -zp1 -fo=$*.obn $<
+
+OBJS = &
+ $(OBJ_DIR)\archive_check_magic.obn $(OBJ_DIR)\archive_entry.obn &
+ $(OBJ_DIR)\archive_entry_copy_stat.obn $(OBJ_DIR)\archive_entry_link_resolver.obn &
+ $(OBJ_DIR)\archive_entry_stat.obn $(OBJ_DIR)\archive_entry_strmode.obn &
+ $(OBJ_DIR)\archive_read.obn $(OBJ_DIR)\archive_read_data_into_fd.obn &
+ $(OBJ_DIR)\archive_read_extract.obn $(OBJ_DIR)\archive_read_open_fd.obn &
+ $(OBJ_DIR)\archive_read_open_file.obn $(OBJ_DIR)\archive_read_open_filename.obn &
+ $(OBJ_DIR)\archive_read_open_memory.obn $(OBJ_DIR)\archive_read_support_compression_all.obn &
+ $(OBJ_DIR)\archive_read_support_compression_bzip2.obn &
+ $(OBJ_DIR)\archive_read_support_compression_compress.obn &
+ $(OBJ_DIR)\archive_read_support_compression_gzip.obn &
+ $(OBJ_DIR)\archive_read_support_compression_none.obn &
+ $(OBJ_DIR)\archive_read_support_compression_program.obn &
+ $(OBJ_DIR)\archive_read_support_format_all.obn &
+ $(OBJ_DIR)\archive_read_support_format_ar.obn &
+ $(OBJ_DIR)\archive_read_support_format_cpio.obn &
+ $(OBJ_DIR)\archive_read_support_format_empty.obn &
+ $(OBJ_DIR)\archive_read_support_format_iso9660.obn &
+ $(OBJ_DIR)\archive_read_support_format_mtree.obn &
+ $(OBJ_DIR)\archive_read_support_format_tar.obn &
+ $(OBJ_DIR)\archive_read_support_format_zip.obn &
+ $(OBJ_DIR)\archive_string.obn $(OBJ_DIR)\archive_string_sprintf.obn &
+ $(OBJ_DIR)\archive_util.obn $(OBJ_DIR)\archive_virtual.obn &
+ $(OBJ_DIR)\archive_write.obn $(OBJ_DIR)\archive_write_disk.obn &
+ $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obn &
+ $(OBJ_DIR)\archive_write_open_fd.obn $(OBJ_DIR)\archive_write_open_file.obn &
+ $(OBJ_DIR)\archive_write_open_filename.obn $(OBJ_DIR)\archive_write_open_memory.obn &
+ $(OBJ_DIR)\archive_write_set_compression_bzip2.obn $(OBJ_DIR)\archive_write_set_compression_compress.obn &
+ $(OBJ_DIR)\archive_write_set_compression_gzip.obn $(OBJ_DIR)\archive_write_set_compression_none.obn &
+ $(OBJ_DIR)\archive_write_set_compression_program.obn $(OBJ_DIR)\archive_write_set_format.obn &
+ $(OBJ_DIR)\archive_write_set_format_ar.obn $(OBJ_DIR)\archive_write_set_format_by_name.obn &
+ $(OBJ_DIR)\archive_write_set_format_cpio.obn $(OBJ_DIR)\archive_write_set_format_cpio_newc.obn &
+ $(OBJ_DIR)\archive_write_set_format_pax.obn $(OBJ_DIR)\archive_write_set_format_shar.obn &
+ $(OBJ_DIR)\archive_write_set_format_ustar.obn $(OBJ_DIR)\filter_fork.obn &
+ $(OBJ_DIR)\libarchive-nonposix.obn
+
+$(DEST_PATH)\LibArchive.lib :: $(OBJS) $(DEST_PATH)
+
+$(DEST_PATH)\LibArchive.lib ::
+ -md $(DEST_PATH) > nul 2>nul
+ $(NT_LIBRARIAN) $@ -+ $(OBJS)
+
+$(DEST_PATH):
+ -md $(DEST_PATH) > nul 2>nul
diff --git a/archivers/libarchive/files/config.h.in b/archivers/libarchive/files/config.h.in
index 3aa2f3e837e..4ea8dc48e1f 100644
--- a/archivers/libarchive/files/config.h.in
+++ b/archivers/libarchive/files/config.h.in
@@ -9,6 +9,12 @@
/* Define to 1 if you have the `acl_create_entry' function. */
#undef HAVE_ACL_CREATE_ENTRY
+/* Define to 1 if you have the `acl_get_link' function. */
+#undef HAVE_ACL_GET_LINK
+
+/* Define to 1 if you have the `acl_get_link_np' function. */
+#undef HAVE_ACL_GET_LINK_NP
+
/* Define to 1 if you have the `acl_get_perm' function. */
#undef HAVE_ACL_GET_PERM
@@ -18,6 +24,9 @@
/* Define to 1 if you have the `acl_init' function. */
#undef HAVE_ACL_INIT
+/* Define to 1 if you have the <acl/libacl.h> header file. */
+#undef HAVE_ACL_LIBACL_H
+
/* Define to 1 if the system has the type `acl_permset_t'. */
#undef HAVE_ACL_PERMSET_T
@@ -48,6 +57,12 @@
/* Define to 1 if you have the `chroot' function. */
#undef HAVE_CHROOT
+/* Define to 1 if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
+/* Define to 1 if you have the `cygwin_conv_path' function. */
+#undef HAVE_CYGWIN_CONV_PATH
+
/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_INT64_MAX
@@ -56,18 +71,14 @@
don't. */
#undef HAVE_DECL_INT64_MIN
-/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
- */
-#undef HAVE_DECL_OPTARG
-
-/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
- */
-#undef HAVE_DECL_OPTIND
-
/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_SIZE_MAX
+/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SSIZE_MAX
+
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#undef HAVE_DECL_STRERROR_R
@@ -102,9 +113,24 @@
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
+/* Define to 1 if you have the <expat.h> header file. */
+#undef HAVE_EXPAT_H
+
/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
#undef HAVE_EXT2FS_EXT2_FS_H
+/* Define to 1 if you have the `extattr_get_file' function. */
+#undef HAVE_EXTATTR_GET_FILE
+
+/* Define to 1 if you have the `extattr_list_file' function. */
+#undef HAVE_EXTATTR_LIST_FILE
+
+/* Define to 1 if you have the `extattr_set_fd' function. */
+#undef HAVE_EXTATTR_SET_FD
+
+/* Define to 1 if you have the `extattr_set_file' function. */
+#undef HAVE_EXTATTR_SET_FILE
+
/* Define to 1 if you have the `fchdir' function. */
#undef HAVE_FCHDIR
@@ -123,12 +149,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if your system has a working POSIX `fnmatch' function. */
-#undef HAVE_FNMATCH
-
-/* Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag */
-#undef HAVE_FNM_LEADING_DIR
-
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
@@ -144,15 +164,15 @@
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
+/* Define to 1 if you have the `futimens' function. */
+#undef HAVE_FUTIMENS
+
/* Define to 1 if you have the `futimes' function. */
#undef HAVE_FUTIMES
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
-/* Define to 1 if you have the `getopt_long' function. */
-#undef HAVE_GETOPT_LONG
-
/* Define to 1 if you have the `getpid' function. */
#undef HAVE_GETPID
@@ -168,6 +188,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
/* Define to 1 if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H
@@ -192,12 +215,30 @@
/* Define to 1 if you have the `bz2' library (-lbz2). */
#undef HAVE_LIBBZ2
+/* Define to 1 if you have the `expat' library (-lexpat). */
+#undef HAVE_LIBEXPAT
+
+/* Define to 1 if you have the `lzma' library (-llzma). */
+#undef HAVE_LIBLZMA
+
+/* Define to 1 if you have the `lzmadec' library (-llzmadec). */
+#undef HAVE_LIBLZMADEC
+
+/* Define to 1 if you have the `xml2' library (-lxml2). */
+#undef HAVE_LIBXML2
+
+/* Define to 1 if you have the <libxml/xmlreader.h> header file. */
+#undef HAVE_LIBXML_XMLREADER_H
+
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define to 1 if you have the `link' function. */
+#undef HAVE_LINK
+
/* Define to 1 if you have the <linux/fs.h> header file. */
#undef HAVE_LINUX_FS_H
@@ -216,6 +257,9 @@
/* Define to 1 if you have the `lsetxattr' function. */
#undef HAVE_LSETXATTR
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
/* Define to 1 if `lstat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_LSTAT_EMPTY_STRING_BUG
@@ -223,6 +267,18 @@
/* Define to 1 if you have the `lutimes' function. */
#undef HAVE_LUTIMES
+/* Define to 1 if you have the <lzmadec.h> header file. */
+#undef HAVE_LZMADEC_H
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#undef HAVE_LZMA_H
+
+/* Define to 1 if you have the `MD5Init' function. */
+#undef HAVE_MD5INIT
+
+/* Define to 1 if you have the <md5.h> header file. */
+#undef HAVE_MD5_H
+
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
@@ -247,6 +303,24 @@
/* Define to 1 if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
+/* Define to 1 if you have the <openssl/md5.h> header file. */
+#undef HAVE_OPENSSL_MD5_H
+
+/* Define to 1 if you have the <openssl/ripemd.h> header file. */
+#undef HAVE_OPENSSL_RIPEMD_H
+
+/* Define to 1 if your openssl has the `SHA256_Init' function. */
+#undef HAVE_OPENSSL_SHA256_INIT
+
+/* Define to 1 if your openssl has the `SHA384_Init' function. */
+#undef HAVE_OPENSSL_SHA384_INIT
+
+/* Define to 1 if your openssl has the `SHA512_Init' function. */
+#undef HAVE_OPENSSL_SHA512_INIT
+
+/* Define to 1 if you have the <openssl/sha.h> header file. */
+#undef HAVE_OPENSSL_SHA_H
+
/* Define to 1 if you have the <paths.h> header file. */
#undef HAVE_PATHS_H
@@ -262,9 +336,21 @@
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
+/* Define to 1 if you have the `readlink' function. */
+#undef HAVE_READLINK
+
/* Define to 1 if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
+/* Define to 1 if you have the <ripemd.h> header file. */
+#undef HAVE_RIPEMD_H
+
+/* Define to 1 if you have the `RMD160Init' function. */
+#undef HAVE_RMD160INIT
+
+/* Define to 1 if you have the <rmd160.h> header file. */
+#undef HAVE_RMD160_H
+
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
@@ -274,6 +360,45 @@
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
+/* Define to 1 if you have the `SHA1Init' function. */
+#undef HAVE_SHA1INIT
+
+/* Define to 1 if you have the <sha1.h> header file. */
+#undef HAVE_SHA1_H
+
+/* Define to 1 if you have the `SHA256Init' function. */
+#undef HAVE_SHA256INIT
+
+/* Define to 1 if you have the <sha256.h> header file. */
+#undef HAVE_SHA256_H
+
+/* Define to 1 if you have the `SHA256_Init' function. */
+#undef HAVE_SHA256_INIT
+
+/* Define to 1 if you have the <sha2.h> header file. */
+#undef HAVE_SHA2_H
+
+/* Define to 1 if you have the `SHA384Init' function. */
+#undef HAVE_SHA384INIT
+
+/* Define to 1 if you have the `SHA384_Init' function. */
+#undef HAVE_SHA384_INIT
+
+/* Define to 1 if you have the `SHA512Init' function. */
+#undef HAVE_SHA512INIT
+
+/* Define to 1 if you have the `SHA512_Init' function. */
+#undef HAVE_SHA512_INIT
+
+/* Define to 1 if you have the <sha.h> header file. */
+#undef HAVE_SHA_H
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
@@ -308,25 +433,61 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strncpy_s' function. */
+#undef HAVE_STRNCPY_S
+
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
+/* Define to 1 if `st_birthtime' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIME
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_flags' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_FLAGS
+
/* Define to 1 if `st_mtimespec.tv_nsec' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
+/* Define to 1 if `st_mtime_n' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_MTIME_N
+
+/* Define to 1 if `st_mtime_usec' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_MTIME_USEC
+
/* Define to 1 if `st_mtim.tv_nsec' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+/* Define to 1 if `st_umtime' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_UMTIME
+
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
/* Define to 1 if you have the <sys/acl.h> header file. */
#undef HAVE_SYS_ACL_H
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
+/* Define to 1 if you have the <sys/extattr.h> header file. */
+#undef HAVE_SYS_EXTATTR_H
+
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+#undef HAVE_SYS_MKDEV_H
+
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
@@ -355,6 +516,9 @@
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+#undef HAVE_SYS_XATTR_H
+
/* Define to 1 if you have the `timegm' function. */
#undef HAVE_TIMEGM
@@ -382,6 +546,9 @@
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME
+/* Define to 1 if you have the `utimensat' function. */
+#undef HAVE_UTIMENSAT
+
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
@@ -397,6 +564,12 @@
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
+/* Define to 1 if the system has the type `wchar_t'. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#undef HAVE_WCRTOMB
+
/* Define to 1 if you have the `wcscpy' function. */
#undef HAVE_WCSCPY
@@ -406,6 +579,12 @@
/* Define to 1 if you have the `wctomb' function. */
#undef HAVE_WCTOMB
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
/* Define to 1 if you have the `wmemcmp' function. */
#undef HAVE_WMEMCMP
@@ -425,6 +604,10 @@
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
#undef MAJOR_IN_MKDEV
@@ -454,6 +637,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* The size of `wchar_t', as computed by sizeof. */
+#undef SIZEOF_WCHAR_T
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -466,6 +652,9 @@
/* Version number of package */
#undef VERSION
+/* Define to '0x0500' for Windows 2000 APIs. */
+#undef WINVER
+
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@@ -475,15 +664,51 @@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T
+/* Define to '0x0500' for Windows 2000 APIs. */
+#undef _WIN32_WINNT
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `int' if <sys/types.h> doesn't define. */
+/* Define to match typeof st_gid field of struct stat if <sys/types.h> doesn't
+ define. */
#undef gid_t
/* Define to `unsigned long' if <sys/types.h> does not define. */
@@ -506,7 +731,8 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
-/* Define to `int' if <sys/types.h> doesn't define. */
+/* Define to match typeof st_uid field of struct stat if <sys/types.h> doesn't
+ define. */
#undef uid_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
diff --git a/archivers/libarchive/files/configure b/archivers/libarchive/files/configure
index 0dca9a4ba2e..3848a668abf 100755
--- a/archivers/libarchive/files/configure
+++ b/archivers/libarchive/files/configure
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libarchive 2.5.5.
+# Generated by GNU Autoconf 2.62 for libarchive 2.8.0.
#
# Report bugs to <kientzle@freebsd.org>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
@@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
@@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
# Support unset when possible.
@@ -65,8 +93,6 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
@@ -89,7 +115,7 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
@@ -102,17 +128,10 @@ PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -160,7 +179,7 @@ else
as_have_required=no
fi
- if test $as_have_required = yes && (eval ":
+ if test $as_have_required = yes && (eval ":
(as_func_return () {
(exit \$1)
}
@@ -242,7 +261,7 @@ IFS=$as_save_IFS
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
@@ -263,7 +282,7 @@ _ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
@@ -343,10 +362,10 @@ fi
if test "x$CONFIG_SHELL" != x; then
for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
@@ -415,9 +434,10 @@ fi
test \$exitcode = 0") || {
echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
}
@@ -453,7 +473,7 @@ test \$exitcode = 0") || {
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
@@ -481,7 +501,6 @@ case `echo -n x` in
*)
ECHO_N='-n';;
esac
-
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -494,19 +513,22 @@ if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
@@ -531,10 +553,10 @@ else
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
case $1 in
- -*)set "./$1";;
+ -*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
@@ -555,22 +577,22 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
-case X$ECHO in
+case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
;;
esac
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
:
else
# Restart under the correct shell.
@@ -580,9 +602,9 @@ fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
- cat <<EOF
+ cat <<_LT_EOF
$*
-EOF
+_LT_EOF
exit 0
fi
@@ -590,121 +612,116 @@ fi
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
else
- # maybe with a smaller string...
- prev=:
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
fi
fi
fi
fi
-fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
exec 7<&0 </dev/null 6>&1
# Name of the host.
@@ -728,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libarchive'
PACKAGE_TARNAME='libarchive'
-PACKAGE_VERSION='2.5.5'
-PACKAGE_STRING='libarchive 2.5.5'
+PACKAGE_VERSION='2.8.0'
+PACKAGE_STRING='libarchive 2.8.0'
PACKAGE_BUGREPORT='kientzle@freebsd.org'
ac_unique_file="libarchive"
@@ -821,6 +838,7 @@ MAKEINFO
install_sh
STRIP
INSTALL_STRIP_PROGRAM
+MKDIR_P
mkdir_p
AWK
SET_MAKE
@@ -833,6 +851,19 @@ BSDCPIO_VERSION_STRING
BSDTAR_VERSION_STRING
LIBARCHIVE_VERSION_STRING
LIBARCHIVE_VERSION_NUMBER
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+INC_WINDOWS_FILES_TRUE
+INC_WINDOWS_FILES_FALSE
+INC_CYGWIN_FILES_TRUE
+INC_CYGWIN_FILES_FALSE
+PLATFORMCPPFLAGS
CC
CFLAGS
LDFLAGS
@@ -849,34 +880,28 @@ AMDEPBACKSLASH
CCDEPMODE
am__fastdepCC_TRUE
am__fastdepCC_FALSE
-YACC
-YFLAGS
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
+CPP
GREP
EGREP
+AS
+DLLTOOL
+OBJDUMP
+LIBTOOL
+SED
+FGREP
+LD
+DUMPBIN
+ac_ct_DUMPBIN
+NM
LN_S
-ECHO
AR
RANLIB
-CPP
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
-LIBTOOL
+lt_ECHO
+DSYMUTIL
+NMEDIT
+LIPO
+OTOOL
+OTOOL64
BUILD_BSDTAR_TRUE
BUILD_BSDTAR_FALSE
STATIC_BSDTAR_TRUE
@@ -885,9 +910,32 @@ BUILD_BSDCPIO_TRUE
BUILD_BSDCPIO_FALSE
STATIC_BSDCPIO_TRUE
STATIC_BSDCPIO_FALSE
+XML2_CONFIG
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_bsdtar
+enable_bsdcpio
+with_zlib
+with_bz2lib
+with_lzmadec
+with_lzma
+with_openssl
+with_xml2
+with_expat
+enable_xattr
+enable_acl
+enable_largefile
+'
ac_precious_vars='build_alias
host_alias
target_alias
@@ -896,20 +944,14 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-YACC
-YFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-F77
-FFLAGS'
+CPP'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -1008,13 +1050,21 @@ do
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
@@ -1027,13 +1077,21 @@ do
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1224,22 +1282,38 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
@@ -1259,7 +1333,7 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; }
;;
@@ -1268,16 +1342,16 @@ Try \`$0 --help' for more information." >&2
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
@@ -1286,22 +1360,38 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
{ (exit 1); exit 1; }; }
fi
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; }
done
@@ -1316,7 +1406,7 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
@@ -1332,10 +1422,10 @@ test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
+ { $as_echo "$as_me: error: Working directory cannot be determined" >&2
{ (exit 1); exit 1; }; }
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
{ (exit 1); exit 1; }; }
@@ -1343,12 +1433,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1375,12 +1465,12 @@ else
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
pwd)`
# When building in place, set srcdir=.
@@ -1407,7 +1497,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libarchive 2.5.5 to adapt to many kinds of systems.
+\`configure' configures libarchive 2.8.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1429,9 +1519,9 @@ Configuration:
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1441,25 +1531,25 @@ for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/libarchive]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/libarchive]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -1477,11 +1567,12 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libarchive 2.5.5:";;
+ short | recursive ) echo "Configuration of libarchive 2.8.0:";;
esac
cat <<\_ACEOF
Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
@@ -1495,10 +1586,10 @@ Optional Features:
--enable-bsdtar=static force static build of bsdtar
--enable-bsdtar=shared force dynamic build of bsdtar
--disable-bsdtar disable build of bsdtar
- --enable-bsdcpio enable build of bsdcpio
+ --enable-bsdcpio enable build of bsdcpio (default)
--enable-bsdcpio=static static build of bsdcpio
--enable-bsdcpio=shared dynamic build of bsdcpio
- --disable-bsdcpio disable build of bsdcpio (default)
+ --disable-bsdcpio disable build of bsdcpio
--disable-xattr Enable Extended Attributes support (default: check)
--disable-acl Enable ACL support (default: check)
--disable-largefile omit support for large files
@@ -1506,10 +1597,17 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
- --with-tags[=TAGS] include additional configurations [automatic]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --without-zlib Don't build support for gzip through zlib
+ --without-bz2lib Don't build support for bzip2 through bz2lib
+ --without-lzmadec Don't build support for lzma through lzmadec
+ --without-lzma Don't build support for xz through lzma
+ --without-openssl Don't build support for mtree and xar hashes through
+ openssl
+ --without-xml2 Don't build support for xar through libxml2
+ --without-expat Don't build support for xar through expat
Some influential environment variables:
CC C compiler command
@@ -1519,17 +1617,7 @@ Some influential environment variables:
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
- YACC The `Yet Another C Compiler' implementation to use. Defaults to
- the first program found out of: `bison -y', `byacc', `yacc'.
- YFLAGS The list of arguments that will be passed by default to $YACC.
- This script will default YFLAGS to the empty string to avoid a
- default value of `-d' given by some make applications.
CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1542,15 +1630,17 @@ fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1586,7 +1676,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1595,11 +1685,11 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libarchive configure 2.5.5
-generated by GNU Autoconf 2.61
+libarchive configure 2.8.0
+generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1609,8 +1699,8 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libarchive $as_me 2.5.5, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+It was created by libarchive $as_me 2.8.0, which was
+generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
@@ -1646,7 +1736,7 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
+ $as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -1681,7 +1771,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1733,11 +1823,12 @@ _ASBOX
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
@@ -1767,9 +1858,9 @@ _ASBOX
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
@@ -1784,9 +1875,9 @@ _ASBOX
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
@@ -1802,8 +1893,8 @@ _ASBOX
echo
fi
test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1845,21 +1936,24 @@ _ACEOF
# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
+ ac_site_file1=$CONFIG_SITE
elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
+ test "x$ac_site_file" = xNONE && continue
if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
@@ -1869,16 +1963,16 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -1892,29 +1986,38 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -1924,10 +2027,10 @@ echo "$as_me: current value: $ac_new_val" >&2;}
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1966,7 +2069,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Use auxiliary subscripts from this subdirectory (cleans up root)
ac_aux_dir=
-for ac_dir in config.aux "$srcdir"/config.aux; do
+for ac_dir in build/autoconf "$srcdir"/build/autoconf; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -1982,8 +2085,8 @@ for ac_dir in config.aux "$srcdir"/config.aux; do
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config.aux \"$srcdir\"/config.aux" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in config.aux \"$srcdir\"/config.aux" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build/autoconf \"$srcdir\"/build/autoconf" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in build/autoconf \"$srcdir\"/build/autoconf" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1996,6 +2099,8 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+# M4 scripts
+
# Must follow AC_CONFIG macros above...
am__api_version='1.10'
@@ -2012,11 +2117,12 @@ am__api_version='1.10'
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -2045,17 +2151,29 @@ case $as_dir/ in
# program-specific install script used by HP pwplus--don't use.
:
else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
fi
fi
done
done
;;
esac
+
done
IFS=$as_save_IFS
+rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -2068,8 +2186,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2079,8 +2197,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
@@ -2103,9 +2221,9 @@ if (
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -2116,26 +2234,23 @@ then
# Ok.
:
else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
+$as_echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
+# Double any \ or $.
# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -2146,15 +2261,15 @@ if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
@@ -2189,8 +2304,8 @@ fi
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
mkdir_p="$MKDIR_P"
case $mkdir_p in
@@ -2202,10 +2317,10 @@ for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -2218,7 +2333,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2229,22 +2344,23 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
test -n "$AWK" && break
done
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
@@ -2261,12 +2377,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
SET_MAKE=
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2285,8 +2401,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
@@ -2303,7 +2419,7 @@ fi
# Define the identity of the package.
PACKAGE='libarchive'
- VERSION='2.5.5'
+ VERSION='2.8.0'
cat >>confdefs.h <<_ACEOF
@@ -2341,10 +2457,10 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
@@ -2357,7 +2473,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2368,11 +2484,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2381,10 +2497,10 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
@@ -2397,7 +2513,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2408,11 +2524,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2420,10 +2536,10 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
@@ -2454,41 +2570,41 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
# platforms. At least on FreeBSD, libtool uses an overly complex
# convention that attempts to solve problems that most people just
# don't have and which just causes confusion for most end users.
-ARCHIVE_MAJOR=$(( 2005005 / 1000000 ))
-ARCHIVE_MINOR=$(( (2005005 / 1000) % 1000 ))
-ARCHIVE_REVISION=$(( 2005005 % 1000 ))
+ARCHIVE_MAJOR=$(( 2008000 / 1000000 ))
+ARCHIVE_MINOR=$(( (2008000 / 1000) % 1000 ))
+ARCHIVE_REVISION=$(( 2008000 % 1000 ))
ARCHIVE_LIBTOOL_MAJOR=`echo $((${ARCHIVE_MAJOR} + ${ARCHIVE_MINOR}))`
ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_LIBTOOL_MAJOR:$ARCHIVE_REVISION:$ARCHIVE_MINOR
# Stick the version numbers into config.h
cat >>confdefs.h <<\_ACEOF
-#define LIBARCHIVE_VERSION_STRING "2.5.5"
+#define LIBARCHIVE_VERSION_STRING "2.8.0"
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define LIBARCHIVE_VERSION_NUMBER "2005005"
+#define LIBARCHIVE_VERSION_NUMBER "2008000"
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define BSDCPIO_VERSION_STRING "1.0.0"
+#define BSDCPIO_VERSION_STRING "2.8.0"
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define BSDTAR_VERSION_STRING "2.5.5"
+#define BSDTAR_VERSION_STRING "2.8.0"
_ACEOF
# The shell variables here must be the same as the AC_SUBST() variables
# below, but the shell variable names apparently cannot be the same as
# the m4 macro names above. Why? Ask autoconf.
-BSDCPIO_VERSION_STRING=1.0.0
-BSDTAR_VERSION_STRING=2.5.5
-LIBARCHIVE_VERSION_STRING=2.5.5
-LIBARCHIVE_VERSION_NUMBER=2005005
+BSDCPIO_VERSION_STRING=2.8.0
+BSDTAR_VERSION_STRING=2.8.0
+LIBARCHIVE_VERSION_STRING=2.8.0
+LIBARCHIVE_VERSION_NUMBER=2008000
# Substitute the above version numbers into the various files below.
# Yes, I believe this is the fourth time we define what are essentially
@@ -2503,6 +2619,122 @@ ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files build/pkgconfig/libarchive.pc"
+
+
+# Check for host type
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+inc_windows_files=no
+inc_cygwin_files=no
+case "$host_os" in
+ *mingw* ) inc_windows_files=yes ;;
+ *cygwin*) inc_cygwin_files=yes ;;
+esac
+ if test $inc_windows_files = yes; then
+ INC_WINDOWS_FILES_TRUE=
+ INC_WINDOWS_FILES_FALSE='#'
+else
+ INC_WINDOWS_FILES_TRUE='#'
+ INC_WINDOWS_FILES_FALSE=
+fi
+
+ if test $inc_cygwin_files = yes; then
+ INC_CYGWIN_FILES_TRUE=
+ INC_CYGWIN_FILES_FALSE='#'
+else
+ INC_CYGWIN_FILES_TRUE='#'
+ INC_CYGWIN_FILES_FALSE=
+fi
+
+
+PLATFORMCPPFLAGS=
+case "$host_os" in
+ *mingw* ) PLATFORMCPPFLAGS=-D__USE_MINGW_ANSI_STDIO ;;
+esac
+
# Checks for programs.
ac_ext=c
@@ -2513,10 +2745,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2529,7 +2761,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2540,11 +2772,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2553,10 +2785,10 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2569,7 +2801,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2580,11 +2812,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -2592,10 +2824,10 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
@@ -2610,10 +2842,10 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2626,7 +2858,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2637,11 +2869,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2650,10 +2882,10 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2671,7 +2903,7 @@ do
continue
fi
ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2694,11 +2926,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2709,10 +2941,10 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2725,7 +2957,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2736,11 +2968,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2753,10 +2985,10 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2769,7 +3001,7 @@ do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2780,11 +3012,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2796,10 +3028,10 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
@@ -2811,44 +3043,48 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
@@ -2867,27 +3103,22 @@ main ()
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
@@ -2898,10 +3129,11 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
@@ -2912,7 +3144,7 @@ for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
@@ -2939,15 +3171,15 @@ else
ac_file=''
fi
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
+$as_echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }
fi
@@ -2956,8 +3188,8 @@ ac_exeext=$ac_cv_exeext
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
@@ -2966,49 +3198,51 @@ if test "$cross_compiling" != yes; then
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+ { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
+$as_echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
fi
fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
@@ -3017,31 +3251,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+ { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3064,40 +3298,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3123,20 +3358,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_compiler_gnu=no
@@ -3146,15 +3382,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
@@ -3181,20 +3421,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
CFLAGS=""
@@ -3219,20 +3460,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_c_werror_flag=$ac_save_c_werror_flag
@@ -3258,20 +3500,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -3286,8 +3529,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -3303,10 +3546,10 @@ else
CFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
@@ -3377,20 +3620,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_c89=$ac_arg
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -3406,15 +3650,15 @@ fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+ { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
@@ -3435,8 +3679,8 @@ am__doit:
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
@@ -3463,8 +3707,8 @@ if test "$am__include" = "#"; then
fi
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-dependency-tracking was given.
@@ -3488,10 +3732,10 @@ fi
depcc="$CC" am_compiler_list=
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
@@ -3579,8 +3823,8 @@ else
fi
fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -3595,16 +3839,16 @@ fi
if test "x$CC" != xcc; then
- { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
-echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
- { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
-echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
-set dummy $CC; ac_cc=`echo $2 |
+set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3630,19 +3874,21 @@ if { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
test -f conftest2.$ac_objext && { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
@@ -3653,10 +3899,11 @@ then
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
@@ -3664,19 +3911,21 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
test -f conftest2.$ac_objext && { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); };
then
# cc works too.
@@ -3694,11 +3943,11 @@ rm -f core conftest*
fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
cat >>confdefs.h <<\_ACEOF
#define NO_MINUS_C_MINUS_O 1
@@ -3720,1038 +3969,21 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
fi
-for ac_prog in 'bison -y' byacc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_YACC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$YACC"; then
- ac_cv_prog_YACC="$YACC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_YACC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
- { echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$YACC" && break
-done
-test -n "$YACC" || YACC="yacc"
-
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-
-fi
-
-SED=$lt_cv_path_SED
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix3*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line 4562 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- lt_cv_cc_needs_belf=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- lt_cv_cc_needs_belf=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-
-esac
-
-need_locks="$enable_libtool_lock"
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -4783,20 +4015,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
@@ -4820,13 +4053,14 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
@@ -4834,7 +4068,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
@@ -4859,8 +4093,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -4888,20 +4122,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
@@ -4925,13 +4160,14 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
@@ -4939,7 +4175,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
@@ -4955,9 +4191,9 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+ { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -4969,10 +4205,144 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -4999,20 +4369,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_header_stdc=no
@@ -5104,37 +4475,40 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -5156,11 +4530,11 @@ fi
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -5178,20 +4552,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_Header=no"
@@ -5199,12 +4574,14 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -5213,22 +4590,18 @@ done
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "${ac_cv_header_minix_config_h+set}" = set; then
+ { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+$as_echo_n "checking minix/config.h usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -5236,7 +4609,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <$ac_header>
+#include <minix/config.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
@@ -5244,90 +4617,92 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+$as_echo_n "checking minix/config.h presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <$ac_header>
+#include <minix/config.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -5336,48 +4711,132 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- eval "$as_ac_Header=\$ac_header_preproc"
+ ac_cv_header_minix_config_h=$ac_header_preproc
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+if test $ac_cv_header_minix_config_h = yes; then
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
+
+ fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_safe_to_define___extensions__=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_safe_to_define___extensions__=no
fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define _TANDEM_SOURCE 1
+_ACEOF
+
+
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AS+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -5386,8 +4845,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5396,32 +4855,84 @@ IFS=$as_save_IFS
fi
fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ { $as_echo "$as_me:$LINENO: result: $AS" >&5
+$as_echo "$AS" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$CXX" && break
- done
fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AS="as"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AS" = x; then
+ AS="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ AS=$ac_ct_AS
+ fi
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -5430,8 +4941,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5440,645 +4951,571 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$ac_ct_CXX" && break
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
+IFS=$as_save_IFS
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- CXX=$ac_ct_CXX
+ DLLTOOL=$ac_ct_DLLTOOL
fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ ;;
+esac
-int
-main ()
-{
+test -z "$AS" && AS=as
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- CXXFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+test -z "$DLLTOOL" && DLLTOOL=dlltool
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+macro_version='2.2.6b'
+macro_revision='1.3017'
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-depcc="$CXX" am_compiler_list=
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
- cd ..
- rm -rf conftest.dir
+ $ac_path_SED_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
else
- am_cv_CXX_dependencies_compiler_type=none
+ ac_cv_path_SED=$SED
fi
fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_path_FGREP=$FGREP
+fi
- # Broken: fails on valid input.
-continue
+ fi
fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
-rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
- done
- ac_cv_prog_CXXCPP=$CXXCPP
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
fi
- CXXCPP=$ac_cv_prog_CXXCPP
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
else
- ac_cv_prog_CXXCPP=$CXXCPP
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
+if test "${lt_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
- # Broken: fails on valid input.
-continue
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
-rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-fi
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6087,8 +5524,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6097,32 +5534,32 @@ IFS=$as_save_IFS
fi
fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$F77" && break
+ test -n "$DUMPBIN" && break
done
fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6131,8 +5568,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6141,197 +5578,87 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$ac_ct_F77" && break
+ test -n "$ac_ct_DUMPBIN" && break
done
- if test "x$ac_ct_F77" = x; then
- F77=""
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- F77=$ac_ct_F77
+ DUMPBIN=$ac_ct_DUMPBIN
fi
fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
fi
+test -z "$NM" && NM=nm
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_f77_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_prog_f77_g=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:5630: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5633: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5636: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
fi
+ rm -f conftest*
fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
i=0
teststring="ABCD"
@@ -6352,7 +5679,7 @@ else
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw*)
+ cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -6407,51 +5734,848 @@ else
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
fi
if test -n $lt_cv_sys_max_cmd_len ; then
- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
else
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
# These are sane defaults that work on at least a few old systems.
@@ -6463,33 +6587,18 @@ symcode='[BCDEGRST]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
# Define system-specific variables.
case $host_os in
aix*)
symcode='[BCDT]'
;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
-hpux*) # Its linker distinguishes data from code symbols
+hpux*)
if test "$host_cpu" = ia64; then
symcode='[ABCDEGRST]'
fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
;;
irix* | nonstopux*)
symcode='[BCDEGRST]'
@@ -6514,56 +6623,84 @@ sysv4)
;;
esac
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
+# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
- cat > conftest.$ac_ext <<EOF
+ cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
+_LT_EOF
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Now try to grab the symbols.
nlist=conftest.nm
if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
(eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -6573,42 +6710,44 @@ EOF
fi
# Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
-EOF
+_LT_EOF
# Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+ cat <<_LT_EOF >> conftest.$ac_ext
-/* The mapping between symbol names and symbols. */
+/* The mapping between symbol names and symbols. */
const struct {
const char *name;
- lt_ptr_t address;
+ void *address;
}
-lt_preloaded_symbols[] =
+lt__PROGRAM__LTX_preloaded_symbols[] =
{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
};
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
#ifdef __cplusplus
}
#endif
-EOF
+_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_save_LIBS="$LIBS"
@@ -6618,7 +6757,7 @@ EOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
@@ -6637,7 +6776,7 @@ EOF
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -6653,87 +6792,461 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
+ { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+ { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
fi
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 6854 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_cc_needs_belf=yes
else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_cc_needs_belf=no
fi
-rmdir .libs 2>/dev/null
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+need_locks="$enable_libtool_lock"
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- ;;
-esac
+done
+done
+IFS=$as_save_IFS
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# Constants:
-rm="rm -f"
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6742,8 +7255,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6752,28 +7265,28 @@ IFS=$as_save_IFS
fi
fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6782,8 +7295,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6792,44 +7305,44 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_AR" = x; then
- AR="false"
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- AR=$ac_ct_AR
+ LIPO=$ac_ct_LIPO
fi
else
- AR="$ac_cv_prog_AR"
+ LIPO="$ac_cv_prog_LIPO"
fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6838,8 +7351,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6848,28 +7361,28 @@ IFS=$as_save_IFS
fi
fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6878,8 +7391,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6888,44 +7401,44 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- RANLIB=$ac_ct_RANLIB
+ OTOOL=$ac_ct_OTOOL
fi
else
- RANLIB="$ac_cv_prog_RANLIB"
+ OTOOL="$ac_cv_prog_OTOOL"
fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6934,8 +7447,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6944,28 +7457,28 @@ IFS=$as_save_IFS
fi
fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6974,8 +7487,8 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6984,73 +7497,509 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- STRIP=$ac_ct_STRIP
+ OTOOL64=$ac_ct_OTOOL64
fi
else
- STRIP="$ac_cv_prog_STRIP"
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
fi
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
for cc_temp in $compiler""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
@@ -7059,17 +8008,18 @@ for cc_temp in $compiler""; do
*) break;;
esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -7093,7 +8043,7 @@ else
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7104,7 +8054,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-EOF
+_LT_EOF
fi ;;
esac
fi
@@ -7119,19 +8069,23 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
+
+
+
+
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -7155,7 +8109,7 @@ else
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7166,7 +8120,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-EOF
+_LT_EOF
fi ;;
esac
fi
@@ -7181,13 +8135,14 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
+
else
MAGIC_CMD=:
fi
@@ -7197,28 +8152,8 @@ fi
;;
esac
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
# Use C for the default configuration in the libtool script
-tagname=
+
lt_save_CC="$CC"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7235,10 +8170,15 @@ objext=o
objext=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
# If no C compiler was specified, use CC.
@@ -7250,36 +8190,39 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM -r conftest*
+if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -7290,25 +8233,25 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7293: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8236: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7297: \$? = $ac_status" >&5
+ echo "$as_me:8240: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
- $rm conftest*
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -7318,12 +8261,17 @@ fi
fi
-lt_prog_compiler_wl=
+
+
+
+
+
+ lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
@@ -7339,19 +8287,29 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
;;
amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
@@ -7361,7 +8319,21 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_pic='-fno-common'
;;
- interix3*)
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -7373,25 +8345,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
enable_shared=no
;;
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
fi
;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
*)
lt_prog_compiler_pic='-fPIC'
;;
@@ -7408,18 +8373,8 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -7447,18 +8402,27 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_static='-non_shared'
;;
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
- icc* | ecc*)
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -7471,15 +8435,52 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
esac
;;
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
osf3* | osf4* | osf5*)
lt_prog_compiler_wl='-Wl,'
# All OSF/1 code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -7532,22 +8533,35 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
esac
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -7558,27 +8572,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7561: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8575: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7565: \$? = $ac_status" >&5
+ echo "$as_me:8579: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
+ lt_cv_prog_compiler_pic_works=yes
fi
fi
- $rm conftest*
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-if test x"$lt_prog_compiler_pic_works" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -7589,69 +8603,70 @@ else
fi
fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
+
+
+
+
+
#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- lt_prog_compiler_static_works=no
+ lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
else
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
fi
- $rm conftest*
+ $RM -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-if test x"$lt_prog_compiler_static_works" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
fi
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if test "${lt_cv_prog_compiler_c_o+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
- $rm -r conftest 2>/dev/null
+ $RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -7662,83 +8677,148 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7665: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8680: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7669: \$? = $ac_status" >&5
+ echo "$as_me:8684: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
- $rm conftest*
+ $RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
cd ..
- rmdir conftest
- $rm conftest*
+ $RM -r conftest
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8735: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:8739: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
hard_links=yes
- $rm conftest*
+ $RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
need_locks=no
fi
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
runpath_var=
allow_undefined_flag=
- enable_shared_with_static_runtimes=no
+ always_export_symbols=no
archive_cmds=
archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
- hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
link_all_deplibs=unknown
- hardcode_automatic=no
module_cmds=
module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
@@ -7746,26 +8826,17 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
case $host_os in
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -7791,16 +8862,16 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
+ case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -7810,11 +8881,11 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
@@ -7822,26 +8893,27 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
-EOF
+_LT_EOF
fi
;;
amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
@@ -7851,16 +8923,16 @@ EOF
fi
;;
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
@@ -7876,7 +8948,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -7891,39 +8963,78 @@ EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
tmp_addflag=
+ tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
@@ -7933,9 +9044,9 @@ EOF
;;
solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
@@ -7944,8 +9055,8 @@ EOF
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -7969,10 +9080,14 @@ EOF
_LT_EOF
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -7988,7 +9103,7 @@ _LT_EOF
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -8020,7 +9135,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -8030,22 +9145,22 @@ _LT_EOF
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
done
;;
esac
@@ -8062,28 +9177,30 @@ _LT_EOF
archive_cmds=''
hardcode_direct=yes
+ hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
- # We have reworked collect2
- hardcode_direct=yes
+ # We have reworked collect2
+ :
else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
fi
;;
esac
@@ -8094,8 +9211,8 @@ _LT_EOF
else
# not using gcc
if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
@@ -8106,6 +9223,7 @@ _LT_EOF
fi
fi
+ export_dynamic_flag_spec='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
@@ -8113,8 +9231,9 @@ _LT_EOF
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -8135,44 +9254,56 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
- # Determine the default libpath from the value encoded in an empty executable.
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -8194,31 +9325,42 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
@@ -8238,18 +9380,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
bsdi[45]*)
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -8261,63 +9410,40 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds='true'
+ old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes=yes
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
;;
dgux*)
@@ -8350,7 +9476,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -8359,9 +9485,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hpux9*)
if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
- archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
@@ -8381,11 +9507,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_libdir_separator=:
-
hardcode_direct=yes
+ hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
-
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
@@ -8399,7 +9525,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -8424,12 +9550,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_cpu in
hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_direct=no
hardcode_shlibpath_var=no
;;
*)
hardcode_direct=yes
+ hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
@@ -8442,18 +9568,62 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
+ inherit_rpath=yes
link_all_deplibs=yes
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
@@ -8471,25 +9641,33 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=no
;;
+ *nto* | *qnx*)
+ ;;
+
openbsd*)
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
+ ld_shlibs=no
fi
;;
@@ -8497,18 +9675,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@@ -8516,49 +9695,59 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_separator=:
;;
solaris*)
- no_undefined_flag=' -z text'
+ no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs=yes
;;
@@ -8615,7 +9804,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
@@ -8641,18 +9830,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
allow_undefined_flag='${wl}-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -8666,12 +9855,36 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
ld_shlibs=no
;;
esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
fi
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
test "$ld_shlibs" = no && can_build_shared=no
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#
# Do we need to explicitly link libc?
#
@@ -8689,15 +9902,15 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } 2>conftest.err; then
soname=conftest
lib=conftest
@@ -8712,10 +9925,10 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
then
archive_cmds_need_lc=no
@@ -8726,17 +9939,225 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
else
cat conftest.err 1>&5
fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+ $RM conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
;;
esac
fi
;;
esac
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -8750,20 +10171,6 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -8781,7 +10188,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8800,7 +10207,7 @@ aix4* | aix5*)
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -8826,9 +10233,18 @@ aix4* | aix5*)
;;
amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
;;
beos*)
@@ -8851,25 +10267,28 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
- $rm \$dlpath'
+ $RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
@@ -8878,20 +10297,20 @@ cygwin* | mingw* | pw32*)
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
- mingw*)
+ mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH printed by
# mingw gcc, but we are running on Cygwin. Gcc prints its search
# path with ; separators, and with drive letters. We can handle the
# drive letters (cygwin fileutils understands them), so leave them,
# especially as we might pass files found there to a mingw objdump,
# which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
;;
pw32*)
@@ -8915,17 +10334,13 @@ darwin* | rhapsody*)
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -8942,18 +10357,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -8991,7 +10394,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -9030,18 +10433,18 @@ hpux9* | hpux10* | hpux11*)
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
@@ -9054,7 +10457,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -9109,7 +10512,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -9118,6 +10521,64 @@ linux*)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+ shlibpath_overrides_runpath=yes
+fi
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
@@ -9125,7 +10586,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -9138,23 +10599,11 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
@@ -9175,14 +10624,16 @@ newsos6)
shlibpath_overrides_runpath=yes
;;
-nto-qnx*)
- version_type=linux
+*nto* | *qnx*)
+ version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
;;
openbsd*)
@@ -9191,13 +10642,13 @@ openbsd*)
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[89] | openbsd2.[89].*)
shlibpath_overrides_runpath=no
@@ -9231,6 +10682,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -9265,7 +10720,6 @@ sysv4 | sysv4.3*)
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
@@ -9296,13 +10750,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -9312,6 +10765,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
sys_lib_dlsearch_path_spec='/usr/lib'
;;
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -9323,8 +10787,8 @@ uts4*)
dynamic_linker=no
;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -9332,19 +10796,112 @@ if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
test "X$hardcode_automatic" = "Xyes" ; then
- # We can hardcode non-existant directories.
+ # We can hardcode non-existent directories.
if test "$hardcode_direct" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
@@ -9357,10 +10914,11 @@ else
# directories.
hardcode_action=unsupported
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
-if test "$hardcode_action" = relink; then
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
@@ -9369,36 +10927,12 @@ elif test "$shlibpath_overrides_runpath" = yes ||
enable_fast_install=needless
fi
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- ;;
- *)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ;;
- esac
-fi
-if test "x$enable_dlopen" != xyes; then
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -9413,22 +10947,22 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32*)
+ mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
- ;;
+ ;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
- ;;
+ ;;
darwin*)
# if libdl is installed we need to link against it
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
@@ -9460,32 +10994,36 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_dl_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dl_dlopen=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
@@ -9496,13 +11034,13 @@ else
fi
- ;;
+ ;;
*)
- { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -9555,38 +11093,42 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_func_shl_load=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_shl_load=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
if test $ac_cv_func_shl_load = yes; then
lt_cv_dlopen="shl_load"
else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
@@ -9618,39 +11160,43 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_dld_shl_load=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dld_shl_load=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
- { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -9703,38 +11249,42 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_func_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_dlopen=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
if test $ac_cv_func_dlopen = yes; then
lt_cv_dlopen="dlopen"
else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
@@ -9766,39 +11316,43 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_dl_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dl_dlopen=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
@@ -9830,39 +11384,43 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_svld_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_svld_dlopen=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test $ac_cv_lib_svld_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
@@ -9894,34 +11452,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_dld_dld_link=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dld_dld_link=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
@@ -9959,18 +11521,18 @@ fi
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 9973 "configure"
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 11535 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10011,10 +11573,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -10030,13 +11588,13 @@ int main ()
else
puts (dlerror ());
- exit (status);
+ return status;
}
-EOF
+_LT_EOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -10054,23 +11612,23 @@ rm -fr conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 10073 "configure"
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 11631 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10111,10 +11669,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -10130,13 +11684,13 @@ int main ()
else
puts (dlerror ());
- exit (status);
+ return status;
}
-EOF
+_LT_EOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -10154,8 +11708,8 @@ rm -fr conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
CPPFLAGS="$save_CPPFLAGS"
@@ -10176,524 +11730,103 @@ echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
fi
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-# Old archive suffix (normally "a").
-libext="$libext"
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-# Executable file suffix (normally "").
-exeext="$exeext"
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-# ### END LIBTOOL CONFIG
-__EOF__
+ # Report which library types will actually be built
+ { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
case $host_os in
aix3*)
- cat <<\EOF >> "$cfgfile"
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
;;
esac
+ { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+ { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10703,8973 +11836,2093 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CC="$lt_save_CC"
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
- withval=$with_tags; tagnames="$withval"
-fi
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
- { (exit 1); exit 1; }; }
- fi
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+ ac_config_commands="$ac_config_commands libtool"
-# Allow CC to be a program name with arguments.
-compiler=$CC
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+# Only expand once:
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
+done
+IFS=$as_save_IFS
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
else
- lt_prog_compiler_no_builtin_flag_CXX=
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
else
- with_gnu_ld=no
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+ STRIP="$ac_cv_prog_STRIP"
fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+#
+# Options for building bsdtar.
+#
+# Default is to build bsdtar, but allow people to override that.
+#
+# Check whether --enable-bsdtar was given.
+if test "${enable_bsdtar+set}" = set; then
+ enableval=$enable_bsdtar;
else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
+ enable_bsdtar=yes
+fi
+
+
+case "$enable_bsdtar" in
+yes)
+ if test "$enable_static" = "no"; then
+ static_bsdtar=no
+ else
+ static_bsdtar=yes
+ fi
+ build_bsdtar=yes
;;
- *)
- test "$with_gnu_ld" != yes && break
+dynamic|shared)
+ if test "$enable_shared" = "no"; then
+ { { $as_echo "$as_me:$LINENO: error: Shared linking of bsdtar requires shared libarchive
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: Shared linking of bsdtar requires shared libarchive
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ build_bsdtar=yes
+ static_bsdtar=no
;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
+static)
+ build_bsdtar=yes
+ static_bsdtar=yes
+ ;;
+no)
+ build_bsdtar=no
+ static_bsdtar=no
+ ;;
+*)
+ { { $as_echo "$as_me:$LINENO: error: Unsupported value for --enable-bsdtar
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: Unsupported value for --enable-bsdtar
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+ if test "$build_bsdtar" = yes ; then
+ BUILD_BSDTAR_TRUE=
+ BUILD_BSDTAR_FALSE='#'
else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ BUILD_BSDTAR_TRUE='#'
+ BUILD_BSDTAR_FALSE=
fi
+
+ if test "$static_bsdtar" = yes ; then
+ STATIC_BSDTAR_TRUE=
+ STATIC_BSDTAR_FALSE='#'
+else
+ STATIC_BSDTAR_TRUE='#'
+ STATIC_BSDTAR_FALSE=
fi
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+
+#
+# Options for building bsdcpio.
+#
+# Default is not to build bsdcpio, but that can be overridden.
+#
+# Check whether --enable-bsdcpio was given.
+if test "${enable_bsdcpio+set}" = set; then
+ enableval=$enable_bsdcpio;
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ enable_bsdcpio=yes
fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+
+
+case "$enable_bsdcpio" in
+yes)
+ if test "$enable_static" = "no"; then
+ static_bsdcpio=no
+ else
+ static_bsdcpio=yes
+ fi
+ build_bsdcpio=yes
+ ;;
+dynamic|shared)
+ if test "$enabled_shared" = "no"; then
+ { { $as_echo "$as_me:$LINENO: error: Shared linking of bsdcpio requires shared libarchive
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: Shared linking of bsdcpio requires shared libarchive
+See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
+ fi
+ build_bsdcpio=yes
+ ;;
+static)
+ build_bsdcpio=yes
+ static_bsdcpio=yes
+ ;;
+no)
+ build_bsdcpio=no
+ static_bsdcpio=no
+ ;;
*)
- lt_cv_prog_gnu_ld=no
- ;;
+ { { $as_echo "$as_me:$LINENO: error: Unsupported value for --enable-bsdcpio
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: Unsupported value for --enable-bsdcpio
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
esac
+
+ if test "$build_bsdcpio" = yes ; then
+ BUILD_BSDCPIO_TRUE=
+ BUILD_BSDCPIO_FALSE='#'
+else
+ BUILD_BSDCPIO_TRUE='#'
+ BUILD_BSDCPIO_FALSE=
+fi
+
+ if test "$static_bsdcpio" = yes ; then
+ STATIC_BSDCPIO_TRUE=
+ STATIC_BSDCPIO_FALSE='#'
+else
+ STATIC_BSDCPIO_TRUE='#'
+ STATIC_BSDCPIO_FALSE=
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
+# Set up defines needed before including any headers
+case $host in
+ *mingw* | *cygwin* )
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+cat >>confdefs.h <<\_ACEOF
+#define _WIN32_WINNT 0x0500
+_ACEOF
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
+cat >>confdefs.h <<\_ACEOF
+#define WINVER 0x0500
+_ACEOF
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
+ ;;
+esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+# Checks for header files.
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_CXX=yes
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
int
main ()
{
-
+if ((DIR *) 0)
+return 0;
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
+ test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ eval "$as_ac_Header=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ac_header_dirent=$ac_hdr; break
+fi
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
int
main ()
{
-
+return opendir ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
+ test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_opendir=$ac_res
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix3*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
else
- echo "libtool.m4: error: problem compiling CXX test program"
+ ac_cv_search_opendir=no
fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+fi
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
+else
+ { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_opendir=$ac_res
else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12409: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:12413: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
fi
+{ $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_sys_wait_h=yes
else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12513: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:12517: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
fi
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
+for ac_header in acl/libacl.h attr/xattr.h ctype.h errno.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
+ ac_header_compiler=no
+fi
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
+ ac_header_preproc=no
+fi
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
-if test "$hardcode_action_CXX" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
+for ac_header in ext2fs/ext2_fs.h fcntl.h grp.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
+ ac_header_compiler=no
+fi
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14083: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14087: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- lt_prog_compiler_static_F77=
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14187: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:14191: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_F77=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
fi
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_F77=unsupported
- fi
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
- archive_cmds_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_F77=yes
- else
- # We have old collect2
- hardcode_direct_F77=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_F77=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
+for ac_header in inttypes.h io.h langinfo.h limits.h linux/fs.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
+ test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_header_compiler=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
- end
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ }; then
+ ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_header_preproc=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_F77=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
+fi
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
+done
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-*)
- dynamic_linker=no
- ;;
+for ac_header in locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ ac_header_compiler=no
fi
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test "$hardcode_action_F77" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
+fi
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-lt_prog_compiler_no_builtin_flag_GCJ=
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16385: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16389: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
+for ac_header in stdint.h stdlib.h string.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
- :
-fi
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_compiler=no
fi
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16653: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16657: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16757: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:16761: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_GCJ=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
fi
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_GCJ=unsupported
- fi
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
- archive_cmds_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_GCJ=yes
- else
- # We have old collect2
- hardcode_direct_GCJ=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_GCJ=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
+for ac_header in sys/acl.h sys/cdefs.h sys/extattr.h sys/ioctl.h sys/mkdev.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_header_compiler=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+#include <$ac_header>
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+ }; then
+ ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_header_preproc=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_GCJ=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
+fi
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
+done
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-freebsd1*)
- dynamic_linker=no
- ;;
+for ac_header in sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
+ ac_header_compiler=no
+fi
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
+ ac_header_preproc=no
+fi
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
+fi
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
+done
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-*)
- dynamic_linker=no
- ;;
+for ac_header in time.h unistd.h utime.h wchar.h wctype.h windows.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ ac_header_compiler=no
fi
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test "$hardcode_action_GCJ" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
+fi
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
+# Checks for libraries.
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then
+ withval=$with_zlib;
fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- ;;
-
- *)
- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
+if test "x$with_zlib" != "xno"; then
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
- { (exit 1); exit 1; }; }
- fi
+for ac_header in zlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ ac_header_compiler=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ ac_header_preproc=no
fi
- if test "x$ac_ct_STRIP" = x; then
- STRIP=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
- STRIP=$ac_ct_STRIP
- fi
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- STRIP="$ac_cv_prog_STRIP"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-#
-# Options for building bsdtar.
-#
-# Default is to build bsdtar, but allow people to override that.
-#
-# Check whether --enable-bsdtar was given.
-if test "${enable_bsdtar+set}" = set; then
- enableval=$enable_bsdtar;
-else
- enable_bsdtar=yes
fi
+done
-case "$enable_bsdtar" in
-yes)
- if test "$enable_static" = "no"; then
- static_bsdtar=no
- else
- static_bsdtar=yes
- fi
- build_bsdtar=yes
- ;;
-dynamic|shared)
- if test "$enable_shared" = "no"; then
- { { echo "$as_me:$LINENO: error: Shared linking of bsdtar requires shared libarchive
-See \`config.log' for more details." >&5
-echo "$as_me: error: Shared linking of bsdtar requires shared libarchive
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- build_bsdtar=yes
- static_bsdtar=no
- ;;
-static)
- build_bsdtar=yes
- static_bsdtar=yes
- ;;
-no)
- build_bsdtar=no
- static_bsdtar=no
- ;;
-*)
- { { echo "$as_me:$LINENO: error: Unsupported value for --enable-bsdtar
-See \`config.log' for more details." >&5
-echo "$as_me: error: Unsupported value for --enable-bsdtar
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- ;;
-esac
- if test "$build_bsdtar" = yes ; then
- BUILD_BSDTAR_TRUE=
- BUILD_BSDTAR_FALSE='#'
+{ $as_echo "$as_me:$LINENO: checking for inflate in -lz" >&5
+$as_echo_n "checking for inflate in -lz... " >&6; }
+if test "${ac_cv_lib_z_inflate+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- BUILD_BSDTAR_TRUE='#'
- BUILD_BSDTAR_FALSE=
-fi
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- if test "$static_bsdtar" = yes ; then
- STATIC_BSDTAR_TRUE=
- STATIC_BSDTAR_FALSE='#'
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflate ();
+int
+main ()
+{
+return inflate ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_z_inflate=yes
else
- STATIC_BSDTAR_TRUE='#'
- STATIC_BSDTAR_FALSE=
-fi
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_lib_z_inflate=no
+fi
-#
-# Options for building bsdcpio.
-#
-# Default is not to build bsdcpio, but that can be overridden.
-#
-# Check whether --enable-bsdcpio was given.
-if test "${enable_bsdcpio+set}" = set; then
- enableval=$enable_bsdcpio;
-else
- enable_bsdcpio=no
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5
+$as_echo "$ac_cv_lib_z_inflate" >&6; }
+if test $ac_cv_lib_z_inflate = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+ LIBS="-lz $LIBS"
-case "$enable_bsdcpio" in
-yes)
- if test "$enable_static" = "no"; then
- static_bsdcpio=no
- else
- static_bsdcpio=yes
- fi
- build_bsdcpio=yes
- ;;
-dynamic|shared)
- if test "$enabled_shared" = "no"; then
- { { echo "$as_me:$LINENO: error: Shared linking of bsdcpio requires shared libarchive
-See \`config.log' for more details." >&5
-echo "$as_me: error: Shared linking of bsdcpio requires shared libarchive
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- build_bsdcpio=yes
- ;;
-static)
- build_bsdcpio=yes
- static_bsdcpio=yes
- ;;
-no)
- build_bsdcpio=no
- static_bsdcpio=no
- ;;
-*)
- { { echo "$as_me:$LINENO: error: Unsupported value for --enable-bsdcpio
-See \`config.log' for more details." >&5
-echo "$as_me: error: Unsupported value for --enable-bsdcpio
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- ;;
-esac
+fi
- if test "$build_bsdcpio" = yes ; then
- BUILD_BSDCPIO_TRUE=
- BUILD_BSDCPIO_FALSE='#'
-else
- BUILD_BSDCPIO_TRUE='#'
- BUILD_BSDCPIO_FALSE=
fi
- if test "$static_bsdcpio" = yes ; then
- STATIC_BSDCPIO_TRUE=
- STATIC_BSDCPIO_FALSE='#'
-else
- STATIC_BSDCPIO_TRUE='#'
- STATIC_BSDCPIO_FALSE=
+
+# Check whether --with-bz2lib was given.
+if test "${with_bz2lib+set}" = set; then
+ withval=$with_bz2lib;
fi
-# Checks for header files.
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "x$with_bz2lib" != "xno"; then
+
+for ac_header in bzlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
- cat >conftest.$ac_ext <<_ACEOF
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
@@ -19677,180 +13930,234 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
+ ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_stdc=no
+ ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <string.h>
-
+#include <$ac_header>
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- ac_cv_header_stdc=no
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-rm -f conftest*
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking for BZ2_bzDecompressInit in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
+if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzDecompressInit ();
int
main ()
{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
+return BZ2_bzDecompressInit ();
+ ;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_bz2_BZ2_bzDecompressInit=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ ac_cv_lib_bz2_BZ2_bzDecompressInit=no
fi
-
-fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
+if test $ac_cv_lib_bz2_BZ2_bzDecompressInit = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBBZ2 1
_ACEOF
+ LIBS="-lbz2 $LIBS"
+
fi
+fi
+# Check whether --with-lzmadec was given.
+if test "${with_lzmadec+set}" = set; then
+ withval=$with_lzmadec;
+fi
+if test "x$with_lzmadec" != "xno"; then
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+for ac_header in lzmadec.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
- cat >conftest.$ac_ext <<_ACEOF
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/types.h>
-#include <$ac_hdr>
-
-int
-main ()
-{
-if ((DIR *) 0)
-return 0;
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
@@ -19858,47 +14165,131 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
+ ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_Header=no"
+ ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-ac_header_dirent=$ac_hdr; break
fi
done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+{ $as_echo "$as_me:$LINENO: checking for lzmadec_decode in -llzmadec" >&5
+$as_echo_n "checking for lzmadec_decode in -llzmadec... " >&6; }
+if test "${ac_cv_lib_lzmadec_lzmadec_decode+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- ac_func_search_save_LIBS=$LIBS
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzmadec $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -19912,244 +14303,380 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char opendir ();
+char lzmadec_decode ();
int
main ()
{
-return opendir ();
+return lzmadec_decode ();
;
return 0;
}
_ACEOF
-for ac_lib in '' dir; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_search_opendir=$ac_res
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_lzmadec_lzmadec_decode=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_cv_lib_lzmadec_lzmadec_decode=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
-else
- ac_cv_search_opendir=no
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzmadec_lzmadec_decode" >&5
+$as_echo "$ac_cv_lib_lzmadec_lzmadec_decode" >&6; }
+if test $ac_cv_lib_lzmadec_lzmadec_decode = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLZMADEC 1
+_ACEOF
+
+ LIBS="-llzmadec $LIBS"
+
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+# Check whether --with-lzma was given.
+if test "${with_lzma+set}" = set; then
+ withval=$with_lzma;
fi
+
+if test "x$with_lzma" != "xno"; then
+
+for ac_header in lzma.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
-for ac_lib in '' x; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_search_opendir=$ac_res
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+ ac_header_compiler=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
else
- ac_cv_search_opendir=no
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
-{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking for lzma_stream_decoder in -llzma" >&5
+$as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
+if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_stream_decoder ();
int
main ()
{
- int s;
- wait (&s);
- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+return lzma_stream_decoder ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_sys_wait_h=yes
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_lzma_lzma_stream_decoder=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_sys_wait_h=no
+ ac_cv_lib_lzma_lzma_stream_decoder=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
-if test $ac_cv_header_sys_wait_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_WAIT_H 1
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
+if test $ac_cv_lib_lzma_lzma_stream_decoder = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLZMA 1
_ACEOF
+ LIBS="-llzma $LIBS"
+
+fi
+
fi
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then
+ withval=$with_openssl;
+fi
+
+# Check whether --with-xml2 was given.
+if test "${with_xml2+set}" = set; then
+ withval=$with_xml2;
+fi
-for ac_header in bzlib.h errno.h ext2fs/ext2_fs.h fcntl.h grp.h
+# Check whether --with-expat was given.
+if test "${with_expat+set}" = set; then
+ withval=$with_expat;
+fi
+
+
+if test "x$with_xml2" != "xno"; then
+ # Extract the first word of "xml2-config", so it can be a program name with args.
+set dummy xml2-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XML2_CONFIG+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $XML2_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in ${PATH}
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+XML2_CONFIG=$ac_cv_path_XML2_CONFIG
+if test -n "$XML2_CONFIG"; then
+ { $as_echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5
+$as_echo "$XML2_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$XML2_CONFIG" != "x"; then
+ CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
+ LIBS="${LIBS} `${XML2_CONFIG} --libs`"
+ fi
+
+for ac_header in libxml/xmlreader.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20165,32 +14692,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20204,51 +14732,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -20257,21 +14786,23 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -20279,25 +14810,101 @@ fi
done
+{ $as_echo "$as_me:$LINENO: checking for xmlInitParser in -lxml2" >&5
+$as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
+if test "${ac_cv_lib_xml2_xmlInitParser+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitParser ();
+int
+main ()
+{
+return xmlInitParser ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_xml2_xmlInitParser=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_xml2_xmlInitParser=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlInitParser" >&5
+$as_echo "$ac_cv_lib_xml2_xmlInitParser" >&6; }
+if test $ac_cv_lib_xml2_xmlInitParser = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML2 1
+_ACEOF
+ LIBS="-lxml2 $LIBS"
+fi
+
+fi
+if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then
+ if test "x$with_expat" != "xno"; then
-for ac_header in inttypes.h langinfo.h limits.h linux/fs.h
+for ac_header in expat.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20313,32 +14920,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20352,51 +14960,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -20405,21 +15014,23 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -20427,27 +15038,107 @@ fi
done
+{ $as_echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
+$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; }
+if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lexpat $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XML_ParserCreate ();
+int
+main ()
+{
+return XML_ParserCreate ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_expat_XML_ParserCreate=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_lib_expat_XML_ParserCreate=no
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
+$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; }
+if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBEXPAT 1
+_ACEOF
+ LIBS="-lexpat $LIBS"
-for ac_header in locale.h paths.h poll.h pwd.h regex.h stdarg.h
+fi
+
+ fi
+fi
+
+
+
+
+
+
+
+
+for ac_header in md5.h ripemd.h rmd160.h sha.h sha1.h sha2.h sha256.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20463,32 +15154,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20502,51 +15194,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -20555,48 +15248,359 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# Common names for libc implementation on NetBSD and OpenBSD
+
+
+
+for ac_func in MD5Init RMD160Init SHA1Init
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+# SHA2 on NetBSD and older OpenBSD
+
+
+
+for ac_func in SHA256_Init SHA384_Init SHA512_Init
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+fi
done
+# SHA2 on newer OpenBSD
+for ac_func in SHA256Init SHA384Init SHA512Init
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-for ac_header in stdint.h stdlib.h string.h sys/acl.h sys/ioctl.h
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+if test "x$with_openssl" != "xno"; then
+ if test "$ac_cv_func_MD5Init" != "yes"; then
+
+for ac_header in openssl/md5.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20612,32 +15616,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20651,51 +15656,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -20704,48 +15710,136 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
+ { $as_echo "$as_me:$LINENO: checking for library containing MD5_Init" >&5
+$as_echo_n "checking for library containing MD5_Init... " >&6; }
+if test "${ac_cv_search_MD5_Init+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char MD5_Init ();
+int
+main ()
+{
+return MD5_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' crypto; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_MD5_Init=$ac_res
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_MD5_Init+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_MD5_Init+set}" = set; then
+ :
+else
+ ac_cv_search_MD5_Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_MD5_Init" >&5
+$as_echo "$ac_cv_search_MD5_Init" >&6; }
+ac_res=$ac_cv_search_MD5_Init
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+fi
+ fi
+ if test "$ac_cv_func_RMD160Init" != "yes"; then
-for ac_header in sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h
+for ac_header in openssl/ripemd.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20761,32 +15855,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20800,51 +15895,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -20853,48 +15949,136 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
+ { $as_echo "$as_me:$LINENO: checking for library containing RIPEMD160_Init" >&5
+$as_echo_n "checking for library containing RIPEMD160_Init... " >&6; }
+if test "${ac_cv_search_RIPEMD160_Init+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char RIPEMD160_Init ();
+int
+main ()
+{
+return RIPEMD160_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' crypto; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_RIPEMD160_Init=$ac_res
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_RIPEMD160_Init+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_RIPEMD160_Init+set}" = set; then
+ :
+else
+ ac_cv_search_RIPEMD160_Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_RIPEMD160_Init" >&5
+$as_echo "$ac_cv_search_RIPEMD160_Init" >&6; }
+ac_res=$ac_cv_search_RIPEMD160_Init
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+fi
+ fi
+ if test "$ac_cv_func_SHA1Init" != "yes"; then
-for ac_header in time.h unistd.h utime.h wchar.h zlib.h
+for ac_header in openssl/sha.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20910,32 +16094,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20949,51 +16134,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -21002,37 +16188,35 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
-
-# Checks for libraries.
-
-{ echo "$as_me:$LINENO: checking for BZ2_bzDecompressInit in -lbz2" >&5
-echo $ECHO_N "checking for BZ2_bzDecompressInit in -lbz2... $ECHO_C" >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:$LINENO: checking for library containing SHA1_Init" >&5
+$as_echo_n "checking for library containing SHA1_Init... " >&6; }
+if test "${ac_cv_search_SHA1_Init+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbz2 $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21046,64 +16230,239 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char BZ2_bzDecompressInit ();
+char SHA1_Init ();
int
main ()
{
-return BZ2_bzDecompressInit ();
+return SHA1_Init ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+for ac_lib in '' crypto; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_bz2_BZ2_bzDecompressInit=yes
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_SHA1_Init=$ac_res
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_bz2_BZ2_bzDecompressInit=no
+
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if test "${ac_cv_search_SHA1_Init+set}" = set; then
+ break
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
-echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
-if test $ac_cv_lib_bz2_BZ2_bzDecompressInit = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBZ2 1
+done
+if test "${ac_cv_search_SHA1_Init+set}" = set; then
+ :
+else
+ ac_cv_search_SHA1_Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_SHA1_Init" >&5
+$as_echo "$ac_cv_search_SHA1_Init" >&6; }
+ac_res=$ac_cv_search_SHA1_Init
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ fi
+ if test "$ac_cv_func_SHA256Init" != "yes" ||
+ test "$ac_cv_func_SHA384Init" != "yes" ||
+ test "$ac_cv_func_SHA512Init" != "yes"; then
+ if test "$ac_cv_func_SHA256_Init" != "yes" ||
+ test "$ac_cv_func_SHA384_Init" != "yes" ||
+ test "$ac_cv_func_SHA512_Init" != "yes"; then
+
+for ac_header in openssl/sha.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- LIBS="-lbz2 $LIBS"
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-{ echo "$as_me:$LINENO: checking for inflate in -lz" >&5
-echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6; }
-if test "${ac_cv_lib_z_inflate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $LIBS"
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ # TODO: Does AC_SEARCH_LIBS support more than one function at once?
+ # This appears to always fail.
+ { $as_echo "$as_me:$LINENO: checking for library containing SHA256_Init SHA384_Init SHA512_Init" >&5
+$as_echo_n "checking for library containing SHA256_Init SHA384_Init SHA512_Init... " >&6; }
+if test "${ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21117,56 +16476,99 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char inflate ();
+char SHA256_Init SHA384_Init SHA512_Init ();
int
main ()
{
-return inflate ();
+return SHA256_Init SHA384_Init SHA512_Init ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+for ac_lib in '' crypto; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_z_inflate=yes
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init=$ac_res
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_z_inflate=no
+
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if test "${ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init+set}" = set; then
+ break
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5
-echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6; }
-if test $ac_cv_lib_z_inflate = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
+done
+if test "${ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init+set}" = set; then
+ :
+else
+ ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init" >&5
+$as_echo "$ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init" >&6; }
+ac_res=$ac_cv_search_SHA256_Init_SHA384_Init_SHA512_Init
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+ # TODO: Actually test for these. Previously our C code did not
+ # test for these at all and just assumed availability. Now that
+ # the C code tests these macros we preserve previous behavior
+ # for the autotools build by hard-coding availability.
+ if test "$ac_cv_header_openssl_sha_h" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENSSL_SHA256_INIT 1
_ACEOF
- LIBS="-lz $LIBS"
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENSSL_SHA384_INIT 1
+_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENSSL_SHA512_INIT 1
+_ACEOF
+
+ fi
+ fi
+ fi
+fi
# TODO: Give the user the option of using a pre-existing system
# libarchive. This will define HAVE_LIBARCHIVE which will cause
@@ -21176,10 +16578,10 @@ fi
#AC_CHECK_LIB(archive,archive_version)
# Checks for typedefs, structures, and compiler characteristics.
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -21251,20 +16653,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_const=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_const=no
@@ -21272,20 +16675,22 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
cat >>confdefs.h <<\_ACEOF
-#define const
+#define const /**/
_ACEOF
fi
-{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
-echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; }
-if test "${ac_cv_type_uid_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# AC_TYPE_UID_T defaults to "int", which is incorrect for MinGW
+# and MSVC. Use a customized version.
+{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if test "${la_cv_type_uid_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -21298,48 +16703,84 @@ cat >>conftest.$ac_ext <<_ACEOF
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "uid_t" >/dev/null 2>&1; then
- ac_cv_type_uid_t=yes
+ la_cv_type_uid_t=yes
else
- ac_cv_type_uid_t=no
+ la_cv_type_uid_t=no
fi
rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
-echo "${ECHO_T}$ac_cv_type_uid_t" >&6; }
-if test $ac_cv_type_uid_t = no; then
+{ $as_echo "$as_me:$LINENO: result: $la_cv_type_uid_t" >&5
+$as_echo "$la_cv_type_uid_t" >&6; }
+if test $la_cv_type_uid_t = no; then
+ case $host in
+ *mingw*) def_uid_t=short ;;
+ *) def_uid_t=int ;;
+ esac
-cat >>confdefs.h <<\_ACEOF
-#define uid_t int
+cat >>confdefs.h <<_ACEOF
+#define uid_t $def_uid_t
_ACEOF
-cat >>confdefs.h <<\_ACEOF
-#define gid_t int
+cat >>confdefs.h <<_ACEOF
+#define gid_t $def_uid_t
_ACEOF
fi
-{ echo "$as_me:$LINENO: checking for mode_t" >&5
-echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5
+$as_echo_n "checking for mode_t... " >&6; }
if test "${ac_cv_type_mode_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_mode_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef mode_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (mode_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((mode_t)))
+ return 0;
;
return 0;
}
@@ -21350,29 +16791,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_mode_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_mode_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_mode_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
-echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+$as_echo "$ac_cv_type_mode_t" >&6; }
if test $ac_cv_type_mode_t = yes; then
:
else
@@ -21385,26 +16835,58 @@ fi
# AC_TYPE_OFF_T defaults to "long", which limits us to 4GB files on
# most systems... default to "long long" instead.
-{ echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for off_t" >&5
+$as_echo_n "checking for off_t... " >&6; }
if test "${ac_cv_type_off_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_off_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef off_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (off_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((off_t)))
+ return 0;
;
return 0;
}
@@ -21415,29 +16897,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_off_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_off_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_off_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+$as_echo "$ac_cv_type_off_t" >&6; }
if test $ac_cv_type_off_t = yes; then
:
else
@@ -21448,26 +16939,58 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
if test "${ac_cv_type_size_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef size_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (size_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((size_t)))
+ return 0;
;
return 0;
}
@@ -21478,29 +17001,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_size_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_size_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
if test $ac_cv_type_size_t = yes; then
:
else
@@ -21511,26 +17043,58 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for id_t" >&5
-echo $ECHO_N "checking for id_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for id_t" >&5
+$as_echo_n "checking for id_t... " >&6; }
if test "${ac_cv_type_id_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_id_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef id_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (id_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((id_t)))
+ return 0;
;
return 0;
}
@@ -21541,29 +17105,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_id_t=yes
+ :
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_id_t=no
+ ac_cv_type_id_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_id_t" >&5
-echo "${ECHO_T}$ac_cv_type_id_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_id_t" >&5
+$as_echo "$ac_cv_type_id_t" >&6; }
if test $ac_cv_type_id_t = yes; then
:
else
@@ -21574,26 +17147,58 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5
+$as_echo_n "checking for uintptr_t... " >&6; }
if test "${ac_cv_type_uintptr_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_uintptr_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef uintptr_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (uintptr_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((uintptr_t)))
+ return 0;
;
return 0;
}
@@ -21604,29 +17209,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_uintptr_t=yes
+ :
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_uintptr_t=no
+ ac_cv_type_uintptr_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+$as_echo "$ac_cv_type_uintptr_t" >&6; }
if test $ac_cv_type_uintptr_t = yes; then
:
else
@@ -21637,11 +17251,222 @@ _ACEOF
fi
+
+# Check for birthtime in struct stat
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5
+$as_echo_n "checking for struct stat.st_birthtime... " >&6; }
+if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_birthtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_birthtime=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_birthtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_birthtime=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_birthtime=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5
+$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; }
+if test $ac_cv_member_struct_stat_st_birthtime = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+_ACEOF
+
+
+fi
+
+
# Check for high-resolution timestamps in struct stat
-{ echo "$as_me:$LINENO: checking for struct stat.st_mtimespec.tv_nsec" >&5
-echo $ECHO_N "checking for struct stat.st_mtimespec.tv_nsec... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtimespec.tv_nsec" >&5
+$as_echo_n "checking for struct stat.st_birthtimespec.tv_nsec... " >&6; }
+if test "${ac_cv_member_struct_stat_st_birthtimespec_tv_nsec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_birthtimespec.tv_nsec)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_birthtimespec_tv_nsec=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_birthtimespec.tv_nsec)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_birthtimespec_tv_nsec=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_birthtimespec_tv_nsec=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" >&5
+$as_echo "$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" >&6; }
+if test $ac_cv_member_struct_stat_st_birthtimespec_tv_nsec = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtimespec.tv_nsec" >&5
+$as_echo_n "checking for struct stat.st_mtimespec.tv_nsec... " >&6; }
if test "${ac_cv_member_struct_stat_st_mtimespec_tv_nsec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -21666,20 +17491,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtimespec_tv_nsec=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
@@ -21705,20 +17531,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtimespec_tv_nsec=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_mtimespec_tv_nsec=no
@@ -21729,8 +17556,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtimespec_tv_nsec" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_mtimespec_tv_nsec" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtimespec_tv_nsec" >&5
+$as_echo "$ac_cv_member_struct_stat_st_mtimespec_tv_nsec" >&6; }
if test $ac_cv_member_struct_stat_st_mtimespec_tv_nsec = yes; then
cat >>confdefs.h <<_ACEOF
@@ -21740,10 +17567,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for struct stat.st_mtim.tv_nsec" >&5
-echo $ECHO_N "checking for struct stat.st_mtim.tv_nsec... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtim.tv_nsec" >&5
+$as_echo_n "checking for struct stat.st_mtim.tv_nsec... " >&6; }
if test "${ac_cv_member_struct_stat_st_mtim_tv_nsec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -21768,20 +17595,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim_tv_nsec=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
@@ -21807,20 +17635,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim_tv_nsec=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_mtim_tv_nsec=no
@@ -21831,8 +17660,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtim_tv_nsec" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_mtim_tv_nsec" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtim_tv_nsec" >&5
+$as_echo "$ac_cv_member_struct_stat_st_mtim_tv_nsec" >&6; }
if test $ac_cv_member_struct_stat_st_mtim_tv_nsec = yes; then
cat >>confdefs.h <<_ACEOF
@@ -21842,30 +17671,584 @@ _ACEOF
fi
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtime_n" >&5
+$as_echo_n "checking for struct stat.st_mtime_n... " >&6; }
+if test "${ac_cv_member_struct_stat_st_mtime_n+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_mtime_n)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_mtime_n=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_mtime_n)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_mtime_n=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_mtime_n=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtime_n" >&5
+$as_echo "$ac_cv_member_struct_stat_st_mtime_n" >&6; }
+if test $ac_cv_member_struct_stat_st_mtime_n = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIME_N 1
+_ACEOF
+
+
+fi
+ # AIX
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_umtime" >&5
+$as_echo_n "checking for struct stat.st_umtime... " >&6; }
+if test "${ac_cv_member_struct_stat_st_umtime+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_umtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_umtime=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_umtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_umtime=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_umtime=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_umtime" >&5
+$as_echo "$ac_cv_member_struct_stat_st_umtime" >&6; }
+if test $ac_cv_member_struct_stat_st_umtime = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_UMTIME 1
+_ACEOF
+
+
+fi
+ # Tru64
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtime_usec" >&5
+$as_echo_n "checking for struct stat.st_mtime_usec... " >&6; }
+if test "${ac_cv_member_struct_stat_st_mtime_usec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_mtime_usec)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_mtime_usec=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_mtime_usec)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_mtime_usec=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_mtime_usec=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtime_usec" >&5
+$as_echo "$ac_cv_member_struct_stat_st_mtime_usec" >&6; }
+if test $ac_cv_member_struct_stat_st_mtime_usec = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIME_USEC 1
+_ACEOF
+
+
+fi
+ # Hurd
+# Check for block size support in struct stat
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
+$as_echo_n "checking for struct stat.st_blksize... " >&6; }
+if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_blksize=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
+$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; }
+if test $ac_cv_member_struct_stat_st_blksize = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+
+# Check for st_flags in struct stat (BSD fflags)
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5
+$as_echo_n "checking for struct stat.st_flags... " >&6; }
+if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_flags)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_flags=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_flags)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_flags=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_flags=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5
+$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; }
+if test $ac_cv_member_struct_stat_st_flags = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+_ACEOF
+
+
+fi
+
# If you have uintmax_t, we assume printf supports %ju
# If you have unsigned long long, we assume printf supports %llu
# TODO: Check for %ju and %llu support directly.
-{ echo "$as_me:$LINENO: checking for uintmax_t" >&5
-echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for uintmax_t" >&5
+$as_echo_n "checking for uintmax_t... " >&6; }
if test "${ac_cv_type_uintmax_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_uintmax_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef uintmax_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (uintmax_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((uintmax_t)))
+ return 0;
;
return 0;
}
@@ -21876,29 +18259,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_uintmax_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uintmax_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_uintmax_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
+$as_echo "$ac_cv_type_uintmax_t" >&6; }
if test $ac_cv_type_uintmax_t = yes; then
cat >>confdefs.h <<_ACEOF
@@ -21907,26 +18299,58 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for unsigned long long" >&5
-echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for unsigned long long" >&5
+$as_echo_n "checking for unsigned long long... " >&6; }
if test "${ac_cv_type_unsigned_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_unsigned_long_long=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef unsigned long long ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (unsigned long long))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((unsigned long long)))
+ return 0;
;
return 0;
}
@@ -21937,29 +18361,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_unsigned_long_long=yes
+ :
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_unsigned_long_long=no
+ ac_cv_type_unsigned_long_long=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+$as_echo "$ac_cv_type_unsigned_long_long" >&6; }
if test $ac_cv_type_unsigned_long_long = yes; then
cat >>confdefs.h <<_ACEOF
@@ -21972,32 +18405,46 @@ fi
# We need int64_t, uint64_t, intmax_t, and uintmax_t
- { echo "$as_me:$LINENO: checking for long long int" >&5
-echo $ECHO_N "checking for long long int... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
if test "${ac_cv_type_long_long_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+
+ /* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-long long int ll = 9223372036854775807ll;
- long long int nll = -9223372036854775807LL;
- typedef int a[((-9223372036854775807LL < 0
- && 0 < 9223372036854775807ll)
- ? 1 : -1)];
- int i = 63;
+/* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
int
main ()
{
-long long int llmax = 9223372036854775807ll;
- return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
- | (llmax / ll) | (llmax % ll));
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
;
return 0;
}
+
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -22005,18 +18452,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
if test "$cross_compiling" = yes; then
ac_cv_type_long_long_int=yes
else
@@ -22056,45 +18506,49 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_type_long_long_int=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_type_long_long_int=no
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_long_long_int=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
if test $ac_cv_type_long_long_int = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22105,26 +18559,58 @@ _ACEOF
- { echo "$as_me:$LINENO: checking for intmax_t" >&5
-echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for intmax_t" >&5
+$as_echo_n "checking for intmax_t... " >&6; }
if test "${ac_cv_type_intmax_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_intmax_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef intmax_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (intmax_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((intmax_t)))
+ return 0;
;
return 0;
}
@@ -22135,29 +18621,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_intmax_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_intmax_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_intmax_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
+$as_echo "$ac_cv_type_intmax_t" >&6; }
if test $ac_cv_type_intmax_t = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22177,10 +18672,10 @@ fi
- { echo "$as_me:$LINENO: checking for int64_t" >&5
-echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for int64_t" >&5
+$as_echo_n "checking for int64_t... " >&6; }
if test "${ac_cv_c_int64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_c_int64_t=no
for ac_type in 'int64_t' 'int' 'long int' \
@@ -22208,13 +18703,14 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
@@ -22230,7 +18726,7 @@ int
main ()
{
static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1)
- < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))];
+ < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))];
test_array [0] = 0
;
@@ -22243,20 +18739,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
case $ac_type in
@@ -22268,7 +18765,7 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -22278,8 +18775,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_int64_t" != no && break
done
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5
-echo "${ECHO_T}$ac_cv_c_int64_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5
+$as_echo "$ac_cv_c_int64_t" >&6; }
case $ac_cv_c_int64_t in #(
no|yes) ;; #(
*)
@@ -22291,30 +18788,46 @@ _ACEOF
esac
- { echo "$as_me:$LINENO: checking for unsigned long long int" >&5
-echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+
+ /* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-unsigned long long int ull = 18446744073709551615ULL;
- typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
- ? 1 : -1)];
- int i = 63;
+/* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
int
main ()
{
-unsigned long long int ullmax = 18446744073709551615ull;
- return (ull << 63 | ull >> 63 | ull << i | ull >> i
- | ullmax / ull | ullmax % ull);
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
;
return 0;
}
+
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -22322,31 +18835,35 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_type_unsigned_long_long_int=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_unsigned_long_long_int=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
if test $ac_cv_type_unsigned_long_long_int = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22357,26 +18874,58 @@ _ACEOF
- { echo "$as_me:$LINENO: checking for uintmax_t" >&5
-echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for uintmax_t" >&5
+$as_echo_n "checking for uintmax_t... " >&6; }
if test "${ac_cv_type_uintmax_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_uintmax_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef uintmax_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (uintmax_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((uintmax_t)))
+ return 0;
;
return 0;
}
@@ -22387,29 +18936,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_uintmax_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uintmax_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_uintmax_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
+$as_echo "$ac_cv_type_uintmax_t" >&6; }
if test $ac_cv_type_uintmax_t = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22429,10 +18987,10 @@ fi
- { echo "$as_me:$LINENO: checking for uint64_t" >&5
-echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5
+$as_echo_n "checking for uint64_t... " >&6; }
if test "${ac_cv_c_uint64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_c_uint64_t=no
for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \
@@ -22460,13 +19018,14 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
@@ -22477,7 +19036,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
esac
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -22487,8 +19046,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_uint64_t" != no && break
done
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5
-echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5
+$as_echo "$ac_cv_c_uint64_t" >&6; }
case $ac_cv_c_uint64_t in #(
no|yes) ;; #(
*)
@@ -22506,10 +19065,10 @@ _ACEOF
# TODO: If any of these are missing, define them right here.
-{ echo "$as_me:$LINENO: checking whether SIZE_MAX is declared" >&5
-echo $ECHO_N "checking whether SIZE_MAX is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether SIZE_MAX is declared" >&5
+$as_echo_n "checking whether SIZE_MAX is declared... " >&6; }
if test "${ac_cv_have_decl_SIZE_MAX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22535,20 +19094,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_SIZE_MAX=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_SIZE_MAX=no
@@ -22556,8 +19116,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_SIZE_MAX" >&5
-echo "${ECHO_T}$ac_cv_have_decl_SIZE_MAX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_SIZE_MAX" >&5
+$as_echo "$ac_cv_have_decl_SIZE_MAX" >&6; }
if test $ac_cv_have_decl_SIZE_MAX = yes; then
cat >>confdefs.h <<_ACEOF
@@ -22572,10 +19132,77 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether INT64_MAX is declared" >&5
-echo $ECHO_N "checking whether INT64_MAX is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether SSIZE_MAX is declared" >&5
+$as_echo_n "checking whether SSIZE_MAX is declared... " >&6; }
+if test "${ac_cv_have_decl_SSIZE_MAX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef SSIZE_MAX
+ (void) SSIZE_MAX;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl_SSIZE_MAX=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl_SSIZE_MAX=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_SSIZE_MAX" >&5
+$as_echo "$ac_cv_have_decl_SSIZE_MAX" >&6; }
+if test $ac_cv_have_decl_SSIZE_MAX = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SSIZE_MAX 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SSIZE_MAX 0
+_ACEOF
+
+
+fi
+{ $as_echo "$as_me:$LINENO: checking whether INT64_MAX is declared" >&5
+$as_echo_n "checking whether INT64_MAX is declared... " >&6; }
if test "${ac_cv_have_decl_INT64_MAX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22601,20 +19228,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_INT64_MAX=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_INT64_MAX=no
@@ -22622,8 +19250,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_INT64_MAX" >&5
-echo "${ECHO_T}$ac_cv_have_decl_INT64_MAX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_INT64_MAX" >&5
+$as_echo "$ac_cv_have_decl_INT64_MAX" >&6; }
if test $ac_cv_have_decl_INT64_MAX = yes; then
cat >>confdefs.h <<_ACEOF
@@ -22638,10 +19266,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether INT64_MIN is declared" >&5
-echo $ECHO_N "checking whether INT64_MIN is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether INT64_MIN is declared" >&5
+$as_echo_n "checking whether INT64_MIN is declared... " >&6; }
if test "${ac_cv_have_decl_INT64_MIN+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22667,20 +19295,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_INT64_MIN=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_INT64_MIN=no
@@ -22688,8 +19317,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_INT64_MIN" >&5
-echo "${ECHO_T}$ac_cv_have_decl_INT64_MIN" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_INT64_MIN" >&5
+$as_echo "$ac_cv_have_decl_INT64_MIN" >&6; }
if test $ac_cv_have_decl_INT64_MIN = yes; then
cat >>confdefs.h <<_ACEOF
@@ -22704,10 +19333,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether UINT64_MAX is declared" >&5
-echo $ECHO_N "checking whether UINT64_MAX is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether UINT64_MAX is declared" >&5
+$as_echo_n "checking whether UINT64_MAX is declared... " >&6; }
if test "${ac_cv_have_decl_UINT64_MAX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22733,20 +19362,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_UINT64_MAX=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_UINT64_MAX=no
@@ -22754,8 +19384,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_UINT64_MAX" >&5
-echo "${ECHO_T}$ac_cv_have_decl_UINT64_MAX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_UINT64_MAX" >&5
+$as_echo "$ac_cv_have_decl_UINT64_MAX" >&6; }
if test $ac_cv_have_decl_UINT64_MAX = yes; then
cat >>confdefs.h <<_ACEOF
@@ -22770,10 +19400,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether UINT32_MAX is declared" >&5
-echo $ECHO_N "checking whether UINT32_MAX is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether UINT32_MAX is declared" >&5
+$as_echo_n "checking whether UINT32_MAX is declared... " >&6; }
if test "${ac_cv_have_decl_UINT32_MAX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22799,20 +19429,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_UINT32_MAX=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_UINT32_MAX=no
@@ -22820,8 +19451,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_UINT32_MAX" >&5
-echo "${ECHO_T}$ac_cv_have_decl_UINT32_MAX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_UINT32_MAX" >&5
+$as_echo "$ac_cv_have_decl_UINT32_MAX" >&6; }
if test $ac_cv_have_decl_UINT32_MAX = yes; then
cat >>confdefs.h <<_ACEOF
@@ -22839,10 +19470,10 @@ fi
-{ echo "$as_me:$LINENO: checking whether EFTYPE is declared" >&5
-echo $ECHO_N "checking whether EFTYPE is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether EFTYPE is declared" >&5
+$as_echo_n "checking whether EFTYPE is declared... " >&6; }
if test "${ac_cv_have_decl_EFTYPE+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22869,20 +19500,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_EFTYPE=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_EFTYPE=no
@@ -22890,8 +19522,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_EFTYPE" >&5
-echo "${ECHO_T}$ac_cv_have_decl_EFTYPE" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_EFTYPE" >&5
+$as_echo "$ac_cv_have_decl_EFTYPE" >&6; }
if test $ac_cv_have_decl_EFTYPE = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22900,10 +19532,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether EILSEQ is declared" >&5
-echo $ECHO_N "checking whether EILSEQ is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether EILSEQ is declared" >&5
+$as_echo_n "checking whether EILSEQ is declared... " >&6; }
if test "${ac_cv_have_decl_EILSEQ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22930,20 +19562,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_EILSEQ=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_EILSEQ=no
@@ -22951,8 +19584,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_EILSEQ" >&5
-echo "${ECHO_T}$ac_cv_have_decl_EILSEQ" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_EILSEQ" >&5
+$as_echo "$ac_cv_have_decl_EILSEQ" >&6; }
if test $ac_cv_have_decl_EILSEQ = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -22961,10 +19594,467 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for wchar_t" >&5
+$as_echo_n "checking for wchar_t... " >&6; }
+if test "${ac_cv_type_wchar_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_wchar_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (wchar_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((wchar_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_wchar_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
+$as_echo "$ac_cv_type_wchar_t" >&6; }
+if test $ac_cv_type_wchar_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5
+$as_echo_n "checking size of wchar_t... " >&6; }
+if test "${ac_cv_sizeof_wchar_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_wchar_t=$ac_lo;;
+'') if test "$ac_cv_type_wchar_t" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (wchar_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (wchar_t))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (wchar_t))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (wchar_t))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_wchar_t=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_wchar_t" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
+$as_echo "$ac_cv_sizeof_wchar_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -22991,20 +20081,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_header_time=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_header_time=no
@@ -23012,8 +20103,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
if test $ac_cv_header_time = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -23025,10 +20116,10 @@ fi
# Checks for library functions.
if test $ac_cv_c_compiler_gnu = yes; then
- { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
-echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
if test "${ac_cv_prog_gcc_traditional+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_pattern="Autoconf.*'x'"
cat >conftest.$ac_ext <<_ACEOF
@@ -23067,17 +20158,17 @@ rm -f conftest*
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
-echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
-{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5
-echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5
+$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -23100,46 +20191,50 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_header_sys_types_h_makedev=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_header_sys_types_h_makedev=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
-echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
+$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
if test $ac_cv_header_sys_types_h_makedev = no; then
if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
-echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+$as_echo_n "checking for sys/mkdev.h... " >&6; }
if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+$as_echo "$ac_cv_header_sys_mkdev_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
-echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
+$as_echo_n "checking sys/mkdev.h usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -23155,32 +20250,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
-echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
+$as_echo_n "checking sys/mkdev.h presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -23194,51 +20290,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -23247,15 +20344,15 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
-echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+$as_echo_n "checking for sys/mkdev.h... " >&6; }
if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_header_sys_mkdev_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+$as_echo "$ac_cv_header_sys_mkdev_h" >&6; }
fi
if test $ac_cv_header_sys_mkdev_h = yes; then
@@ -23270,17 +20367,17 @@ fi
if test $ac_cv_header_sys_mkdev_h = no; then
if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
-echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+$as_echo_n "checking for sys/sysmacros.h... " >&6; }
if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
-echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
+$as_echo_n "checking sys/sysmacros.h usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -23296,32 +20393,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
-echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
+$as_echo_n "checking sys/sysmacros.h presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -23335,51 +20433,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -23388,15 +20487,15 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
-echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+$as_echo_n "checking for sys/sysmacros.h... " >&6; }
if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_header_sys_sysmacros_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; }
fi
if test $ac_cv_header_sys_sysmacros_h = yes; then
@@ -23411,10 +20510,10 @@ fi
fi
fi
-{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
if test "${ac_cv_sys_largefile_source+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
@@ -23423,11 +20522,13 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -23438,26 +20539,30 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_sys_largefile_source=no; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
@@ -23467,11 +20572,13 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE_SOURCE 1
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -23482,34 +20589,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_sys_largefile_source=1; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
ac_cv_sys_largefile_source=unknown
break
done
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
+$as_echo "$ac_cv_sys_largefile_source" >&6; }
case $ac_cv_sys_largefile_source in #(
no | unknown) ;;
*)
@@ -23518,7 +20629,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
;;
esac
-rm -f conftest*
+rm -rf conftest*
# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
# in glibc 2.1.3, but that breaks too many other things.
@@ -23531,10 +20642,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for working memcmp" >&5
-echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for working memcmp" >&5
+$as_echo_n "checking for working memcmp... " >&6; }
if test "${ac_cv_func_memcmp_working+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_memcmp_working=no
@@ -23584,36 +20695,39 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_memcmp_working=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_memcmp_working=no
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
-echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+$as_echo "$ac_cv_func_memcmp_working" >&6; }
test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
*" memcmp.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
@@ -23621,10 +20735,10 @@ test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
esac
-{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
+$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; }
if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
rm -f conftest.sym conftest.file
echo >conftest.file
@@ -23657,29 +20771,32 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_lstat_dereferences_slashed_symlink=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_lstat_dereferences_slashed_symlink=no
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
@@ -23692,8 +20809,8 @@ fi
rm -f conftest.sym conftest.file
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
@@ -23711,10 +20828,10 @@ esac
fi
-{ echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5
-echo $ECHO_N "checking whether lstat accepts an empty string... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5
+$as_echo_n "checking whether lstat accepts an empty string... " >&6; }
if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_lstat_empty_string_bug=yes
@@ -23741,36 +20858,39 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_lstat_empty_string_bug=no
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_lstat_empty_string_bug=yes
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5
-echo "${ECHO_T}$ac_cv_func_lstat_empty_string_bug" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_lstat_empty_string_bug" >&6; }
if test $ac_cv_func_lstat_empty_string_bug = yes; then
case " $LIBOBJS " in
*" lstat.$ac_objext "* ) ;;
@@ -23785,10 +20905,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
-echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
+$as_echo_n "checking whether stat accepts an empty string... " >&6; }
if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_stat_empty_string_bug=yes
@@ -23815,36 +20935,39 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_stat_empty_string_bug=no
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_stat_empty_string_bug=yes
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
-echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
if test $ac_cv_func_stat_empty_string_bug = yes; then
case " $LIBOBJS " in
*" stat.$ac_objext "* ) ;;
@@ -23859,10 +20982,10 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
-echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
+$as_echo_n "checking whether strerror_r is declared... " >&6; }
if test "${ac_cv_have_decl_strerror_r+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -23888,20 +21011,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_strerror_r=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_strerror_r=no
@@ -23909,8 +21033,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
+$as_echo "$ac_cv_have_decl_strerror_r" >&6; }
if test $ac_cv_have_decl_strerror_r = yes; then
cat >>confdefs.h <<_ACEOF
@@ -23930,11 +21054,11 @@ fi
for ac_func in strerror_r
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -23987,44 +21111,50 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
-{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
-echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
if test "${ac_cv_func_strerror_r_char_p+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_func_strerror_r_char_p=no
@@ -24055,20 +21185,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_func_strerror_r_char_p=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -24109,27 +21240,30 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_strerror_r_char_p=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
@@ -24137,8 +21271,8 @@ fi
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
-echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
if test $ac_cv_func_strerror_r_char_p = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -24150,11 +21284,11 @@ fi
for ac_func in strftime
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24207,43 +21341,49 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else
# strftime is in -lintl on SCO UNIX.
-{ echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
if test "${ac_cv_lib_intl_strftime+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
@@ -24275,32 +21415,36 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_intl_strftime=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_intl_strftime=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
if test $ac_cv_lib_intl_strftime = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRFTIME 1
@@ -24315,11 +21459,11 @@ done
for ac_func in vprintf
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24372,41 +21516,47 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-{ echo "$as_me:$LINENO: checking for _doprnt" >&5
-echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _doprnt" >&5
+$as_echo_n "checking for _doprnt... " >&6; }
if test "${ac_cv_func__doprnt+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24459,31 +21609,35 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_func__doprnt=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func__doprnt=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
-echo "${ECHO_T}$ac_cv_func__doprnt" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+$as_echo "$ac_cv_func__doprnt" >&6; }
if test $ac_cv_func__doprnt = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -24496,22 +21650,95 @@ fi
done
+# check for:
+# CreateHardLinkA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES)
+# To avoid necessity for including windows.h or special forward declaration
+# workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *'
+{ $as_echo "$as_me:$LINENO: checking for CreateHardLinkA" >&5
+$as_echo_n "checking for CreateHardLinkA... " >&6; }
+if test "${ac_cv_func_CreateHardLinkA+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char __stdcall CreateHardLinkA ( const char *, const char *, void * ) below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char __stdcall CreateHardLinkA ( const char *, const char *, void * );
+char (*f) ( const char *, const char *, void * );
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_CreateHardLinkA) || defined (__stub___CreateHardLinkA)
+choke me
+#else
+f = CreateHardLinkA;
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_func_CreateHardLinkA=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_func_CreateHardLinkA=no
+fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_CreateHardLinkA" >&5
+$as_echo "$ac_cv_func_CreateHardLinkA" >&6; }
-
-for ac_func in chflags chown chroot fchdir fchflags fchmod fchown fcntl fork
+for ac_func in chflags chown chroot
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24564,35 +21791,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -24604,13 +21837,13 @@ done
-for ac_func in fstat ftruncate futimes geteuid getopt_long getpid
+for ac_func in fchdir fchflags fchmod fchown fcntl fork
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24663,35 +21896,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -24700,13 +21939,16 @@ done
-for ac_func in lchflags lchmod lchown
+
+
+
+for ac_func in fstat ftruncate futimens futimes geteuid getpid
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24759,35 +22001,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -24798,14 +22046,13 @@ done
-
-for ac_func in lutimes memmove memset mkdir mkfifo mknod
+for ac_func in lchflags lchmod lchown link lstat
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24858,35 +22105,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -24898,13 +22151,13 @@ done
-for ac_func in nl_langinfo pipe poll select setenv setlocale
+for ac_func in lutimes memmove memset mkdir mkfifo mknod
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -24957,35 +22210,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -24995,14 +22254,13 @@ done
-
-for ac_func in strchr strdup strerror strrchr timegm
+for ac_func in nl_langinfo pipe poll readlink
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25055,35 +22313,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -25093,14 +22357,13 @@ done
-
-for ac_func in tzset unsetenv utime utimes vfork
+for ac_func in select setenv setlocale sigaction
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25153,35 +22416,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -25192,13 +22461,15 @@ done
-for ac_func in wcscpy wcslen wctomb wmemcmp wmemcpy
+
+
+for ac_func in strchr strdup strerror strncpy_s strrchr symlink timegm
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25251,48 +22522,59 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
-# FreeBSD's nl_langinfo supports an option to specify whether the
-# current locale uses month/day or day/month ordering. It makes the
-# output a little prettier...
-{ echo "$as_me:$LINENO: checking whether D_MD_ORDER is declared" >&5
-echo $ECHO_N "checking whether D_MD_ORDER is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_D_MD_ORDER+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+for ac_func in tzset unsetenv utime utimensat utimes vfork
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25300,74 +22582,104 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#if HAVE_LANGINFO_H
-#include <langinfo.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
#endif
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
int
main ()
{
-#ifndef D_MD_ORDER
- (void) D_MD_ORDER;
-#endif
-
+return $ac_func ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_D_MD_ORDER=yes
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_have_decl_D_MD_ORDER=no
+ eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_D_MD_ORDER" >&5
-echo "${ECHO_T}$ac_cv_have_decl_D_MD_ORDER" >&6; }
-if test $ac_cv_have_decl_D_MD_ORDER = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_D_MD_ORDER 1
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
+done
-# If fnmatch() exists and supports FNM_LEADING_DIR, then bsdtar uses that,
-# otherwise it uses some usable (but less featureful) built-in code for
-# filename pattern matching.
-{ echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5
-echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6; }
-if test "${ac_cv_func_fnmatch_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Some versions of Solaris, SCO, and the GNU C Library
- # have a broken or incompatible fnmatch.
- # So we run a test program. If we are cross-compiling, take no chance.
- # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
- if test "$cross_compiling" = yes; then
- ac_cv_func_fnmatch_works=cross
+
+
+
+
+
+for ac_func in wcrtomb wcscpy wcslen wctomb wmemcmp wmemcpy
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25375,75 +22687,200 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <fnmatch.h>
-# define y(a, b, c) (fnmatch (a, b, c) == 0)
-# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
int
main ()
{
-return
- (!(y ("a*", "abc", 0)
- && n ("d*/*1", "d/s/1", FNM_PATHNAME)
- && y ("a\\\\bc", "abc", 0)
- && n ("a\\\\bc", "abc", FNM_NOESCAPE)
- && y ("*x", ".x", 0)
- && n ("*x", ".x", FNM_PERIOD)
- && 1));
+return $ac_func ();
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+# detects cygwin-1.7, as opposed to older versions
+
+for ac_func in cygwin_conv_path
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_fnmatch_works=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-ac_cv_func_fnmatch_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ eval "$as_ac_var=no"
fi
-
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5
-echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6; }
-if test $ac_cv_func_fnmatch_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FNMATCH 1
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
+done
-
-{ echo "$as_me:$LINENO: checking whether FNM_LEADING_DIR is declared" >&5
-echo $ECHO_N "checking whether FNM_LEADING_DIR is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_FNM_LEADING_DIR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# FreeBSD's nl_langinfo supports an option to specify whether the
+# current locale uses month/day or day/month ordering. It makes the
+# output a little prettier...
+{ $as_echo "$as_me:$LINENO: checking whether D_MD_ORDER is declared" >&5
+$as_echo_n "checking whether D_MD_ORDER is declared... " >&6; }
+if test "${ac_cv_have_decl_D_MD_ORDER+set}" = set; then
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25451,17 +22888,16 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#if HAVE_FNMATCH
-#define _GNU_SOURCE /* Required on Linux to get GNU extensions */
-#include <fnmatch.h>
+#if HAVE_LANGINFO_H
+#include <langinfo.h>
#endif
int
main ()
{
-#ifndef FNM_LEADING_DIR
- (void) FNM_LEADING_DIR;
+#ifndef D_MD_ORDER
+ (void) D_MD_ORDER;
#endif
;
@@ -25474,33 +22910,34 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_have_decl_FNM_LEADING_DIR=yes
+ ac_cv_have_decl_D_MD_ORDER=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_have_decl_FNM_LEADING_DIR=no
+ ac_cv_have_decl_D_MD_ORDER=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_FNM_LEADING_DIR" >&5
-echo "${ECHO_T}$ac_cv_have_decl_FNM_LEADING_DIR" >&6; }
-if test $ac_cv_have_decl_FNM_LEADING_DIR = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_D_MD_ORDER" >&5
+$as_echo "$ac_cv_have_decl_D_MD_ORDER" >&6; }
+if test $ac_cv_have_decl_D_MD_ORDER = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_FNM_LEADING_DIR 1
+#define HAVE_D_MD_ORDER 1
_ACEOF
fi
@@ -25509,10 +22946,10 @@ fi
# Check for dirent.d_namlen field explicitly
# (This is a bit more straightforward than, if not quite as portable as,
# the recipe given by the autoconf maintainers.)
-{ echo "$as_me:$LINENO: checking for struct dirent.d_namlen" >&5
-echo $ECHO_N "checking for struct dirent.d_namlen... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct dirent.d_namlen" >&5
+$as_echo_n "checking for struct dirent.d_namlen... " >&6; }
if test "${ac_cv_member_struct_dirent_d_namlen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25541,20 +22978,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_dirent_d_namlen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
@@ -25584,20 +23022,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_dirent_d_namlen=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_dirent_d_namlen=no
@@ -25608,8 +23047,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_namlen" >&5
-echo "${ECHO_T}$ac_cv_member_struct_dirent_d_namlen" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_namlen" >&5
+$as_echo "$ac_cv_member_struct_dirent_d_namlen" >&6; }
# Check for Extended Attributes support
@@ -25623,20 +23062,171 @@ if test "x$enable_xattr" != "xno"; then
for ac_header in attr/xattr.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/xattr.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -25652,32 +23242,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -25691,51 +23282,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -25744,21 +23336,23 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -25766,10 +23360,10 @@ fi
done
-{ echo "$as_me:$LINENO: checking for setxattr in -lattr" >&5
-echo $ECHO_N "checking for setxattr in -lattr... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for setxattr in -lattr" >&5
+$as_echo_n "checking for setxattr in -lattr... " >&6; }
if test "${ac_cv_lib_attr_setxattr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lattr $LIBS"
@@ -25801,32 +23395,36 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_attr_setxattr=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_attr_setxattr=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_attr_setxattr" >&5
-echo "${ECHO_T}$ac_cv_lib_attr_setxattr" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_attr_setxattr" >&5
+$as_echo "$ac_cv_lib_attr_setxattr" >&6; }
if test $ac_cv_lib_attr_setxattr = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBATTR 1
@@ -25838,17 +23436,318 @@ fi
+for ac_func in extattr_get_file extattr_list_file
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in extattr_set_fd extattr_set_file
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fsetxattr getxattr
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef $ac_func
-for ac_func in getxattr lgetxattr listxattr llistxattr fsetxattr lsetxattr
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+for ac_func in lgetxattr listxattr llistxattr lsetxattr
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25901,35 +23800,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -25954,20 +23859,21 @@ if test "x$enable_acl" != "xno"; then
for ac_header in sys/acl.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -25983,32 +23889,33 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -26022,51 +23929,52 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ----------------------------------- ##
## Report this to kientzle@freebsd.org ##
@@ -26075,21 +23983,23 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -26097,10 +24007,10 @@ fi
done
-{ echo "$as_me:$LINENO: checking for acl_get_file in -lacl" >&5
-echo $ECHO_N "checking for acl_get_file in -lacl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for acl_get_file in -lacl" >&5
+$as_echo_n "checking for acl_get_file in -lacl... " >&6; }
if test "${ac_cv_lib_acl_acl_get_file+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lacl $LIBS"
@@ -26132,32 +24042,36 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
ac_cv_lib_acl_acl_get_file=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_acl_acl_get_file=no
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5
-echo "${ECHO_T}$ac_cv_lib_acl_acl_get_file" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5
+$as_echo "$ac_cv_lib_acl_acl_get_file" >&6; }
if test $ac_cv_lib_acl_acl_get_file = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBACL 1
@@ -26174,11 +24088,11 @@ fi
for ac_func in acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -26231,47 +24145,54 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
- { echo "$as_me:$LINENO: checking for acl_permset_t" >&5
-echo $ECHO_N "checking for acl_permset_t... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for acl_permset_t" >&5
+$as_echo_n "checking for acl_permset_t... " >&6; }
if test "${ac_cv_type_acl_permset_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_cv_type_acl_permset_t=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -26285,14 +24206,52 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
-typedef acl_permset_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (acl_permset_t))
+ return 0;
+ ;
return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+
+
+int
+main ()
+{
+if (sizeof ((acl_permset_t)))
+ return 0;
;
return 0;
}
@@ -26303,29 +24262,38 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_acl_permset_t=yes
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_acl_permset_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_acl_permset_t=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_acl_permset_t" >&5
-echo "${ECHO_T}$ac_cv_type_acl_permset_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_acl_permset_t" >&5
+$as_echo "$ac_cv_type_acl_permset_t" >&6; }
if test $ac_cv_type_acl_permset_t = yes; then
cat >>confdefs.h <<_ACEOF
@@ -26343,13 +24311,15 @@ fi
# Test for both as a double-check that we really have POSIX-style ACL support.
-for ac_func in acl_get_perm_np acl_get_perm
+
+
+for ac_func in acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -26402,35 +24372,41 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
eval "$as_ac_var=yes"
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
+rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -26439,10 +24415,10 @@ done
# MacOS has an acl.h that isn't POSIX. It can be detected by
# checking for ACL_USER
- { echo "$as_me:$LINENO: checking whether ACL_USER is declared" >&5
-echo $ECHO_N "checking whether ACL_USER is declared... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether ACL_USER is declared" >&5
+$as_echo_n "checking whether ACL_USER is declared... " >&6; }
if test "${ac_cv_have_decl_ACL_USER+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -26469,20 +24445,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_decl_ACL_USER=yes
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_ACL_USER=no
@@ -26490,8 +24467,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ACL_USER" >&5
-echo "${ECHO_T}$ac_cv_have_decl_ACL_USER" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_ACL_USER" >&5
+$as_echo "$ac_cv_have_decl_ACL_USER" >&6; }
if test $ac_cv_have_decl_ACL_USER = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -26510,10 +24487,10 @@ fi
if test "$enable_largefile" != no; then
- { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
if test "${ac_cv_sys_largefile_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
@@ -26550,20 +24527,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26577,20 +24555,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_largefile_CC=' -n32'; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26603,16 +24582,16 @@ rm -f core conftest.err conftest.$ac_objext
rm -f conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
if test "$ac_cv_sys_largefile_CC" != no; then
CC=$CC$ac_cv_sys_largefile_CC
fi
- { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
if test "${ac_cv_sys_file_offset_bits+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
@@ -26644,20 +24623,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_file_offset_bits=no; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26694,20 +24674,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_file_offset_bits=64; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26718,8 +24699,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
break
done
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
case $ac_cv_sys_file_offset_bits in #(
no | unknown) ;;
*)
@@ -26728,12 +24709,12 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
;;
esac
-rm -f conftest*
+rm -rf conftest*
if test $ac_cv_sys_file_offset_bits = unknown; then
- { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
if test "${ac_cv_sys_large_files+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
@@ -26765,20 +24746,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_large_files=no; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26815,20 +24797,21 @@ case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_large_files=1; break
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -26839,8 +24822,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
break
done
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
case $ac_cv_sys_large_files in #(
no | unknown) ;;
*)
@@ -26849,149 +24832,11 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
;;
esac
-rm -f conftest*
+rm -rf conftest*
fi
fi
-# Interix doesn't provide optarg and optind
-{ echo "$as_me:$LINENO: checking whether optarg is declared" >&5
-echo $ECHO_N "checking whether optarg is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_optarg+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef optarg
- (void) optarg;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_optarg=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_optarg=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optarg" >&5
-echo "${ECHO_T}$ac_cv_have_decl_optarg" >&6; }
-if test $ac_cv_have_decl_optarg = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTARG 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTARG 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether optind is declared" >&5
-echo $ECHO_N "checking whether optind is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_optind+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef optind
- (void) optind;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_optind=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_optind=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optind" >&5
-echo "${ECHO_T}$ac_cv_have_decl_optind" >&6; }
-if test $ac_cv_have_decl_optind = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTIND 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTIND 0
-_ACEOF
-
-
-fi
-
-
-
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -27019,11 +24864,12 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
@@ -27056,12 +24902,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -27077,7 +24923,7 @@ ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -27088,62 +24934,70 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+if test -z "${INC_WINDOWS_FILES_TRUE}" && test -z "${INC_WINDOWS_FILES_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"INC_WINDOWS_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
+$as_echo "$as_me: error: conditional \"INC_WINDOWS_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+if test -z "${INC_CYGWIN_FILES_TRUE}" && test -z "${INC_CYGWIN_FILES_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"INC_CYGWIN_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+$as_echo "$as_me: error: conditional \"INC_CYGWIN_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${BUILD_BSDTAR_TRUE}" && test -z "${BUILD_BSDTAR_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"BUILD_BSDTAR\" was never defined.
+ { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_BSDTAR\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"BUILD_BSDTAR\" was never defined.
+$as_echo "$as_me: error: conditional \"BUILD_BSDTAR\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${STATIC_BSDTAR_TRUE}" && test -z "${STATIC_BSDTAR_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"STATIC_BSDTAR\" was never defined.
+ { { $as_echo "$as_me:$LINENO: error: conditional \"STATIC_BSDTAR\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"STATIC_BSDTAR\" was never defined.
+$as_echo "$as_me: error: conditional \"STATIC_BSDTAR\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${BUILD_BSDCPIO_TRUE}" && test -z "${BUILD_BSDCPIO_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"BUILD_BSDCPIO\" was never defined.
+ { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_BSDCPIO\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"BUILD_BSDCPIO\" was never defined.
+$as_echo "$as_me: error: conditional \"BUILD_BSDCPIO\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${STATIC_BSDCPIO_TRUE}" && test -z "${STATIC_BSDCPIO_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"STATIC_BSDCPIO\" was never defined.
+ { { $as_echo "$as_me:$LINENO: error: conditional \"STATIC_BSDCPIO\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"STATIC_BSDCPIO\" was never defined.
+$as_echo "$as_me: error: conditional \"STATIC_BSDCPIO\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -27156,7 +25010,7 @@ ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
@@ -27166,7 +25020,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
@@ -27188,17 +25042,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
# Support unset when possible.
@@ -27214,8 +25096,6 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
@@ -27238,7 +25118,7 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
@@ -27251,17 +25131,10 @@ PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -27283,7 +25156,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -27334,7 +25207,7 @@ $as_unset CDPATH
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
@@ -27362,7 +25235,6 @@ case `echo -n x` in
*)
ECHO_N='-n';;
esac
-
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -27375,19 +25247,22 @@ if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
@@ -27412,10 +25287,10 @@ else
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
case $1 in
- -*)set "./$1";;
+ -*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
@@ -27437,8 +25312,8 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libarchive $as_me 2.5.5, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+This file was extended by libarchive $as_me 2.8.0, which was
+generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -27451,7 +25326,7 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
@@ -27459,7 +25334,7 @@ config_commands="$ac_config_commands"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
@@ -27472,9 +25347,9 @@ Usage: $0 [OPTIONS] [FILE]...
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -27488,13 +25363,13 @@ $config_commands
Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-libarchive config.status 2.5.5
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+libarchive config.status 2.8.0
+configured by $0, generated by GNU Autoconf 2.62,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2008 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -27502,11 +25377,12 @@ ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
@@ -27528,30 +25404,36 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
+ $as_echo "$ac_cs_version"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
+ { $as_echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; };;
--help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
+ $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
@@ -27570,35 +25452,293 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ exec "\$@"
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- echo "$ac_log"
+ $as_echo "$ac_log"
} >&5
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+ ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
@@ -27606,10 +25746,12 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "build/pkgconfig/libarchive.pc") CONFIG_FILES="$CONFIG_FILES build/pkgconfig/libarchive.pc" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
@@ -27650,224 +25792,143 @@ $debug ||
(umask 077 && mkdir "$tmp")
} ||
{
- echo "$me: cannot create a temporary directory in ." >&2
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-ARCHIVE_LIBTOOL_VERSION!$ARCHIVE_LIBTOOL_VERSION$ac_delim
-BSDCPIO_VERSION_STRING!$BSDCPIO_VERSION_STRING$ac_delim
-BSDTAR_VERSION_STRING!$BSDTAR_VERSION_STRING$ac_delim
-LIBARCHIVE_VERSION_STRING!$LIBARCHIVE_VERSION_STRING$ac_delim
-LIBARCHIVE_VERSION_NUMBER!$LIBARCHIVE_VERSION_NUMBER$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-YACC!$YACC$ac_delim
-YFLAGS!$YFLAGS$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LN_S!$LN_S$ac_delim
-ECHO!$ECHO$ac_delim
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-CPP!$CPP$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
+ac_cr=' '
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
fi
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
_ACEOF
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-BUILD_BSDTAR_TRUE!$BUILD_BSDTAR_TRUE$ac_delim
-BUILD_BSDTAR_FALSE!$BUILD_BSDTAR_FALSE$ac_delim
-STATIC_BSDTAR_TRUE!$STATIC_BSDTAR_TRUE$ac_delim
-STATIC_BSDTAR_FALSE!$STATIC_BSDTAR_FALSE$ac_delim
-BUILD_BSDCPIO_TRUE!$BUILD_BSDCPIO_TRUE$ac_delim
-BUILD_BSDCPIO_FALSE!$BUILD_BSDCPIO_FALSE$ac_delim
-STATIC_BSDCPIO_TRUE!$STATIC_BSDCPIO_TRUE$ac_delim
-STATIC_BSDCPIO_FALSE!$STATIC_BSDCPIO_FALSE$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
break
elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
{ (exit 1); exit 1; }; }
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+ print line
+}
+
+_ACAWK
_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
_ACEOF
-
# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
@@ -27883,19 +25944,133 @@ s/^[^=]*=[ ]*$//
}'
fi
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", line, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+ { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
{ (exit 1); exit 1; }; };;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -27924,26 +26099,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
{ (exit 1); exit 1; }; };;
esac
- ac_file_inputs="$ac_file_inputs $ac_f"
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
esac
;;
esac
@@ -27953,7 +26140,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -27979,7 +26166,7 @@ echo X"$ac_file" |
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -27988,7 +26175,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -28009,17 +26196,17 @@ echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -28064,12 +26251,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
esac
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
p
q
}
@@ -28078,13 +26266,14 @@ case `sed -n '/datarootdir/ {
/@infodir@/p
/@localedir@/p
/@mandir@/p
-' $ac_file_inputs` in
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
@@ -28098,15 +26287,16 @@ _ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -28117,135 +26307,75 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&2;}
rm -f "$tmp/stdin"
case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
;;
:H)
#
# CONFIG_HEADER
#
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
fi
else
- echo "/* $configure_input */"
- cat "$ac_result"
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+ { (exit 1); exit 1; }; }
fi
- rm -f "$tmp/out12"
-# Compute $ac_file's index in $config_headers.
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $ac_file | $ac_file:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
-echo X$ac_file |
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -28265,8 +26395,8 @@ echo X$ac_file |
s/.*/./; q'`/stamp-h$_am_stamp_count
;;
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -28282,13 +26412,13 @@ echo "$as_me: executing $ac_file commands" >&6;}
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
+$as_echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -28332,7 +26462,7 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
+$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -28358,7 +26488,7 @@ echo X"$file" |
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -28367,7 +26497,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -28388,14 +26518,655 @@ echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Assembler program.
+AS=$AS
+
+# DLL creation program.
+DLLTOOL=$DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$OBJDUMP
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
esac
done # for ac_tag
@@ -28406,6 +27177,11 @@ _ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -28427,4 +27203,8 @@ if test "$no_create" != yes; then
# would make configure fail if this is the last instruction.
$ac_cs_success || { (exit 1); exit 1; }
fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
diff --git a/archivers/libarchive/files/configure.ac b/archivers/libarchive/files/configure.ac
index 317947b1d5d..f0f8e321150 100644
--- a/archivers/libarchive/files/configure.ac
+++ b/archivers/libarchive/files/configure.ac
@@ -4,13 +4,12 @@ dnl First, define all of the version numbers up front.
dnl In particular, this allows the version macro to be used in AC_INIT
dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[2.5.5])
-m4_define([LIBARCHIVE_VERSION_N],[2005005])
+m4_define([LIBARCHIVE_VERSION_S],[2.8.0])
+m4_define([LIBARCHIVE_VERSION_N],[2008000])
-dnl bsdtar versioning tracks libarchive
+dnl bsdtar and bsdcpio versioning tracks libarchive
m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
-dnl bsdcpio is still versioning separately, as it's less mature.
-m4_define([BSDCPIO_VERSION_S],[1.0.0])
+m4_define([BSDCPIO_VERSION_S],LIBARCHIVE_VERSION_S())
#
# Now starts the "real" configure script.
@@ -20,7 +19,9 @@ AC_INIT([libarchive],LIBARCHIVE_VERSION_S(),[kientzle@freebsd.org])
# Make sure the srcdir contains "libarchive" directory
AC_CONFIG_SRCDIR([libarchive])
# Use auxiliary subscripts from this subdirectory (cleans up root)
-AC_CONFIG_AUX_DIR([config.aux])
+AC_CONFIG_AUX_DIR([build/autoconf])
+# M4 scripts
+AC_CONFIG_MACRO_DIR([build/autoconf])
# Must follow AC_CONFIG macros above...
AM_INIT_AUTOMAKE()
@@ -63,11 +64,33 @@ AC_SUBST(LIBARCHIVE_VERSION_NUMBER)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([build/pkgconfig/libarchive.pc])
+
+# Check for host type
+AC_CANONICAL_HOST
+
+dnl Compilation on mingw and Cygwin needs special Makefile rules
+inc_windows_files=no
+inc_cygwin_files=no
+case "$host_os" in
+ *mingw* ) inc_windows_files=yes ;;
+ *cygwin*) inc_cygwin_files=yes ;;
+esac
+AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes])
+AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
+
+dnl Defines that are required for specific platforms (e.g. -D_POSIX_SOURCE, etc)
+PLATFORMCPPFLAGS=
+case "$host_os" in
+ *mingw* ) PLATFORMCPPFLAGS=-D__USE_MINGW_ANSI_STDIO ;;
+esac
+AC_SUBST(PLATFORMCPPFLAGS)
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
-AC_PROG_YACC
+AC_USE_SYSTEM_EXTENSIONS
+AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_CHECK_TOOL([STRIP],[strip])
@@ -121,11 +144,11 @@ AM_CONDITIONAL([STATIC_BSDTAR], [ test "$static_bsdtar" = yes ])
# Default is not to build bsdcpio, but that can be overridden.
#
AC_ARG_ENABLE([bsdcpio],
- [AS_HELP_STRING([--enable-bsdcpio], [enable build of bsdcpio])
+ [AS_HELP_STRING([--enable-bsdcpio], [enable build of bsdcpio (default)])
AS_HELP_STRING([--enable-bsdcpio=static], [static build of bsdcpio])
AS_HELP_STRING([--enable-bsdcpio=shared], [dynamic build of bsdcpio])
-AS_HELP_STRING([--disable-bsdcpio], [disable build of bsdcpio (default)])],
- [], [enable_bsdcpio=no])
+AS_HELP_STRING([--disable-bsdcpio], [disable build of bsdcpio])],
+ [], [enable_bsdcpio=yes])
case "$enable_bsdcpio" in
yes)
@@ -158,20 +181,130 @@ esac
AM_CONDITIONAL([BUILD_BSDCPIO], [ test "$build_bsdcpio" = yes ])
AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
+# Set up defines needed before including any headers
+case $host in
+ *mingw* | *cygwin* )
+ AC_DEFINE([_WIN32_WINNT], 0x0500, [Define to '0x0500' for Windows 2000 APIs.])
+ AC_DEFINE([WINVER], 0x0500, [Define to '0x0500' for Windows 2000 APIs.])
+ ;;
+esac
+
# Checks for header files.
-AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([bzlib.h errno.h ext2fs/ext2_fs.h fcntl.h grp.h])
-AC_CHECK_HEADERS([inttypes.h langinfo.h limits.h linux/fs.h])
-AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h stdarg.h])
-AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/acl.h sys/ioctl.h])
+AC_CHECK_HEADERS([acl/libacl.h attr/xattr.h ctype.h errno.h])
+AC_CHECK_HEADERS([ext2fs/ext2_fs.h fcntl.h grp.h])
+AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h linux/fs.h])
+AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h])
+AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
+AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h sys/ioctl.h sys/mkdev.h])
AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h])
-AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h zlib.h])
+AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h windows.h])
# Checks for libraries.
-AC_CHECK_LIB(bz2,BZ2_bzDecompressInit)
-AC_CHECK_LIB(z,inflate)
+AC_ARG_WITH([zlib],
+ AS_HELP_STRING([--without-zlib], [Don't build support for gzip through zlib]))
+
+if test "x$with_zlib" != "xno"; then
+ AC_CHECK_HEADERS([zlib.h])
+ AC_CHECK_LIB(z,inflate)
+fi
+
+AC_ARG_WITH([bz2lib],
+ AS_HELP_STRING([--without-bz2lib], [Don't build support for bzip2 through bz2lib]))
+
+if test "x$with_bz2lib" != "xno"; then
+ AC_CHECK_HEADERS([bzlib.h])
+ AC_CHECK_LIB(bz2,BZ2_bzDecompressInit)
+fi
+
+AC_ARG_WITH([lzmadec],
+ AS_HELP_STRING([--without-lzmadec], [Don't build support for lzma through lzmadec]))
+
+if test "x$with_lzmadec" != "xno"; then
+ AC_CHECK_HEADERS([lzmadec.h])
+ AC_CHECK_LIB(lzmadec,lzmadec_decode)
+fi
+
+AC_ARG_WITH([lzma],
+ AS_HELP_STRING([--without-lzma], [Don't build support for xz through lzma]))
+
+if test "x$with_lzma" != "xno"; then
+ AC_CHECK_HEADERS([lzma.h])
+ AC_CHECK_LIB(lzma,lzma_stream_decoder)
+fi
+
+AC_ARG_WITH([openssl],
+ AS_HELP_STRING([--without-openssl], [Don't build support for mtree and xar hashes through openssl]))
+
+AC_ARG_WITH([xml2],
+ AS_HELP_STRING([--without-xml2], [Don't build support for xar through libxml2]))
+AC_ARG_WITH([expat],
+ AS_HELP_STRING([--without-expat], [Don't build support for xar through expat]))
+
+if test "x$with_xml2" != "xno"; then
+ AC_PATH_PROG([XML2_CONFIG], [xml2-config],, [${PATH}])
+ if test "x$XML2_CONFIG" != "x"; then
+ CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
+ LIBS="${LIBS} `${XML2_CONFIG} --libs`"
+ fi
+ AC_CHECK_HEADERS([libxml/xmlreader.h])
+ AC_CHECK_LIB(xml2,xmlInitParser)
+fi
+if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then
+ if test "x$with_expat" != "xno"; then
+ AC_CHECK_HEADERS([expat.h])
+ AC_CHECK_LIB(expat,XML_ParserCreate)
+ fi
+fi
+
+AC_CHECK_HEADERS([md5.h ripemd.h rmd160.h sha.h sha1.h sha2.h sha256.h])
+# Common names for libc implementation on NetBSD and OpenBSD
+AC_CHECK_FUNCS(MD5Init RMD160Init SHA1Init)
+# SHA2 on NetBSD and older OpenBSD
+AC_CHECK_FUNCS(SHA256_Init SHA384_Init SHA512_Init)
+# SHA2 on newer OpenBSD
+AC_CHECK_FUNCS(SHA256Init SHA384Init SHA512Init)
+
+if test "x$with_openssl" != "xno"; then
+ if test "$ac_cv_func_MD5Init" != "yes"; then
+ AC_CHECK_HEADERS([openssl/md5.h])
+ AC_SEARCH_LIBS([MD5_Init], [crypto])
+ fi
+ if test "$ac_cv_func_RMD160Init" != "yes"; then
+ AC_CHECK_HEADERS([openssl/ripemd.h])
+ AC_SEARCH_LIBS([RIPEMD160_Init], [crypto])
+ fi
+ if test "$ac_cv_func_SHA1Init" != "yes"; then
+ AC_CHECK_HEADERS([openssl/sha.h])
+ AC_SEARCH_LIBS([SHA1_Init], [crypto])
+ fi
+ if test "$ac_cv_func_SHA256Init" != "yes" ||
+ test "$ac_cv_func_SHA384Init" != "yes" ||
+ test "$ac_cv_func_SHA512Init" != "yes"; then
+ if test "$ac_cv_func_SHA256_Init" != "yes" ||
+ test "$ac_cv_func_SHA384_Init" != "yes" ||
+ test "$ac_cv_func_SHA512_Init" != "yes"; then
+ AC_CHECK_HEADERS([openssl/sha.h])
+ # TODO: Does AC_SEARCH_LIBS support more than one function at once?
+ # This appears to always fail.
+ AC_SEARCH_LIBS([SHA256_Init SHA384_Init SHA512_Init], [crypto])
+
+ # TODO: Actually test for these. Previously our C code did not
+ # test for these at all and just assumed availability. Now that
+ # the C code tests these macros we preserve previous behavior
+ # for the autotools build by hard-coding availability.
+ if test "$ac_cv_header_openssl_sha_h" = "yes"; then
+ AC_DEFINE(HAVE_OPENSSL_SHA256_INIT, 1,
+ [Define to 1 if your openssl has the `SHA256_Init' function.])
+ AC_DEFINE(HAVE_OPENSSL_SHA384_INIT, 1,
+ [Define to 1 if your openssl has the `SHA384_Init' function.])
+ AC_DEFINE(HAVE_OPENSSL_SHA512_INIT, 1,
+ [Define to 1 if your openssl has the `SHA512_Init' function.])
+ fi
+ fi
+ fi
+fi
# TODO: Give the user the option of using a pre-existing system
# libarchive. This will define HAVE_LIBARCHIVE which will cause
@@ -182,7 +315,9 @@ AC_CHECK_LIB(z,inflate)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
-AC_TYPE_UID_T
+# AC_TYPE_UID_T defaults to "int", which is incorrect for MinGW
+# and MSVC. Use a customized version.
+la_TYPE_UID_T
AC_TYPE_MODE_T
# AC_TYPE_OFF_T defaults to "long", which limits us to 4GB files on
# most systems... default to "long long" instead.
@@ -190,9 +325,21 @@ AC_CHECK_TYPE(off_t, [long long])
AC_TYPE_SIZE_T
AC_CHECK_TYPE(id_t, [unsigned long])
AC_CHECK_TYPE(uintptr_t, [unsigned int])
+
+# Check for birthtime in struct stat
+AC_CHECK_MEMBERS([struct stat.st_birthtime])
+
# Check for high-resolution timestamps in struct stat
+AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
+AC_CHECK_MEMBERS([struct stat.st_mtime_n]) # AIX
+AC_CHECK_MEMBERS([struct stat.st_umtime]) # Tru64
+AC_CHECK_MEMBERS([struct stat.st_mtime_usec]) # Hurd
+# Check for block size support in struct stat
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+# Check for st_flags in struct stat (BSD fflags)
+AC_CHECK_MEMBERS([struct stat.st_flags])
# If you have uintmax_t, we assume printf supports %ju
# If you have unsigned long long, we assume printf supports %llu
@@ -206,7 +353,7 @@ AC_TYPE_UINTMAX_T
AC_TYPE_UINT64_T
# TODO: If any of these are missing, define them right here.
-AC_CHECK_DECLS([SIZE_MAX, INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX])
+AC_CHECK_DECLS([SIZE_MAX, SSIZE_MAX, INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX])
AC_CHECK_DECL([EFTYPE],
[AC_DEFINE(HAVE_EFTYPE, 1, [A possible errno value for invalid file format errors])],
@@ -216,6 +363,11 @@ AC_CHECK_DECL([EILSEQ],
[AC_DEFINE(HAVE_EILSEQ, 1, [A possible errno value for invalid file format errors])],
[],
[#include <errno.h>])
+AC_CHECK_TYPE([wchar_t],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]wchar_t), 1, [Define to 1 if the system has the type `wchar_t'.])dnl
+ AC_CHECK_SIZEOF([wchar_t])],
+ [])
+
AC_HEADER_TIME
# Checks for library functions.
@@ -228,14 +380,23 @@ AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chflags chown chroot fchdir fchflags fchmod fchown fcntl fork])
-AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getopt_long getpid])
-AC_CHECK_FUNCS([lchflags lchmod lchown])
+# check for:
+# CreateHardLinkA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES)
+# To avoid necessity for including windows.h or special forward declaration
+# workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *'
+AC_CHECK_STDCALL_FUNC([CreateHardLinkA],[const char *, const char *, void *])
+AC_CHECK_FUNCS([chflags chown chroot])
+AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fork])
+AC_CHECK_FUNCS([fstat ftruncate futimens futimes geteuid getpid])
+AC_CHECK_FUNCS([lchflags lchmod lchown link lstat])
AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
-AC_CHECK_FUNCS([nl_langinfo pipe poll select setenv setlocale])
-AC_CHECK_FUNCS([strchr strdup strerror strrchr timegm])
-AC_CHECK_FUNCS([tzset unsetenv utime utimes vfork])
-AC_CHECK_FUNCS([wcscpy wcslen wctomb wmemcmp wmemcpy])
+AC_CHECK_FUNCS([nl_langinfo pipe poll readlink])
+AC_CHECK_FUNCS([select setenv setlocale sigaction])
+AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm])
+AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork])
+AC_CHECK_FUNCS([wcrtomb wcscpy wcslen wctomb wmemcmp wmemcpy])
+# detects cygwin-1.7, as opposed to older versions
+AC_CHECK_FUNCS([cygwin_conv_path])
# FreeBSD's nl_langinfo supports an option to specify whether the
# current locale uses month/day or day/month ordering. It makes the
@@ -248,19 +409,6 @@ AC_CHECK_DECL([D_MD_ORDER],
#endif
])
-# If fnmatch() exists and supports FNM_LEADING_DIR, then bsdtar uses that,
-# otherwise it uses some usable (but less featureful) built-in code for
-# filename pattern matching.
-AC_FUNC_FNMATCH
-AC_CHECK_DECL([FNM_LEADING_DIR],
-[AC_DEFINE(HAVE_FNM_LEADING_DIR, 1, [Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag])],
-[],
-[#if HAVE_FNMATCH
-#define _GNU_SOURCE /* Required on Linux to get GNU extensions */
-#include <fnmatch.h>
-#endif
-])
-
# Check for dirent.d_namlen field explicitly
# (This is a bit more straightforward than, if not quite as portable as,
# the recipe given by the autoconf maintainers.)
@@ -277,8 +425,12 @@ AC_ARG_ENABLE([xattr],
if test "x$enable_xattr" != "xno"; then
AC_CHECK_HEADERS([attr/xattr.h])
+ AC_CHECK_HEADERS([sys/xattr.h])
AC_CHECK_LIB(attr,setxattr)
- AC_CHECK_FUNCS([getxattr lgetxattr listxattr llistxattr fsetxattr lsetxattr])
+ AC_CHECK_FUNCS([extattr_get_file extattr_list_file])
+ AC_CHECK_FUNCS([extattr_set_fd extattr_set_file])
+ AC_CHECK_FUNCS([fsetxattr getxattr])
+ AC_CHECK_FUNCS([lgetxattr listxattr llistxattr lsetxattr])
fi
# Check for ACL support
@@ -311,7 +463,7 @@ if test "x$enable_acl" != "xno"; then
# test for specific permissions in a permset.) Linux uses the obvious
# name, FreeBSD adds _np to mark it as "non-Posix extension."
# Test for both as a double-check that we really have POSIX-style ACL support.
- AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm,,,
+ AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np,,,
[#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -331,8 +483,4 @@ fi
# Additional requirements
AC_SYS_LARGEFILE
-# Interix doesn't provide optarg and optind
-AC_CHECK_DECLS([optarg])
-AC_CHECK_DECLS([optind])
-
AC_OUTPUT
diff --git a/archivers/libarchive/files/contrib/libarchive.1aix53.spec b/archivers/libarchive/files/contrib/libarchive.1aix53.spec
index 78718852f86..fce82e52aca 100644
--- a/archivers/libarchive/files/contrib/libarchive.1aix53.spec
+++ b/archivers/libarchive/files/contrib/libarchive.1aix53.spec
@@ -1,4 +1,4 @@
-# $Revision: 1.1.1.1 $, $Date: 2007/11/30 21:25:32 $
+# $LastChangedRevision: 1827 $, $LastChangedDate: 2010-01-16 16:21:36 -0800 (Sat, 16 Jan 2010) $
Summary: Library to create and read several different archive formats
Summary(pl): Biblioteka do tworzenia i odczytu ró¿nych formatów archiwów
Name: libarchive
@@ -127,8 +127,29 @@ rm -fr %buildroot
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log: libarchive.1aix53.spec,v $
-Revision 1.1.1.1 2007/11/30 21:25:32 joerg
-Import libarchive-2.4.0
+Revision 1.1.1.2 2010/02/20 03:49:41 joerg
+Import libarchive 2.8.0:
+- Infrastructure:
+ - Allow command line tools as fallback for missing compression
+ libraries. If compiled without gzip for example, gunzip will
+ be used automatically.
+ - Improved support for a number of platforms like high-resolution
+ timestamps and Extended Attributes on various Unix systems
+ - New convience interface for creating archives based on disk content,
+ complement of the archive_write_disk interface.
+- Frontends:
+ - bsdcpio ready for public consumption
+ - hand-written date parser replaces the yacc code
+- Filter system:
+ - Simplified read filter chains
+ - Option support for filters
+ - LZMA, XZ, uudecode handled
+- Format support:
+ - Write support for mtree files based on file system or archive
+ content
+ - Basic read support for Joliet
+ - Write support for zip files
+ - Write support for shar archives, both text-only and binary-safe
Release 1aix53 2006/12/12 rm1023@dcx.com
- tweak for aix-5.3
diff --git a/archivers/libarchive/files/contrib/libarchive.spec b/archivers/libarchive/files/contrib/libarchive.spec
index caa5ebc02d7..420f3145df9 100644
--- a/archivers/libarchive/files/contrib/libarchive.spec
+++ b/archivers/libarchive/files/contrib/libarchive.spec
@@ -1,4 +1,4 @@
-# $Revision: 1.1.1.1 $, $Date: 2007/11/30 21:25:32 $
+# $LastChangedRevision: 1827 $, $LastChangedDate: 2010-01-16 16:21:36 -0800 (Sat, 16 Jan 2010) $
Summary: Library to create and read several different archive formats
Summary(pl): Biblioteka do tworzenia i odczytu ró¿nych formatów archiwów
Name: libarchive
@@ -115,8 +115,29 @@ rm -fr %buildroot
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log: libarchive.spec,v $
-Revision 1.1.1.1 2007/11/30 21:25:32 joerg
-Import libarchive-2.4.0
+Revision 1.1.1.2 2010/02/20 03:49:41 joerg
+Import libarchive 2.8.0:
+- Infrastructure:
+ - Allow command line tools as fallback for missing compression
+ libraries. If compiled without gzip for example, gunzip will
+ be used automatically.
+ - Improved support for a number of platforms like high-resolution
+ timestamps and Extended Attributes on various Unix systems
+ - New convience interface for creating archives based on disk content,
+ complement of the archive_write_disk interface.
+- Frontends:
+ - bsdcpio ready for public consumption
+ - hand-written date parser replaces the yacc code
+- Filter system:
+ - Simplified read filter chains
+ - Option support for filters
+ - LZMA, XZ, uudecode handled
+- Format support:
+ - Write support for mtree files based on file system or archive
+ content
+ - Basic read support for Joliet
+ - Write support for zip files
+ - Write support for shar archives, both text-only and binary-safe
Release 1 2006/12/12 rm1023@dcx.com
- added libarchive-0123457890.patch for "0123457890" error
diff --git a/archivers/libarchive/files/contrib/shar/shar.1 b/archivers/libarchive/files/contrib/shar/shar.1
new file mode 100644
index 00000000000..e3152f299eb
--- /dev/null
+++ b/archivers/libarchive/files/contrib/shar/shar.1
@@ -0,0 +1,128 @@
+.\" Copyright (c) 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)shar.1 8.1 (Berkeley) 6/6/93
+.\" $FreeBSD$
+.\"
+.Dd April 17, 2008
+.Dt SHAR 1
+.Os
+.Sh NAME
+.Nm shar
+.Nd create a shell archive of files
+.Sh SYNOPSIS
+.Nm
+.Op Fl br
+.Op Fl o Ar archive-file
+.Ar
+.Sh DESCRIPTION
+The
+.Nm
+command writes a
+.Xr sh 1
+shell script which will recreate the file hierarchy specified by the command
+line operands.
+.Pp
+The
+.Nm
+command is normally used for distributing files by
+.Xr ftp 1
+or
+.Xr mail 1 .
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl b
+Use an alternative binary format. Content of files will be uuencoded.
+This option should be used to archive binary files correctly.
+In this mode also file permissions will be stored to the archive.
+uudecode(1) is needed to extract archives created with this option.
+.It Fl o Ar archive-file
+Redirect output to
+.Ar archive-file .
+.It Fl r
+If
+.Ar file
+given on command line is a directory the entire subtree will be archived.
+Symbolic links given on command line are followed. Other symbolic links will
+be archived as such.
+.El
+.Sh EXAMPLES
+To create a shell archive of the program
+.Xr ls 1
+and mail it to Rick:
+.Bd -literal -offset indent
+cd ls
+shar -r . \&| mail -s "ls source" rick
+.Ed
+.Pp
+To recreate the program directory:
+.Bd -literal -offset indent
+mkdir ls
+cd ls
+\&...
+<delete header lines and examine mailed archive>
+\&...
+sh archive
+.Ed
+.Sh SEE ALSO
+.Xr compress 1 ,
+.Xr mail 1 ,
+.Xr tar 1 ,
+.Xr uuencode 1 ,
+.Xr uuencode 5
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.Bx 4.4 .
+This is a re-implementation based on the libarchive(3) library.
+.Sh BUGS
+The
+.Nm
+command makes no provisions for hard links.
+.Pp
+Files containing magic characters or files without a newline ('\\n') as the
+last character are not handled correctly with the default format. Use the -b
+option for binary files.
+.Pp
+It is easy to insert trojan horses into
+.Nm
+files.
+It is strongly recommended that all shell archive files be examined
+before running them through
+.Xr sh 1 .
+Archives produced using this implementation of
+.Nm
+may be easily examined with the command:
+.Bd -literal -offset indent
+egrep -v '^[X#]' shar.file
+.Ed
diff --git a/archivers/libarchive/files/contrib/shar/shar.c b/archivers/libarchive/files/contrib/shar/shar.c
new file mode 100644
index 00000000000..12c84255309
--- /dev/null
+++ b/archivers/libarchive/files/contrib/shar/shar.c
@@ -0,0 +1,314 @@
+/*-
+ * Copyright (c) 2008 Jaakko Heinonen
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifdef __FBSDID
+__FBSDID("$FreeBSD$");
+#endif
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <archive.h>
+#include <archive_entry.h>
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#include "tree.h"
+
+/* command line options */
+static int b_opt; /* use alternative shar binary format */
+static int r_opt; /* recurse into subdirectories */
+static char *o_arg; /* output file name */
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: shar [-br] [-o filename] file ...\n");
+ exit(EX_USAGE);
+}
+
+/*
+ * Initialize archive structure and create a shar archive.
+ */
+static struct archive *
+shar_create(void)
+{
+ struct archive *a;
+
+ if ((a = archive_write_new()) == NULL)
+ errx(EXIT_FAILURE, "%s", archive_error_string(a));
+
+ if (b_opt)
+ archive_write_set_format_shar_dump(a);
+ else
+ archive_write_set_format_shar(a);
+ archive_write_set_compression_none(a);
+
+ if (archive_write_open_filename(a, o_arg) != ARCHIVE_OK)
+ errx(EX_CANTCREAT, "%s", archive_error_string(a));
+
+ return (a);
+}
+
+/* buffer for file data */
+static char buffer[32768];
+
+/*
+ * Write file data to an archive entry.
+ */
+static int
+shar_write_entry_data(struct archive *a, const int fd)
+{
+ ssize_t bytes_read, bytes_written;
+
+ assert(a != NULL);
+ assert(fd >= 0);
+
+ bytes_read = read(fd, buffer, sizeof(buffer));
+ while (bytes_read != 0) {
+ if (bytes_read < 0) {
+ archive_set_error(a, errno, "Read failed");
+ return (ARCHIVE_WARN);
+ }
+ bytes_written = archive_write_data(a, buffer, bytes_read);
+ if (bytes_written < 0)
+ return (ARCHIVE_WARN);
+ bytes_read = read(fd, buffer, sizeof(buffer));
+ }
+
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Write a file to the archive. We have special handling for symbolic links.
+ */
+static int
+shar_write_entry(struct archive *a, const char *pathname, const char *accpath,
+ const struct stat *st)
+{
+ struct archive_entry *entry;
+ int fd = -1;
+ int ret = ARCHIVE_OK;
+
+ assert(a != NULL);
+ assert(pathname != NULL);
+ assert(accpath != NULL);
+ assert(st != NULL);
+
+ entry = archive_entry_new();
+
+ if (S_ISREG(st->st_mode) && st->st_size > 0) {
+ /* regular file */
+ if ((fd = open(accpath, O_RDONLY)) == -1) {
+ warn("%s", accpath);
+ ret = ARCHIVE_WARN;
+ goto out;
+ }
+ } else if (S_ISLNK(st->st_mode)) {
+ /* symbolic link */
+ char lnkbuff[PATH_MAX + 1];
+ int lnklen;
+ if ((lnklen = readlink(accpath, lnkbuff, PATH_MAX)) == -1) {
+ warn("%s", accpath);
+ ret = ARCHIVE_WARN;
+ goto out;
+ }
+ lnkbuff[lnklen] = '\0';
+ archive_entry_set_symlink(entry, lnkbuff);
+ }
+ archive_entry_copy_stat(entry, st);
+ archive_entry_set_pathname(entry, pathname);
+ if (!S_ISREG(st->st_mode) || st->st_size == 0)
+ archive_entry_set_size(entry, 0);
+ if (archive_write_header(a, entry) != ARCHIVE_OK) {
+ warnx("%s: %s", pathname, archive_error_string(a));
+ ret = ARCHIVE_WARN;
+ goto out;
+ }
+ if (fd >= 0) {
+ if ((ret = shar_write_entry_data(a, fd)) != ARCHIVE_OK)
+ warnx("%s: %s", accpath, archive_error_string(a));
+ }
+out:
+ archive_entry_free(entry);
+ if (fd >= 0)
+ close(fd);
+
+ return (ret);
+}
+
+/*
+ * Write singe path to the archive. The path can be a regular file, directory
+ * or device. Symbolic links are followed.
+ */
+static int
+shar_write_path(struct archive *a, const char *pathname)
+{
+ struct stat st;
+
+ assert(a != NULL);
+ assert(pathname != NULL);
+
+ if ((stat(pathname, &st)) == -1) {
+ warn("%s", pathname);
+ return (ARCHIVE_WARN);
+ }
+
+ return (shar_write_entry(a, pathname, pathname, &st));
+}
+
+/*
+ * Write tree to the archive. If pathname is a symbolic link it will be
+ * followed. Other symbolic links are stored as such to the archive.
+ */
+static int
+shar_write_tree(struct archive *a, const char *pathname)
+{
+ struct tree *t;
+ const struct stat *lst, *st;
+ int error = 0;
+ int tree_ret;
+ int first;
+
+ assert(a != NULL);
+ assert(pathname != NULL);
+
+ t = tree_open(pathname);
+ for (first = 1; (tree_ret = tree_next(t)); first = 0) {
+ if (tree_ret == TREE_ERROR_DIR) {
+ warnx("%s: %s", tree_current_path(t),
+ strerror(tree_errno(t)));
+ error = 1;
+ continue;
+ } else if (tree_ret != TREE_REGULAR)
+ continue;
+ if ((lst = tree_current_lstat(t)) == NULL) {
+ warn("%s", tree_current_path(t));
+ error = 1;
+ continue;
+ }
+ /*
+ * If the symlink was given on command line then
+ * follow it rather than write it as symlink.
+ */
+ if (first && S_ISLNK(lst->st_mode)) {
+ if ((st = tree_current_stat(t)) == NULL) {
+ warn("%s", tree_current_path(t));
+ error = 1;
+ continue;
+ }
+ } else
+ st = lst;
+
+ if (shar_write_entry(a, tree_current_path(t),
+ tree_current_access_path(t), st) != ARCHIVE_OK)
+ error = 1;
+
+ tree_descend(t);
+ }
+
+ tree_close(t);
+
+ return ((error != 0) ? ARCHIVE_WARN : ARCHIVE_OK);
+}
+
+/*
+ * Create a shar archive and write files/trees into it.
+ */
+static int
+shar_write(char **fn, size_t nfn)
+{
+ struct archive *a;
+ size_t i;
+ int error = 0;
+
+ assert(fn != NULL);
+ assert(nfn > 0);
+
+ a = shar_create();
+
+ for (i = 0; i < nfn; i++) {
+ if (r_opt) {
+ if (shar_write_tree(a, fn[i]) != ARCHIVE_OK)
+ error = 1;
+ } else {
+ if (shar_write_path(a, fn[i]) != ARCHIVE_OK)
+ error = 1;
+ }
+ }
+
+ if (archive_write_finish(a) != ARCHIVE_OK)
+ errx(EXIT_FAILURE, "%s", archive_error_string(a));
+
+ if (error != 0)
+ warnx("Error exit delayed from previous errors.");
+
+ return (error);
+}
+
+int
+main(int argc, char **argv)
+{
+ int opt;
+
+ while ((opt = getopt(argc, argv, "bro:")) != -1) {
+ switch (opt) {
+ case 'b':
+ b_opt = 1;
+ break;
+ case 'o':
+ o_arg = optarg;
+ break;
+ case 'r':
+ r_opt = 1;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if(argc < 1)
+ usage();
+
+ if (shar_write(argv, argc) != 0)
+ exit(EXIT_FAILURE);
+ else
+ exit(EXIT_SUCCESS);
+ /* NOTREACHED */
+}
+
diff --git a/archivers/libarchive/files/contrib/shar/tree.c b/archivers/libarchive/files/contrib/shar/tree.c
new file mode 100644
index 00000000000..d5a04abf5f4
--- /dev/null
+++ b/archivers/libarchive/files/contrib/shar/tree.c
@@ -0,0 +1,542 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * This is a new directory-walking system that addresses a number
+ * of problems I've had with fts(3). In particular, it has no
+ * pathname-length limits (other than the size of 'int'), handles
+ * deep logical traversals, uses considerably less memory, and has
+ * an opaque interface (easier to modify in the future).
+ *
+ * Internally, it keeps a single list of "tree_entry" items that
+ * represent filesystem objects that require further attention.
+ * Non-directories are not kept in memory: they are pulled from
+ * readdir(), returned to the client, then freed as soon as possible.
+ * Any directory entry to be traversed gets pushed onto the stack.
+ *
+ * There is surprisingly little information that needs to be kept for
+ * each item on the stack. Just the name, depth (represented here as the
+ * string length of the parent directory's pathname), and some markers
+ * indicating how to get back to the parent (via chdir("..") for a
+ * regular dir or via fchdir(2) for a symlink).
+ */
+#include "tree_config.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "tree.h"
+
+/*
+ * TODO:
+ * 1) Loop checking.
+ * 3) Arbitrary logical traversals by closing/reopening intermediate fds.
+ */
+
+struct tree_entry {
+ struct tree_entry *next;
+ struct tree_entry *parent;
+ char *name;
+ size_t dirname_length;
+ dev_t dev;
+ ino_t ino;
+ int fd;
+ int flags;
+};
+
+/* Definitions for tree_entry.flags bitmap. */
+#define isDir 1 /* This entry is a regular directory. */
+#define isDirLink 2 /* This entry is a symbolic link to a directory. */
+#define needsPreVisit 4 /* This entry needs to be previsited. */
+#define needsPostVisit 8 /* This entry needs to be postvisited. */
+
+/*
+ * Local data for this package.
+ */
+struct tree {
+ struct tree_entry *stack;
+ struct tree_entry *current;
+ DIR *d;
+ int initialDirFd;
+ int flags;
+ int visit_type;
+ int tree_errno; /* Error code from last failed operation. */
+
+ char *buff;
+ const char *basename;
+ size_t buff_length;
+ size_t path_length;
+ size_t dirname_length;
+
+ int depth;
+ int openCount;
+ int maxOpenCount;
+
+ struct stat lst;
+ struct stat st;
+};
+
+/* Definitions for tree.flags bitmap. */
+#define needsReturn 8 /* Marks first entry as not having been returned yet. */
+#define hasStat 16 /* The st entry is set. */
+#define hasLstat 32 /* The lst entry is set. */
+
+
+#ifdef HAVE_DIRENT_D_NAMLEN
+/* BSD extension; avoids need for a strlen() call. */
+#define D_NAMELEN(dp) (dp)->d_namlen
+#else
+#define D_NAMELEN(dp) (strlen((dp)->d_name))
+#endif
+
+#if 0
+#include <stdio.h>
+void
+tree_dump(struct tree *t, FILE *out)
+{
+ struct tree_entry *te;
+
+ fprintf(out, "\tdepth: %d\n", t->depth);
+ fprintf(out, "\tbuff: %s\n", t->buff);
+ fprintf(out, "\tpwd: "); fflush(stdout); system("pwd");
+ fprintf(out, "\taccess: %s\n", t->basename);
+ fprintf(out, "\tstack:\n");
+ for (te = t->stack; te != NULL; te = te->next) {
+ fprintf(out, "\t\tte->name: %s%s%s\n", te->name,
+ te->flags & needsPreVisit ? "" : " *",
+ t->current == te ? " (current)" : "");
+ }
+}
+#endif
+
+/*
+ * Add a directory path to the current stack.
+ */
+static void
+tree_push(struct tree *t, const char *path)
+{
+ struct tree_entry *te;
+
+ te = malloc(sizeof(*te));
+ memset(te, 0, sizeof(*te));
+ te->next = t->stack;
+ t->stack = te;
+ te->fd = -1;
+ te->name = strdup(path);
+ te->flags = needsPreVisit | needsPostVisit;
+ te->dirname_length = t->dirname_length;
+}
+
+/*
+ * Append a name to the current path.
+ */
+static void
+tree_append(struct tree *t, const char *name, size_t name_length)
+{
+ char *p;
+
+ if (t->buff != NULL)
+ t->buff[t->dirname_length] = '\0';
+ /* Strip trailing '/' from name, unless entire name is "/". */
+ while (name_length > 1 && name[name_length - 1] == '/')
+ name_length--;
+
+ /* Resize pathname buffer as needed. */
+ while (name_length + 1 + t->dirname_length >= t->buff_length) {
+ t->buff_length *= 2;
+ if (t->buff_length < 1024)
+ t->buff_length = 1024;
+ t->buff = realloc(t->buff, t->buff_length);
+ }
+ p = t->buff + t->dirname_length;
+ t->path_length = t->dirname_length + name_length;
+ /* Add a separating '/' if it's needed. */
+ if (t->dirname_length > 0 && p[-1] != '/') {
+ *p++ = '/';
+ t->path_length ++;
+ }
+ strncpy(p, name, name_length);
+ p[name_length] = '\0';
+ t->basename = p;
+}
+
+/*
+ * Open a directory tree for traversal.
+ */
+struct tree *
+tree_open(const char *path)
+{
+ struct tree *t;
+
+ t = malloc(sizeof(*t));
+ memset(t, 0, sizeof(*t));
+ tree_append(t, path, strlen(path));
+ t->initialDirFd = open(".", O_RDONLY);
+ /*
+ * During most of the traversal, items are set up and then
+ * returned immediately from tree_next(). That doesn't work
+ * for the very first entry, so we set a flag for this special
+ * case.
+ */
+ t->flags = needsReturn;
+ return (t);
+}
+
+/*
+ * We've finished a directory; ascend back to the parent.
+ */
+static void
+tree_ascend(struct tree *t)
+{
+ struct tree_entry *te;
+
+ te = t->stack;
+ t->depth--;
+ if (te->flags & isDirLink) {
+ fchdir(te->fd);
+ close(te->fd);
+ t->openCount--;
+ } else {
+ chdir("..");
+ }
+}
+
+/*
+ * Pop the working stack.
+ */
+static void
+tree_pop(struct tree *t)
+{
+ struct tree_entry *te;
+
+ t->buff[t->dirname_length] = '\0';
+ if (t->stack == t->current && t->current != NULL)
+ t->current = t->current->parent;
+ te = t->stack;
+ t->stack = te->next;
+ t->dirname_length = te->dirname_length;
+ t->basename = t->buff + t->dirname_length;
+ /* Special case: starting dir doesn't skip leading '/'. */
+ if (t->dirname_length > 0)
+ t->basename++;
+ free(te->name);
+ free(te);
+}
+
+/*
+ * Get the next item in the tree traversal.
+ */
+int
+tree_next(struct tree *t)
+{
+ struct dirent *de = NULL;
+
+ /* Handle the startup case by returning the initial entry. */
+ if (t->flags & needsReturn) {
+ t->flags &= ~needsReturn;
+ return (t->visit_type = TREE_REGULAR);
+ }
+
+ while (t->stack != NULL) {
+ /* If there's an open dir, get the next entry from there. */
+ while (t->d != NULL) {
+ de = readdir(t->d);
+ if (de == NULL) {
+ closedir(t->d);
+ t->d = NULL;
+ } else if (de->d_name[0] == '.'
+ && de->d_name[1] == '\0') {
+ /* Skip '.' */
+ } else if (de->d_name[0] == '.'
+ && de->d_name[1] == '.'
+ && de->d_name[2] == '\0') {
+ /* Skip '..' */
+ } else {
+ /*
+ * Append the path to the current path
+ * and return it.
+ */
+ tree_append(t, de->d_name, D_NAMELEN(de));
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ return (t->visit_type = TREE_REGULAR);
+ }
+ }
+
+ /* If the current dir needs to be visited, set it up. */
+ if (t->stack->flags & needsPreVisit) {
+ t->current = t->stack;
+ tree_append(t, t->stack->name, strlen(t->stack->name));
+ t->stack->flags &= ~needsPreVisit;
+ /* If it is a link, set up fd for the ascent. */
+ if (t->stack->flags & isDirLink) {
+ t->stack->fd = open(".", O_RDONLY);
+ t->openCount++;
+ if (t->openCount > t->maxOpenCount)
+ t->maxOpenCount = t->openCount;
+ }
+ t->dirname_length = t->path_length;
+ if (chdir(t->stack->name) != 0) {
+ /* chdir() failed; return error */
+ tree_pop(t);
+ t->tree_errno = errno;
+ return (t->visit_type = TREE_ERROR_DIR);
+ }
+ t->depth++;
+ t->d = opendir(".");
+ if (t->d == NULL) {
+ tree_ascend(t); /* Undo "chdir" */
+ tree_pop(t);
+ t->tree_errno = errno;
+ return (t->visit_type = TREE_ERROR_DIR);
+ }
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ t->basename = ".";
+ return (t->visit_type = TREE_POSTDESCENT);
+ }
+
+ /* We've done everything necessary for the top stack entry. */
+ if (t->stack->flags & needsPostVisit) {
+ tree_ascend(t);
+ tree_pop(t);
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ return (t->visit_type = TREE_POSTASCENT);
+ }
+ }
+ return (t->visit_type = 0);
+}
+
+/*
+ * Return error code.
+ */
+int
+tree_errno(struct tree *t)
+{
+ return (t->tree_errno);
+}
+
+/*
+ * Called by the client to mark the directory just returned from
+ * tree_next() as needing to be visited.
+ */
+void
+tree_descend(struct tree *t)
+{
+ if (t->visit_type != TREE_REGULAR)
+ return;
+
+ if (tree_current_is_physical_dir(t)) {
+ tree_push(t, t->basename);
+ t->stack->flags |= isDir;
+ } else if (tree_current_is_dir(t)) {
+ tree_push(t, t->basename);
+ t->stack->flags |= isDirLink;
+ }
+}
+
+/*
+ * Get the stat() data for the entry just returned from tree_next().
+ */
+const struct stat *
+tree_current_stat(struct tree *t)
+{
+ if (!(t->flags & hasStat)) {
+ if (stat(t->basename, &t->st) != 0)
+ return NULL;
+ t->flags |= hasStat;
+ }
+ return (&t->st);
+}
+
+/*
+ * Get the lstat() data for the entry just returned from tree_next().
+ */
+const struct stat *
+tree_current_lstat(struct tree *t)
+{
+ if (!(t->flags & hasLstat)) {
+ if (lstat(t->basename, &t->lst) != 0)
+ return NULL;
+ t->flags |= hasLstat;
+ }
+ return (&t->lst);
+}
+
+/*
+ * Test whether current entry is a dir or link to a dir.
+ */
+int
+tree_current_is_dir(struct tree *t)
+{
+ const struct stat *st;
+
+ /*
+ * If we already have lstat() info, then try some
+ * cheap tests to determine if this is a dir.
+ */
+ if (t->flags & hasLstat) {
+ /* If lstat() says it's a dir, it must be a dir. */
+ if (S_ISDIR(tree_current_lstat(t)->st_mode))
+ return 1;
+ /* Not a dir; might be a link to a dir. */
+ /* If it's not a link, then it's not a link to a dir. */
+ if (!S_ISLNK(tree_current_lstat(t)->st_mode))
+ return 0;
+ /*
+ * It's a link, but we don't know what it's a link to,
+ * so we'll have to use stat().
+ */
+ }
+
+ st = tree_current_stat(t);
+ /* If we can't stat it, it's not a dir. */
+ if (st == NULL)
+ return 0;
+ /* Use the definitive test. Hopefully this is cached. */
+ return (S_ISDIR(st->st_mode));
+}
+
+/*
+ * Test whether current entry is a physical directory. Usually, we
+ * already have at least one of stat() or lstat() in memory, so we
+ * use tricks to try to avoid an extra trip to the disk.
+ */
+int
+tree_current_is_physical_dir(struct tree *t)
+{
+ const struct stat *st;
+
+ /*
+ * If stat() says it isn't a dir, then it's not a dir.
+ * If stat() data is cached, this check is free, so do it first.
+ */
+ if ((t->flags & hasStat)
+ && (!S_ISDIR(tree_current_stat(t)->st_mode)))
+ return 0;
+
+ /*
+ * Either stat() said it was a dir (in which case, we have
+ * to determine whether it's really a link to a dir) or
+ * stat() info wasn't available. So we use lstat(), which
+ * hopefully is already cached.
+ */
+
+ st = tree_current_lstat(t);
+ /* If we can't stat it, it's not a dir. */
+ if (st == NULL)
+ return 0;
+ /* Use the definitive test. Hopefully this is cached. */
+ return (S_ISDIR(st->st_mode));
+}
+
+/*
+ * Test whether current entry is a symbolic link.
+ */
+int
+tree_current_is_physical_link(struct tree *t)
+{
+ const struct stat *st = tree_current_lstat(t);
+ if (st == NULL)
+ return 0;
+ return (S_ISLNK(st->st_mode));
+}
+
+/*
+ * Return the access path for the entry just returned from tree_next().
+ */
+const char *
+tree_current_access_path(struct tree *t)
+{
+ return (t->basename);
+}
+
+/*
+ * Return the full path for the entry just returned from tree_next().
+ */
+const char *
+tree_current_path(struct tree *t)
+{
+ return (t->buff);
+}
+
+/*
+ * Return the length of the path for the entry just returned from tree_next().
+ */
+size_t
+tree_current_pathlen(struct tree *t)
+{
+ return (t->path_length);
+}
+
+/*
+ * Return the nesting depth of the entry just returned from tree_next().
+ */
+int
+tree_current_depth(struct tree *t)
+{
+ return (t->depth);
+}
+
+/*
+ * Terminate the traversal and release any resources.
+ */
+void
+tree_close(struct tree *t)
+{
+ /* Release anything remaining in the stack. */
+ while (t->stack != NULL)
+ tree_pop(t);
+ if (t->buff)
+ free(t->buff);
+ /* chdir() back to where we started. */
+ if (t->initialDirFd >= 0) {
+ fchdir(t->initialDirFd);
+ close(t->initialDirFd);
+ t->initialDirFd = -1;
+ }
+ free(t);
+}
diff --git a/archivers/libarchive/files/contrib/shar/tree.h b/archivers/libarchive/files/contrib/shar/tree.h
new file mode 100644
index 00000000000..ff38f5346c1
--- /dev/null
+++ b/archivers/libarchive/files/contrib/shar/tree.h
@@ -0,0 +1,115 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*-
+ * A set of routines for traversing directory trees.
+ * Similar in concept to the fts library, but with a few
+ * important differences:
+ * * Uses less memory. In particular, fts stores an entire directory
+ * in memory at a time. This package only keeps enough subdirectory
+ * information in memory to track the traversal. Information
+ * about non-directories is discarded as soon as possible.
+ * * Supports very deep logical traversals. The fts package
+ * uses "non-chdir" approach for logical traversals. This
+ * package does use a chdir approach for logical traversals
+ * and can therefore handle pathnames much longer than
+ * PATH_MAX.
+ * * Supports deep physical traversals "out of the box."
+ * Due to the memory optimizations above, there's no need to
+ * limit dir names to 32k.
+ */
+
+#include <sys/stat.h>
+#include <stdio.h>
+
+struct tree;
+
+/* Initiate/terminate a tree traversal. */
+struct tree *tree_open(const char * /* pathname */);
+void tree_close(struct tree *);
+
+/*
+ * tree_next() returns Zero if there is no next entry, non-zero if there is.
+ * Note that directories are potentially visited three times. The first
+ * time as "regular" file. If tree_descend() is invoked at that time,
+ * the directory is added to a work list and will be visited two more
+ * times: once just after descending into the directory and again
+ * just after ascending back to the parent.
+ *
+ * TREE_ERROR is returned if the descent failed (because the
+ * directory couldn't be opened, for instance). This is returned
+ * instead of TREE_PREVISIT/TREE_POSTVISIT.
+ */
+#define TREE_REGULAR 1
+#define TREE_POSTDESCENT 2
+#define TREE_POSTASCENT 3
+#define TREE_ERROR_DIR -1
+int tree_next(struct tree *);
+
+int tree_errno(struct tree *);
+
+/*
+ * Request that current entry be visited. If you invoke it on every
+ * directory, you'll get a physical traversal. This is ignored if the
+ * current entry isn't a directory or a link to a directory. So, if
+ * you invoke this on every returned path, you'll get a full logical
+ * traversal.
+ */
+void tree_descend(struct tree *);
+
+/*
+ * Return information about the current entry.
+ */
+
+int tree_current_depth(struct tree *);
+/*
+ * The current full pathname, length of the full pathname,
+ * and a name that can be used to access the file.
+ * Because tree does use chdir extensively, the access path is
+ * almost never the same as the full current path.
+ */
+const char *tree_current_path(struct tree *);
+size_t tree_current_pathlen(struct tree *);
+const char *tree_current_access_path(struct tree *);
+/*
+ * Request the lstat() or stat() data for the current path. Since the
+ * tree package needs to do some of this anyway, and caches the
+ * results, you should take advantage of it here if you need it rather
+ * than make a redundant stat() or lstat() call of your own.
+ */
+const struct stat *tree_current_stat(struct tree *);
+const struct stat *tree_current_lstat(struct tree *);
+/* The following tests may use mechanisms much faster than stat()/lstat(). */
+/* "is_physical_dir" is equivalent to S_ISDIR(tree_current_lstat()->st_mode) */
+int tree_current_is_physical_dir(struct tree *);
+/* "is_physical_link" is equivalent to S_ISLNK(tree_current_lstat()->st_mode) */
+int tree_current_is_physical_link(struct tree *);
+/* "is_dir" is equivalent to S_ISDIR(tree_current_stat()->st_mode) */
+int tree_current_is_dir(struct tree *);
+
+/* For testing/debugging: Dump the internal status to the given filehandle. */
+void tree_dump(struct tree *, FILE *);
diff --git a/archivers/libarchive/files/contrib/shar/tree_config.h b/archivers/libarchive/files/contrib/shar/tree_config.h
new file mode 100644
index 00000000000..8dfd90baf68
--- /dev/null
+++ b/archivers/libarchive/files/contrib/shar/tree_config.h
@@ -0,0 +1,78 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef TREE_CONFIG_H_INCLUDED
+#define TREE_CONFIG_H_INCLUDED
+
+#if defined(PLATFORM_CONFIG_H)
+/*
+ * Use hand-built config.h in environments that need it.
+ */
+#include PLATFORM_CONFIG_H
+#elif defined(HAVE_CONFIG_H)
+/*
+ * Most POSIX platforms use the 'configure' script to build config.h
+ */
+#include "../config.h"
+#elif defined(__FreeBSD__)
+/*
+ * Built-in definitions for FreeBSD.
+ */
+#define HAVE_DIRENT_D_NAMLEN 1
+#define HAVE_DIRENT_H 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_LIBARCHIVE 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_UNISTD_H 1
+#else
+/*
+ * Warn if there's no platform configuration.
+ */
+#error Oops: No config.h and no built-in configuration in bsdtar_platform.h.
+#endif /* !HAVE_CONFIG_H */
+
+/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
+#ifdef __FreeBSD__
+#include <sys/cdefs.h> /* For __FBSDID */
+#else
+/* Just leaving this macro replacement empty leads to a dangling semicolon. */
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#ifdef HAVE_LIBARCHIVE
+/* If we're using the platform libarchive, include system headers. */
+#include <archive.h>
+#include <archive_entry.h>
+#else
+/* Otherwise, include user headers. */
+#include "archive.h"
+#include "archive_entry.h"
+#endif
+
+#endif /* !TREE_CONFIG_H_INCLUDED */
diff --git a/archivers/libarchive/files/contrib/untar.c b/archivers/libarchive/files/contrib/untar.c
new file mode 100644
index 00000000000..dc092d325e0
--- /dev/null
+++ b/archivers/libarchive/files/contrib/untar.c
@@ -0,0 +1,225 @@
+/*
+ * "untar" is an extremely simple tar extractor:
+ * * A single C source file, so it should be easy to compile
+ * and run on any system with a C compiler.
+ * * Extremely portable standard C. The only non-ANSI function
+ * used is mkdir().
+ * * Reads basic ustar tar archives.
+ * * Does not require libarchive or any other special library.
+ *
+ * To compile: cc -o untar untar.c
+ *
+ * Usage: untar <archive>
+ *
+ * In particular, this program should be sufficient to extract the
+ * distribution for libarchive, allowing people to bootstrap
+ * libarchive on systems that do not already have a tar program.
+ *
+ * To unpack libarchive-x.y.z.tar.gz:
+ * * gunzip libarchive-x.y.z.tar.gz
+ * * untar libarchive-x.y.z.tar
+ *
+ * Written by Tim Kientzle, March 2009.
+ *
+ * Released into the public domain.
+ */
+
+/* These are all highly standard and portable headers. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* This is for mkdir(); this may need to be changed for some platforms. */
+#include <sys/stat.h> /* For mkdir() */
+
+/* Parse an octal number, ignoring leading and trailing nonsense. */
+static int
+parseoct(const char *p, size_t n)
+{
+ int i = 0;
+
+ while (*p < '0' || *p > '7') {
+ ++p;
+ --n;
+ }
+ while (*p >= '0' && *p <= '7' && n > 0) {
+ i *= 8;
+ i += *p - '0';
+ ++p;
+ --n;
+ }
+ return (i);
+}
+
+/* Returns true if this is 512 zero bytes. */
+static int
+is_end_of_archive(const char *p)
+{
+ int n;
+ for (n = 511; n >= 0; --n)
+ if (p[n] != '\0')
+ return (0);
+ return (1);
+}
+
+/* Create a directory, including parent directories as necessary. */
+static void
+create_dir(char *pathname, int mode)
+{
+ char *p;
+ int r;
+
+ /* Strip trailing '/' */
+ if (pathname[strlen(pathname) - 1] == '/')
+ pathname[strlen(pathname) - 1] = '\0';
+
+ /* Try creating the directory. */
+ r = mkdir(pathname, mode);
+
+ if (r != 0) {
+ /* On failure, try creating parent directory. */
+ p = strrchr(pathname, '/');
+ if (p != NULL) {
+ *p = '\0';
+ create_dir(pathname, 0755);
+ *p = '/';
+ r = mkdir(pathname, mode);
+ }
+ }
+ if (r != 0)
+ fprintf(stderr, "Could not create directory %s\n", pathname);
+}
+
+/* Create a file, including parent directory as necessary. */
+static FILE *
+create_file(char *pathname, int mode)
+{
+ FILE *f;
+ f = fopen(pathname, "w+");
+ if (f == NULL) {
+ /* Try creating parent dir and then creating file. */
+ char *p = strrchr(pathname, '/');
+ if (p != NULL) {
+ *p = '\0';
+ create_dir(pathname, 0755);
+ *p = '/';
+ f = fopen(pathname, "w+");
+ }
+ }
+ return (f);
+}
+
+/* Verify the tar checksum. */
+static int
+verify_checksum(const char *p)
+{
+ int n, u = 0;
+ for (n = 0; n < 512; ++n) {
+ if (n < 148 || n > 155)
+ /* Standard tar checksum adds unsigned bytes. */
+ u += ((unsigned char *)p)[n];
+ else
+ u += 0x20;
+
+ }
+ return (u == parseoct(p + 148, 8));
+}
+
+/* Extract a tar archive. */
+static void
+untar(FILE *a, const char *path)
+{
+ char buff[512];
+ FILE *f = NULL;
+ size_t bytes_read;
+ int filesize;
+
+ printf("Extracting from %s\n", path);
+ for (;;) {
+ bytes_read = fread(buff, 1, 512, a);
+ if (bytes_read < 512) {
+ fprintf(stderr,
+ "Short read on %s: expected 512, got %d\n",
+ path, bytes_read);
+ return;
+ }
+ if (is_end_of_archive(buff)) {
+ printf("End of %s\n", path);
+ return;
+ }
+ if (!verify_checksum(buff)) {
+ fprintf(stderr, "Checksum failure\n");
+ return;
+ }
+ filesize = parseoct(buff + 124, 12);
+ switch (buff[156]) {
+ case '1':
+ printf(" Ignoring hardlink %s\n", buff);
+ break;
+ case '2':
+ printf(" Ignoring symlink %s\n", buff);
+ break;
+ case '3':
+ printf(" Ignoring character device %s\n", buff);
+ break;
+ case '4':
+ printf(" Ignoring block device %s\n", buff);
+ break;
+ case '5':
+ printf(" Extracting dir %s\n", buff);
+ create_dir(buff, parseoct(buff + 100, 8));
+ filesize = 0;
+ break;
+ case '6':
+ printf(" Ignoring FIFO %s\n", buff);
+ break;
+ default:
+ printf(" Extracting file %s\n", buff);
+ f = create_file(buff, parseoct(buff + 100, 8));
+ break;
+ }
+ while (filesize > 0) {
+ bytes_read = fread(buff, 1, 512, a);
+ if (bytes_read < 512) {
+ fprintf(stderr,
+ "Short read on %s: Expected 512, got %d\n",
+ path, bytes_read);
+ return;
+ }
+ if (filesize < 512)
+ bytes_read = filesize;
+ if (f != NULL) {
+ if (fwrite(buff, 1, bytes_read, f)
+ != bytes_read)
+ {
+ fprintf(stderr, "Failed write\n");
+ fclose(f);
+ f = NULL;
+ }
+ }
+ filesize -= bytes_read;
+ }
+ if (f != NULL) {
+ fclose(f);
+ f = NULL;
+ }
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ FILE *a;
+
+ ++argv; /* Skip program name */
+ for ( ;*argv != NULL; ++argv) {
+ a = fopen(*argv, "r");
+ if (a == NULL)
+ fprintf(stderr, "Unable to open %s\n", *argv);
+ else {
+ untar(a, *argv);
+ fclose(a);
+ }
+ }
+ return (0);
+}
diff --git a/archivers/libarchive/files/cpio/CMakeLists.txt b/archivers/libarchive/files/cpio/CMakeLists.txt
new file mode 100644
index 00000000000..ce500b1cc6b
--- /dev/null
+++ b/archivers/libarchive/files/cpio/CMakeLists.txt
@@ -0,0 +1,51 @@
+############################################
+#
+# How to build bsdcpio
+#
+############################################
+IF(ENABLE_CPIO)
+
+ SET(bsdcpio_SOURCES
+ cmdline.c
+ cpio.c
+ cpio.h
+ cpio_platform.h
+ ../libarchive_fe/err.c
+ ../libarchive_fe/err.h
+ ../libarchive_fe/lafe_platform.h
+ ../libarchive_fe/line_reader.c
+ ../libarchive_fe/line_reader.h
+ ../libarchive_fe/matching.c
+ ../libarchive_fe/matching.h
+ ../libarchive_fe/pathmatch.c
+ ../libarchive_fe/pathmatch.h
+ )
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)
+ IF(WIN32 AND NOT CYGWIN)
+ LIST(APPEND bsdcpio_SOURCES cpio_windows.c)
+ LIST(APPEND bsdcpio_SOURCES cpio_windows.h)
+ ENDIF(WIN32 AND NOT CYGWIN)
+
+ # bsdcpio documentation
+ SET(bsdcpio_MANS bsdcpio.1)
+
+ # How to build bsdcpio
+ ADD_EXECUTABLE(bsdcpio ${bsdcpio_SOURCES})
+ IF(ENABLE_CPIO_SHARED)
+ TARGET_LINK_LIBRARIES(bsdcpio archive ${ADDITIONAL_LIBS})
+ ELSE(ENABLE_CPIO_SHARED)
+ TARGET_LINK_LIBRARIES(bsdcpio archive_static ${ADDITIONAL_LIBS})
+ SET_TARGET_PROPERTIES(bsdcpio PROPERTIES COMPILE_DEFINITIONS
+ LIBARCHIVE_STATIC)
+ ENDIF(ENABLE_CPIO_SHARED)
+ # Full path to the compiled executable (used by test suite)
+ GET_TARGET_PROPERTY(BSDCPIO bsdcpio LOCATION)
+
+ # Installation rules
+ INSTALL(TARGETS bsdcpio RUNTIME DESTINATION bin)
+ INSTALL_MAN(${bsdcpio_MANS})
+
+ENDIF(ENABLE_CPIO)
+
+# Test suite
+add_subdirectory(test)
diff --git a/archivers/libarchive/files/cpio/bsdcpio.1 b/archivers/libarchive/files/cpio/bsdcpio.1
index d4a18578528..79b6997ef4a 100644
--- a/archivers/libarchive/files/cpio/bsdcpio.1
+++ b/archivers/libarchive/files/cpio/bsdcpio.1
@@ -80,6 +80,9 @@ specified directory.
Unless specifically stated otherwise, options are applicable in
all operating modes.
.Bl -tag -width indent
+.It Fl 0
+Read filenames separated by NUL characters instead of newlines.
+This is necessary if any of the filenames being read might contain newlines.
.It Fl A
(o mode only)
Append to the specified archive.
@@ -142,6 +145,11 @@ for more complete information about the
formats currently supported by the underlying
.Xr libarchive 3
library.
+.It Fl H Ar format
+Synonym for
+.Fl -format .
+.It Fl h , Fl -help
+Print usage information.
.It Fl I Ar file
Read archive from
.Ar file .
@@ -154,6 +162,14 @@ Disable security checks during extraction or copying.
This allows extraction via symbolic links and path names containing
.Sq ..
in the name.
+.It Fl J
+(o mode only)
+Compress the file with xz-compatible compression before writing it.
+In input mode, this option is ignored; xz compression is recognized
+automatically on input.
+.It Fl j
+Synonym for
+.Fl y .
.It Fl L
(o and p modes)
All symbolic links will be followed.
@@ -163,10 +179,28 @@ With this option, the target of the link will be archived or copied instead.
(p mode only)
Create links from the target directory to the original files,
instead of copying.
+.It Fl lzma
+(o mode only)
+Compress the file with lzma-compatible compression before writing it.
+In input mode, this option is ignored; lzma compression is recognized
+automatically on input.
.It Fl m
(i and p modes)
Set file modification time on created files to match
those in the source.
+.It Fl n
+(i mode, only with
+.Fl t )
+Display numeric uid and gid.
+By default,
+.Nm
+displays the user and group names when they are provided in the
+archive, or looks up the user and group names in the system
+password database.
+.It Fl no-preserve-owner
+(i mode only)
+Do not attempt to restore file ownership.
+This is the default when run by non-root users.
.It Fl O Ar file
Write archive to
.Ar file .
@@ -176,6 +210,10 @@ See above for description.
.It Fl p
Pass-through mode.
See above for description.
+.It Fl preserve-owner
+(i mode only)
+Restore file ownership.
+This is the default when run by the root user.
.It Fl -quiet
Suppress unnecessary messages.
.It Fl R Oo user Oc Ns Oo : Oc Ns Oo group Oc
diff --git a/archivers/libarchive/files/cpio/cmdline.c b/archivers/libarchive/files/cpio/cmdline.c
index a602e39c179..2223798c124 100644
--- a/archivers/libarchive/files/cpio/cmdline.c
+++ b/archivers/libarchive/files/cpio/cmdline.c
@@ -26,23 +26,11 @@
#include "cpio_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/cmdline.c,v 1.3 2008/06/21 02:20:20 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/cpio/cmdline.c,v 1.5 2008/12/06 07:30:40 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#ifdef HAVE_GETOPT_LONG
-#include <getopt.h>
-#else
-struct option {
- const char *name;
- int has_arg;
- int *flag;
- int val;
-};
-#define no_argument 0
-#define required_argument 1
-#endif
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
@@ -58,120 +46,222 @@ struct option {
#endif
#include "cpio.h"
+#include "err.h"
/*
- *
- * Option parsing routines for bsdcpio.
- *
- */
-
-
-static const char *cpio_opts = "0AaBC:F:O:cdE:f:H:hijLlmopR:rtuvW:yZz";
-
-/*
- * On systems that lack getopt_long, long options can be specified
- * using -W longopt and -W longopt=value, e.g. "-W version" is the
- * same as "--version" and "-W format=ustar" is the same as "--format
- * ustar". This does not rely the GNU getopt() "W;" extension, so
- * should work correctly on any system with a POSIX-compliant
- * getopt().
+ * Short options for cpio. Please keep this sorted.
*/
+static const char *short_options = "0AaBC:cdE:F:f:H:hI:iJjLlmnO:opR:rtuvW:yZz";
/*
- * If you add anything, be very careful to keep this list properly
- * sorted, as the -W logic below relies on it.
+ * Long options for cpio. Please keep this sorted.
*/
-static const struct option cpio_longopts[] = {
- { "create", no_argument, NULL, 'o' },
- { "extract", no_argument, NULL, 'i' },
- { "file", required_argument, NULL, 'F' },
- { "format", required_argument, NULL, 'H' },
- { "help", no_argument, NULL, 'h' },
- { "insecure", no_argument, NULL, OPTION_INSECURE },
- { "link", no_argument, NULL, 'l' },
- { "list", no_argument, NULL, 't' },
- { "make-directories", no_argument, NULL, 'd' },
- { "null", no_argument, NULL, '0' },
- { "owner", required_argument, NULL, 'R' },
- { "pass-through", no_argument, NULL, 'p' },
- { "preserve-modification-time", no_argument, NULL, 'm' },
- { "quiet", no_argument, NULL, OPTION_QUIET },
- { "unconditional", no_argument, NULL, 'u' },
- { "verbose", no_argument, NULL, 'v' },
- { "version", no_argument, NULL, OPTION_VERSION },
- { NULL, 0, NULL, 0 }
+static const struct option {
+ const char *name;
+ int required; /* 1 if this option requires an argument */
+ int equivalent; /* Equivalent short option. */
+} cpio_longopts[] = {
+ { "create", 0, 'o' },
+ { "extract", 0, 'i' },
+ { "file", 1, 'F' },
+ { "format", 1, 'H' },
+ { "help", 0, 'h' },
+ { "insecure", 0, OPTION_INSECURE },
+ { "link", 0, 'l' },
+ { "list", 0, 't' },
+ { "lzma", 0, OPTION_LZMA },
+ { "make-directories", 0, 'd' },
+ { "no-preserve-owner", 0, OPTION_NO_PRESERVE_OWNER },
+ { "null", 0, '0' },
+ { "numeric-uid-gid", 0, 'n' },
+ { "owner", 1, 'R' },
+ { "pass-through", 0, 'p' },
+ { "preserve-modification-time", 0, 'm' },
+ { "preserve-owner", 0, OPTION_PRESERVE_OWNER },
+ { "quiet", 0, OPTION_QUIET },
+ { "unconditional", 0, 'u' },
+ { "verbose", 0, 'v' },
+ { "version", 0, OPTION_VERSION },
+ { "xz", 0, 'J' },
+ { NULL, 0, 0 }
};
/*
- * Parse command-line options using system-provided getopt() or getopt_long().
- * If option is -W, then parse argument as a long option.
+ * I used to try to select platform-provided getopt() or
+ * getopt_long(), but that caused a lot of headaches. In particular,
+ * I couldn't consistently use long options in the test harness
+ * because not all platforms have getopt_long(). That in turn led to
+ * overuse of the -W hack in the test harness, which made it rough to
+ * run the test harness against GNU cpio. (I periodically run the
+ * test harness here against GNU cpio as a sanity-check. Yes,
+ * I've found a couple of bugs in GNU cpio that way.)
*/
int
cpio_getopt(struct cpio *cpio)
{
- char *p, *q;
- const struct option *option, *option2;
- int opt;
- int option_index;
- size_t option_length;
+ enum { state_start = 0, state_next_word, state_short, state_long };
+ static int state = state_start;
+ static char *opt_word;
- option_index = -1;
+ const struct option *popt, *match = NULL, *match2 = NULL;
+ const char *p, *long_prefix = "--";
+ size_t optlength;
+ int opt = '?';
+ int required = 0;
-#ifdef HAVE_GETOPT_LONG
- opt = getopt_long(cpio->argc, cpio->argv, cpio_opts,
- cpio_longopts, &option_index);
-#else
- opt = getopt(cpio->argc, cpio->argv, cpio_opts);
-#endif
+ cpio->optarg = NULL;
- /* Support long options through -W longopt=value */
- if (opt == 'W') {
- p = optarg;
- q = strchr(optarg, '=');
- if (q != NULL) {
- option_length = (size_t)(q - p);
- optarg = q + 1;
+ /* First time through, initialize everything. */
+ if (state == state_start) {
+ /* Skip program name. */
+ ++cpio->argv;
+ --cpio->argc;
+ state = state_next_word;
+ }
+
+ /*
+ * We're ready to look at the next word in argv.
+ */
+ if (state == state_next_word) {
+ /* No more arguments, so no more options. */
+ if (cpio->argv[0] == NULL)
+ return (-1);
+ /* Doesn't start with '-', so no more options. */
+ if (cpio->argv[0][0] != '-')
+ return (-1);
+ /* "--" marks end of options; consume it and return. */
+ if (strcmp(cpio->argv[0], "--") == 0) {
+ ++cpio->argv;
+ --cpio->argc;
+ return (-1);
+ }
+ /* Get next word for parsing. */
+ opt_word = *cpio->argv++;
+ --cpio->argc;
+ if (opt_word[1] == '-') {
+ /* Set up long option parser. */
+ state = state_long;
+ opt_word += 2; /* Skip leading '--' */
} else {
- option_length = strlen(p);
- optarg = NULL;
+ /* Set up short option parser. */
+ state = state_short;
+ ++opt_word; /* Skip leading '-' */
}
- option = cpio_longopts;
- while (option->name != NULL &&
- (strlen(option->name) < option_length ||
- strncmp(p, option->name, option_length) != 0 )) {
- option++;
+ }
+
+ /*
+ * We're parsing a group of POSIX-style single-character options.
+ */
+ if (state == state_short) {
+ /* Peel next option off of a group of short options. */
+ opt = *opt_word++;
+ if (opt == '\0') {
+ /* End of this group; recurse to get next option. */
+ state = state_next_word;
+ return cpio_getopt(cpio);
}
- if (option->name != NULL) {
- option2 = option;
- opt = option->val;
+ /* Does this option take an argument? */
+ p = strchr(short_options, opt);
+ if (p == NULL)
+ return ('?');
+ if (p[1] == ':')
+ required = 1;
- /* If the first match was exact, we're done. */
- if (strncmp(p, option->name, strlen(option->name)) == 0) {
- while (option->name != NULL)
- option++;
+ /* If it takes an argument, parse that. */
+ if (required) {
+ /* If arg is run-in, opt_word already points to it. */
+ if (opt_word[0] == '\0') {
+ /* Otherwise, pick up the next word. */
+ opt_word = *cpio->argv;
+ if (opt_word == NULL) {
+ lafe_warnc(0,
+ "Option -%c requires an argument",
+ opt);
+ return ('?');
+ }
+ ++cpio->argv;
+ --cpio->argc;
+ }
+ if (opt == 'W') {
+ state = state_long;
+ long_prefix = "-W "; /* For clearer errors. */
} else {
- /* Check if there's another match. */
- option++;
- while (option->name != NULL &&
- (strlen(option->name) < option_length ||
- strncmp(p, option->name, option_length) != 0)) {
- option++;
+ state = state_next_word;
+ cpio->optarg = opt_word;
+ }
+ }
+ }
+
+ /* We're reading a long option, including -W long=arg convention. */
+ if (state == state_long) {
+ /* After this long option, we'll be starting a new word. */
+ state = state_next_word;
+
+ /* Option name ends at '=' if there is one. */
+ p = strchr(opt_word, '=');
+ if (p != NULL) {
+ optlength = (size_t)(p - opt_word);
+ cpio->optarg = (char *)(uintptr_t)(p + 1);
+ } else {
+ optlength = strlen(opt_word);
+ }
+
+ /* Search the table for an unambiguous match. */
+ for (popt = cpio_longopts; popt->name != NULL; popt++) {
+ /* Short-circuit if first chars don't match. */
+ if (popt->name[0] != opt_word[0])
+ continue;
+ /* If option is a prefix of name in table, record it.*/
+ if (strncmp(opt_word, popt->name, optlength) == 0) {
+ match2 = match; /* Record up to two matches. */
+ match = popt;
+ /* If it's an exact match, we're done. */
+ if (strlen(popt->name) == optlength) {
+ match2 = NULL; /* Forget the others. */
+ break;
}
}
- if (option->name != NULL)
- cpio_errc(1, 0,
- "Ambiguous option %s "
- "(matches both %s and %s)",
- p, option2->name, option->name);
+ }
+
+ /* Fail if there wasn't a unique match. */
+ if (match == NULL) {
+ lafe_warnc(0,
+ "Option %s%s is not supported",
+ long_prefix, opt_word);
+ return ('?');
+ }
+ if (match2 != NULL) {
+ lafe_warnc(0,
+ "Ambiguous option %s%s (matches --%s and --%s)",
+ long_prefix, opt_word, match->name, match2->name);
+ return ('?');
+ }
- if (option2->has_arg == required_argument
- && optarg == NULL)
- cpio_errc(1, 0,
- "Option \"%s\" requires argument", p);
+ /* We've found a unique match; does it need an argument? */
+ if (match->required) {
+ /* Argument required: get next word if necessary. */
+ if (cpio->optarg == NULL) {
+ cpio->optarg = *cpio->argv;
+ if (cpio->optarg == NULL) {
+ lafe_warnc(0,
+ "Option %s%s requires an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
+ ++cpio->argv;
+ --cpio->argc;
+ }
} else {
- opt = '?';
+ /* Argument forbidden: fail if there is one. */
+ if (cpio->optarg != NULL) {
+ lafe_warnc(0,
+ "Option %s%s does not allow an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
}
+ return (match->equivalent);
}
return (opt);
@@ -182,24 +272,35 @@ cpio_getopt(struct cpio *cpio)
* Parse the argument to the -R or --owner flag.
*
* The format is one of the following:
- * <user> - Override user but not group
- * <user>: - Override both, group is user's default group
- * <user>:<group> - Override both
- * :<group> - Override group but not user
+ * <username|uid> - Override user but not group
+ * <username>: - Override both, group is user's default group
+ * <uid>: - Override user but not group
+ * <username|uid>:<groupname|gid> - Override both
+ * :<groupname|gid> - Override group but not user
+ *
+ * Where uid/gid are decimal representations and groupname/username
+ * are names to be looked up in system database. Note that we try
+ * to look up an argument as a name first, then try numeric parsing.
*
* A period can be used instead of the colon.
*
- * Sets uid/gid as appropriate, -1 indicates uid/gid not specified.
+ * Sets uid/gid return as appropriate, -1 indicates uid/gid not specified.
+ *
+ * Returns NULL if no error, otherwise returns error string for display.
*
*/
-int
+const char *
owner_parse(const char *spec, int *uid, int *gid)
{
+ static char errbuff[128];
const char *u, *ue, *g;
*uid = -1;
*gid = -1;
+ if (spec[0] == '\0')
+ return ("Invalid empty user/group spec");
+
/*
* Split spec into [user][:.][group]
* u -> first char of username, NULL if no username
@@ -226,31 +327,43 @@ owner_parse(const char *spec, int *uid, int *gid)
struct passwd *pwent;
user = (char *)malloc(ue - u + 1);
- if (user == NULL) {
- cpio_warnc(errno, "Couldn't allocate memory");
- return (1);
- }
+ if (user == NULL)
+ return ("Couldn't allocate memory");
memcpy(user, u, ue - u);
user[ue - u] = '\0';
- pwent = getpwnam(user);
- if (pwent == NULL) {
- cpio_warnc(errno, "Couldn't lookup user ``%s''", user);
- return (1);
+ if ((pwent = getpwnam(user)) != NULL) {
+ *uid = pwent->pw_uid;
+ if (*ue != '\0')
+ *gid = pwent->pw_gid;
+ } else {
+ char *end;
+ errno = 0;
+ *uid = strtoul(user, &end, 10);
+ if (errno || *end != '\0') {
+ snprintf(errbuff, sizeof(errbuff),
+ "Couldn't lookup user ``%s''", user);
+ errbuff[sizeof(errbuff) - 1] = '\0';
+ return (errbuff);
+ }
}
free(user);
- *uid = pwent->pw_uid;
- if (*ue != '\0' && *g == '\0')
- *gid = pwent->pw_gid;
}
+
if (*g != '\0') {
struct group *grp;
- grp = getgrnam(g);
- if (grp != NULL)
+ if ((grp = getgrnam(g)) != NULL) {
*gid = grp->gr_gid;
- else {
- cpio_warnc(errno, "Couldn't look up group ``%s''", g);
- return (1);
+ } else {
+ char *end;
+ errno = 0;
+ *gid = strtoul(g, &end, 10);
+ if (errno || *end != '\0') {
+ snprintf(errbuff, sizeof(errbuff),
+ "Couldn't lookup group ``%s''", g);
+ errbuff[sizeof(errbuff) - 1] = '\0';
+ return (errbuff);
+ }
}
}
- return (0);
+ return (NULL);
}
diff --git a/archivers/libarchive/files/cpio/config_freebsd.h b/archivers/libarchive/files/cpio/config_freebsd.h
new file mode 100644
index 00000000000..00c4c737f73
--- /dev/null
+++ b/archivers/libarchive/files/cpio/config_freebsd.h
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/usr.bin/cpio/config_freebsd.h,v 1.3 2008/12/06 07:30:40 kientzle Exp $
+ */
+
+/* A hand-tooled configuration for FreeBSD. */
+
+#include <sys/param.h> /* __FreeBSD_version */
+
+#define HAVE_DIRENT_H 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FUTIMES 1
+#define HAVE_GRP_H 1
+#define HAVE_LIBARCHIVE 1
+#define HAVE_LINK 1
+#define HAVE_LSTAT 1
+#define HAVE_LUTIMES 1
+#define HAVE_PWD_H 1
+#define HAVE_READLINK 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYMLINK 1
+#define HAVE_SYS_CDEFS_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_TIME_H 1
+#define HAVE_UINTMAX_T 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UNSIGNED_LONG_LONG 1
+#define HAVE_UTIME_H 1
+#define HAVE_UTIMES 1
+
diff --git a/archivers/libarchive/files/cpio/cpio.c b/archivers/libarchive/files/cpio/cpio.c
index 76a91cf7152..7d5031bbcd8 100644
--- a/archivers/libarchive/files/cpio/cpio.c
+++ b/archivers/libarchive/files/cpio/cpio.c
@@ -26,24 +26,39 @@
#include "cpio_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.4 2008/06/24 15:18:40 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.15 2008/12/06 07:30:40 kientzle Exp $");
#include <sys/types.h>
#include <archive.h>
#include <archive_entry.h>
+#ifdef HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -54,20 +69,54 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.4 2008/06/24 15:18:40 kientzle E
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
#include "cpio.h"
+#include "err.h"
+#include "line_reader.h"
#include "matching.h"
-static int copy_data(struct archive *, struct archive *);
+/* Fixed size of uname/gname caches. */
+#define name_cache_size 101
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+struct name_cache {
+ int probes;
+ int hits;
+ size_t size;
+ struct {
+ id_t id;
+ char *name;
+ } cache[name_cache_size];
+};
+
+static int extract_data(struct archive *, struct archive *);
+const char * cpio_i64toa(int64_t);
static const char *cpio_rename(const char *name);
static int entry_to_archive(struct cpio *, struct archive_entry *);
static int file_to_archive(struct cpio *, const char *);
+static void free_cache(struct name_cache *cache);
+static void list_item_verbose(struct cpio *, struct archive_entry *);
static void long_help(void);
+static const char *lookup_gname(struct cpio *, gid_t gid);
+static int lookup_gname_helper(struct cpio *,
+ const char **name, id_t gid);
+static const char *lookup_uname(struct cpio *, uid_t uid);
+static int lookup_uname_helper(struct cpio *,
+ const char **name, id_t uid);
static void mode_in(struct cpio *);
static void mode_list(struct cpio *);
static void mode_out(struct cpio *);
static void mode_pass(struct cpio *, const char *);
-static void restore_time(struct cpio *, struct archive_entry *,
+static int restore_time(struct cpio *, struct archive_entry *,
const char *, int fd);
static void usage(void);
static void version(void);
@@ -78,6 +127,7 @@ main(int argc, char *argv[])
static char buff[16384];
struct cpio _cpio; /* Allocated on stack. */
struct cpio *cpio;
+ const char *errmsg;
int uid, gid;
int opt;
@@ -86,39 +136,46 @@ main(int argc, char *argv[])
cpio->buff = buff;
cpio->buff_size = sizeof(buff);
- /* Need cpio_progname before calling cpio_warnc. */
+ /* Need lafe_progname before calling lafe_warnc. */
if (*argv == NULL)
- cpio_progname = "bsdcpio";
+ lafe_progname = "bsdcpio";
else {
- cpio_progname = strrchr(*argv, '/');
- if (cpio_progname != NULL)
- cpio_progname++;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ lafe_progname = strrchr(*argv, '\\');
+#else
+ lafe_progname = strrchr(*argv, '/');
+#endif
+ if (lafe_progname != NULL)
+ lafe_progname++;
else
- cpio_progname = *argv;
+ lafe_progname = *argv;
}
cpio->uid_override = -1;
cpio->gid_override = -1;
cpio->argv = argv;
cpio->argc = argc;
- cpio->line_separator = '\n';
cpio->mode = '\0';
cpio->verbose = 0;
cpio->compress = '\0';
- /* TODO: Implement old binary format in libarchive, use that here. */
- cpio->format = "odc"; /* Default format */
cpio->extract_flags = ARCHIVE_EXTRACT_NO_AUTODIR;
cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
- /* TODO: If run by root, set owner as well. */
+ cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
+#if !defined(_WIN32) && !defined(__CYGWIN__)
+ if (geteuid() == 0)
+ cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
+#endif
cpio->bytes_per_block = 512;
cpio->filename = NULL;
while ((opt = cpio_getopt(cpio)) != -1) {
switch (opt) {
case '0': /* GNU convention: --null, -0 */
- cpio->line_separator = '\0';
+ cpio->option_null = 1;
break;
case 'A': /* NetBSD/OpenBSD */
cpio->option_append = 1;
@@ -130,9 +187,9 @@ main(int argc, char *argv[])
cpio->bytes_per_block = 5120;
break;
case 'C': /* NetBSD/OpenBSD */
- cpio->bytes_per_block = atoi(optarg);
+ cpio->bytes_per_block = atoi(cpio->optarg);
if (cpio->bytes_per_block <= 0)
- cpio_errc(1, 0, "Invalid blocksize %s", optarg);
+ lafe_errc(1, 0, "Invalid blocksize %s", cpio->optarg);
break;
case 'c': /* POSIX 1997 */
cpio->format = "odc";
@@ -141,26 +198,36 @@ main(int argc, char *argv[])
cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR;
break;
case 'E': /* NetBSD/OpenBSD */
- include_from_file(cpio, optarg);
+ lafe_include_from_file(&cpio->matching,
+ cpio->optarg, cpio->option_null);
break;
case 'F': /* NetBSD/OpenBSD/GNU cpio */
- cpio->filename = optarg;
+ cpio->filename = cpio->optarg;
break;
case 'f': /* POSIX 1997 */
- exclude(cpio, optarg);
+ lafe_exclude(&cpio->matching, cpio->optarg);
break;
case 'H': /* GNU cpio (also --format) */
- cpio->format = optarg;
+ cpio->format = cpio->optarg;
break;
case 'h':
long_help();
break;
case 'I': /* NetBSD/OpenBSD */
- cpio->filename = optarg;
+ cpio->filename = cpio->optarg;
break;
case 'i': /* POSIX 1997 */
+ if (cpio->mode != '\0')
+ lafe_errc(1, 0,
+ "Cannot use both -i and -%c", cpio->mode);
cpio->mode = opt;
break;
+ case 'J': /* GNU tar, others */
+ cpio->compress = opt;
+ break;
+ case 'j': /* GNU tar, others */
+ cpio->compress = opt;
+ break;
case OPTION_INSECURE:
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
@@ -171,25 +238,46 @@ main(int argc, char *argv[])
case 'l': /* POSIX 1997 */
cpio->option_link = 1;
break;
+ case OPTION_LZMA: /* GNU tar, others */
+ cpio->compress = opt;
+ break;
case 'm': /* POSIX 1997 */
cpio->extract_flags |= ARCHIVE_EXTRACT_TIME;
break;
+ case 'n': /* GNU cpio */
+ cpio->option_numeric_uid_gid = 1;
+ break;
+ case OPTION_NO_PRESERVE_OWNER: /* GNU cpio */
+ cpio->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
+ break;
case 'O': /* GNU cpio */
- cpio->filename = optarg;
+ cpio->filename = cpio->optarg;
break;
case 'o': /* POSIX 1997 */
+ if (cpio->mode != '\0')
+ lafe_errc(1, 0,
+ "Cannot use both -o and -%c", cpio->mode);
cpio->mode = opt;
break;
case 'p': /* POSIX 1997 */
+ if (cpio->mode != '\0')
+ lafe_errc(1, 0,
+ "Cannot use both -p and -%c", cpio->mode);
cpio->mode = opt;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
break;
+ case OPTION_PRESERVE_OWNER:
+ cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
+ break;
case OPTION_QUIET: /* GNU cpio */
cpio->quiet = 1;
break;
case 'R': /* GNU cpio, also --owner */
- if (owner_parse(optarg, &uid, &gid))
+ errmsg = owner_parse(cpio->optarg, &uid, &gid);
+ if (errmsg) {
+ lafe_warnc(-1, "%s", errmsg);
usage();
+ }
if (uid != -1)
cpio->uid_override = uid;
if (gid != -1)
@@ -233,18 +321,38 @@ main(int argc, char *argv[])
}
}
- /* TODO: Sanity-check args, error out on nonsensical combinations. */
-
- cpio->argc -= optind;
- cpio->argv += optind;
+ /*
+ * Sanity-check args, error out on nonsensical combinations.
+ */
+ /* -t implies -i if no mode was specified. */
+ if (cpio->option_list && cpio->mode == '\0')
+ cpio->mode = 'i';
+ /* -t requires -i */
+ if (cpio->option_list && cpio->mode != 'i')
+ lafe_errc(1, 0, "Option -t requires -i");
+ /* -n requires -it */
+ if (cpio->option_numeric_uid_gid && !cpio->option_list)
+ lafe_errc(1, 0, "Option -n requires -it");
+ /* Can only specify format when writing */
+ if (cpio->format != NULL && cpio->mode != 'o')
+ lafe_errc(1, 0, "Option --format requires -o");
+ /* -l requires -p */
+ if (cpio->option_link && cpio->mode != 'p')
+ lafe_errc(1, 0, "Option -l requires -p");
+ /* TODO: Flag other nonsensical combinations. */
switch (cpio->mode) {
case 'o':
+ /* TODO: Implement old binary format in libarchive,
+ use that here. */
+ if (cpio->format == NULL)
+ cpio->format = "odc"; /* Default format */
+
mode_out(cpio);
break;
case 'i':
while (*cpio->argv != NULL) {
- include(cpio, *cpio->argv);
+ lafe_include(&cpio->matching, *cpio->argv);
--cpio->argc;
++cpio->argv;
}
@@ -255,34 +363,32 @@ main(int argc, char *argv[])
break;
case 'p':
if (*cpio->argv == NULL || **cpio->argv == '\0')
- cpio_errc(1, 0,
+ lafe_errc(1, 0,
"-p mode requires a target directory");
mode_pass(cpio, *cpio->argv);
break;
default:
- cpio_errc(1, 0,
+ lafe_errc(1, 0,
"Must specify at least one of -i, -o, or -p");
}
- return (0);
+ free_cache(cpio->gname_cache);
+ free_cache(cpio->uname_cache);
+ return (cpio->return_value);
}
-void
+static void
usage(void)
{
const char *p;
- p = cpio_progname;
+ p = lafe_progname;
fprintf(stderr, "Brief Usage:\n");
fprintf(stderr, " List: %s -it < archive\n", p);
fprintf(stderr, " Extract: %s -i < archive\n", p);
fprintf(stderr, " Create: %s -o < filenames > archive\n", p);
-#ifdef HAVE_GETOPT_LONG
fprintf(stderr, " Help: %s --help\n", p);
-#else
- fprintf(stderr, " Help: %s -h\n", p);
-#endif
exit(1);
}
@@ -292,7 +398,7 @@ static const char *long_help_msg =
"Common Options:\n"
" -v Verbose\n"
"Create: %p -o [options] < [list of files] > [archive]\n"
- " -z, -y Compress archive with gzip/bzip2\n"
+ " -J,-y,-z,--lzma Compress archive with xz/bzip2/gzip/lzma\n"
" --format {odc|newc|ustar} Select archive format\n"
"List: %p -it < [archive]\n"
"Extract: %p -i [options] < [archive]\n";
@@ -314,7 +420,7 @@ long_help(void)
const char *prog;
const char *p;
- prog = cpio_progname;
+ prog = lafe_progname;
fflush(stderr);
@@ -346,46 +452,66 @@ version(void)
static void
mode_out(struct cpio *cpio)
{
- unsigned long blocks;
struct archive_entry *entry, *spare;
- struct line_reader *lr;
+ struct lafe_line_reader *lr;
const char *p;
int r;
if (cpio->option_append)
- cpio_errc(1, 0, "Append mode not yet supported.");
+ lafe_errc(1, 0, "Append mode not yet supported.");
+
+ cpio->archive_read_disk = archive_read_disk_new();
+ if (cpio->archive_read_disk == NULL)
+ lafe_errc(1, 0, "Failed to allocate archive object");
+ if (cpio->option_follow_links)
+ archive_read_disk_set_symlink_logical(cpio->archive_read_disk);
+ else
+ archive_read_disk_set_symlink_physical(cpio->archive_read_disk);
+ archive_read_disk_set_standard_lookup(cpio->archive_read_disk);
+
cpio->archive = archive_write_new();
if (cpio->archive == NULL)
- cpio_errc(1, 0, "Failed to allocate archive object");
+ lafe_errc(1, 0, "Failed to allocate archive object");
switch (cpio->compress) {
+ case 'J':
+ r = archive_write_set_compression_xz(cpio->archive);
+ break;
+ case OPTION_LZMA:
+ r = archive_write_set_compression_lzma(cpio->archive);
+ break;
case 'j': case 'y':
- archive_write_set_compression_bzip2(cpio->archive);
+ r = archive_write_set_compression_bzip2(cpio->archive);
break;
case 'z':
- archive_write_set_compression_gzip(cpio->archive);
+ r = archive_write_set_compression_gzip(cpio->archive);
break;
case 'Z':
- archive_write_set_compression_compress(cpio->archive);
+ r = archive_write_set_compression_compress(cpio->archive);
break;
default:
- archive_write_set_compression_none(cpio->archive);
+ r = archive_write_set_compression_none(cpio->archive);
break;
}
+ if (r < ARCHIVE_WARN)
+ lafe_errc(1, 0, "Requested compression not available");
r = archive_write_set_format_by_name(cpio->archive, cpio->format);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(cpio->archive));
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->archive));
archive_write_set_bytes_per_block(cpio->archive, cpio->bytes_per_block);
cpio->linkresolver = archive_entry_linkresolver_new();
archive_entry_linkresolver_set_strategy(cpio->linkresolver,
archive_format(cpio->archive));
+ /*
+ * The main loop: Copy each file into the output archive.
+ */
r = archive_write_open_file(cpio->archive, cpio->filename);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(cpio->archive));
- lr = process_lines_init("-", cpio->line_separator);
- while ((p = process_lines_next(lr)) != NULL)
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->archive));
+ lr = lafe_line_reader("-", cpio->option_null);
+ while ((p = lafe_line_reader_next(lr)) != NULL)
file_to_archive(cpio, p);
- process_lines_free(lr);
+ lafe_line_reader_free(lr);
/*
* The hardlink detection may have queued up a couple of entries
@@ -402,12 +528,13 @@ mode_out(struct cpio *cpio)
r = archive_write_close(cpio->archive);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(cpio->archive));
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->archive));
if (!cpio->quiet) {
- blocks = (archive_position_uncompressed(cpio->archive) + 511)
- / 512;
- fprintf(stderr, "%lu %s\n", blocks,
+ int64_t blocks =
+ (archive_position_uncompressed(cpio->archive) + 511)
+ / 512;
+ fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
blocks == 1 ? "block" : "blocks");
}
archive_write_finish(cpio->archive);
@@ -421,51 +548,37 @@ mode_out(struct cpio *cpio)
static int
file_to_archive(struct cpio *cpio, const char *srcpath)
{
- struct stat st;
const char *destpath;
struct archive_entry *entry, *spare;
size_t len;
const char *p;
- int lnklen;
int r;
/*
* Create an archive_entry describing the source file.
+ *
*/
entry = archive_entry_new();
if (entry == NULL)
- cpio_errc(1, 0, "Couldn't allocate entry");
+ lafe_errc(1, 0, "Couldn't allocate entry");
archive_entry_copy_sourcepath(entry, srcpath);
-
- /* Get stat information. */
- if (cpio->option_follow_links)
- r = stat(srcpath, &st);
- else
- r = lstat(srcpath, &st);
- if (r != 0) {
- cpio_warnc(errno, "Couldn't stat \"%s\"", srcpath);
- archive_entry_free(entry);
- return (0);
+ r = archive_read_disk_entry_from_file(cpio->archive_read_disk,
+ entry, -1, NULL);
+ if (r < ARCHIVE_FAILED)
+ lafe_errc(1, 0, "%s",
+ archive_error_string(cpio->archive_read_disk));
+ if (r < ARCHIVE_OK)
+ lafe_warnc(0, "%s",
+ archive_error_string(cpio->archive_read_disk));
+ if (r <= ARCHIVE_FAILED) {
+ cpio->return_value = 1;
+ return (r);
}
if (cpio->uid_override >= 0)
- st.st_uid = cpio->uid_override;
+ archive_entry_set_uid(entry, cpio->uid_override);
if (cpio->gid_override >= 0)
- st.st_gid = cpio->uid_override;
- archive_entry_copy_stat(entry, &st);
-
- /* If its a symlink, pull the target. */
- if (S_ISLNK(st.st_mode)) {
- lnklen = readlink(srcpath, cpio->buff, cpio->buff_size);
- if (lnklen < 0) {
- cpio_warnc(errno,
- "%s: Couldn't read symbolic link", srcpath);
- archive_entry_free(entry);
- return (0);
- }
- cpio->buff[lnklen] = 0;
- archive_entry_set_symlink(entry, cpio->buff);
- }
+ archive_entry_set_gid(entry, cpio->gid_override);
/*
* Generate a destination path for this entry.
@@ -484,7 +597,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath)
free(cpio->pass_destpath);
cpio->pass_destpath = malloc(cpio->pass_destpath_alloc);
if (cpio->pass_destpath == NULL)
- cpio_errc(1, ENOMEM,
+ lafe_errc(1, ENOMEM,
"Can't allocate path buffer");
}
strcpy(cpio->pass_destpath, cpio->destdir);
@@ -505,18 +618,18 @@ file_to_archive(struct cpio *cpio, const char *srcpath)
*/
spare = NULL;
if (cpio->linkresolver != NULL
- && !S_ISDIR(st.st_mode)) {
+ && archive_entry_filetype(entry) != AE_IFDIR) {
archive_entry_linkify(cpio->linkresolver, &entry, &spare);
}
if (entry != NULL) {
r = entry_to_archive(cpio, entry);
archive_entry_free(entry);
- }
- if (spare != NULL) {
- if (r == 0)
- r = entry_to_archive(cpio, spare);
- archive_entry_free(spare);
+ if (spare != NULL) {
+ if (r == 0)
+ r = entry_to_archive(cpio, spare);
+ archive_entry_free(spare);
+ }
}
return (r);
}
@@ -550,7 +663,7 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
/* Save the original entry in case we need it later. */
t = archive_entry_clone(entry);
if (t == NULL)
- cpio_errc(1, ENOMEM, "Can't create link");
+ lafe_errc(1, ENOMEM, "Can't create link");
/* Note: link(2) doesn't create parent directories,
* so we use archive_write_header() instead as a
* convenience. */
@@ -560,15 +673,15 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
r = archive_write_header(cpio->archive, t);
archive_entry_free(t);
if (r != ARCHIVE_OK)
- cpio_warnc(archive_errno(cpio->archive),
- archive_error_string(cpio->archive));
+ lafe_warnc(archive_errno(cpio->archive),
+ "%s", archive_error_string(cpio->archive));
if (r == ARCHIVE_FATAL)
exit(1);
#ifdef EXDEV
if (r != ARCHIVE_OK && archive_errno(cpio->archive) == EXDEV) {
/* Cross-device link: Just fall through and use
* the original entry to copy the file over. */
- cpio_warnc(0, "Copying file instead");
+ lafe_warnc(0, "Copying file instead");
} else
#endif
return (0);
@@ -580,9 +693,9 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
*/
if (archive_entry_filetype(entry) == AE_IFREG) {
if (archive_entry_size(entry) > 0) {
- fd = open(srcpath, O_RDONLY);
+ fd = open(srcpath, O_RDONLY | O_BINARY);
if (fd < 0) {
- cpio_warnc(errno,
+ lafe_warnc(errno,
"%s: could not open file", srcpath);
goto cleanup;
}
@@ -594,9 +707,9 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
r = archive_write_header(cpio->archive, entry);
if (r != ARCHIVE_OK)
- cpio_warnc(archive_errno(cpio->archive),
+ lafe_warnc(archive_errno(cpio->archive),
"%s: %s",
- destpath,
+ srcpath,
archive_error_string(cpio->archive));
if (r == ARCHIVE_FATAL)
@@ -608,17 +721,17 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
r = archive_write_data(cpio->archive,
cpio->buff, bytes_read);
if (r < 0)
- cpio_errc(1, archive_errno(cpio->archive),
- archive_error_string(cpio->archive));
+ lafe_errc(1, archive_errno(cpio->archive),
+ "%s", archive_error_string(cpio->archive));
if (r < bytes_read) {
- cpio_warnc(0,
+ lafe_warnc(0,
"Truncated write; file may have grown while being archived.");
}
bytes_read = read(fd, cpio->buff, cpio->buff_size);
}
}
- restore_time(cpio, entry, srcpath, fd);
+ fd = restore_time(cpio, entry, srcpath, fd);
cleanup:
if (cpio->verbose)
@@ -628,7 +741,7 @@ cleanup:
return (0);
}
-static void
+static int
restore_time(struct cpio *cpio, struct archive_entry *entry,
const char *name, int fd)
{
@@ -638,17 +751,20 @@ restore_time(struct cpio *cpio, struct archive_entry *entry,
(void)cpio; /* UNUSED */
(void)entry; /* UNUSED */
(void)name; /* UNUSED */
- (void)fd; /* UNUSED */
if (!warned)
- cpio_warnc(0, "Can't restore access times on this platform");
+ lafe_warnc(0, "Can't restore access times on this platform");
warned = 1;
- return;
+ return (fd);
+#else
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ struct __timeval times[2];
#else
struct timeval times[2];
+#endif
if (!cpio->option_atime_restore)
- return;
+ return (fd);
times[1].tv_sec = archive_entry_mtime(entry);
times[1].tv_usec = archive_entry_mtime_nsec(entry) / 1000;
@@ -656,18 +772,28 @@ restore_time(struct cpio *cpio, struct archive_entry *entry,
times[0].tv_sec = archive_entry_atime(entry);
times[0].tv_usec = archive_entry_atime_nsec(entry) / 1000;
-#ifdef HAVE_FUTIMES
+#if defined(HAVE_FUTIMES) && !defined(__CYGWIN__)
if (fd >= 0 && futimes(fd, times) == 0)
- return;
+ return (fd);
#endif
+ /*
+ * Some platform cannot restore access times if the file descriptor
+ * is still opened.
+ */
+ if (fd >= 0) {
+ close(fd);
+ fd = -1;
+ }
#ifdef HAVE_LUTIMES
if (lutimes(name, times) != 0)
#else
- if (!S_ISLNK(archive_entry_mode(entry)) && utimes(name, times) != 0)
+ if ((AE_IFLNK != archive_entry_filetype(entry))
+ && utimes(name, times) != 0)
#endif
- cpio_warnc(errno, "Can't update time for %s", name);
+ lafe_warnc(errno, "Can't update time for %s", name);
#endif
+ return (fd);
}
@@ -678,33 +804,32 @@ mode_in(struct cpio *cpio)
struct archive_entry *entry;
struct archive *ext;
const char *destpath;
- unsigned long blocks;
int r;
ext = archive_write_disk_new();
if (ext == NULL)
- cpio_errc(1, 0, "Couldn't allocate restore object");
+ lafe_errc(1, 0, "Couldn't allocate restore object");
r = archive_write_disk_set_options(ext, cpio->extract_flags);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(ext));
+ lafe_errc(1, 0, "%s", archive_error_string(ext));
a = archive_read_new();
if (a == NULL)
- cpio_errc(1, 0, "Couldn't allocate archive object");
+ lafe_errc(1, 0, "Couldn't allocate archive object");
archive_read_support_compression_all(a);
archive_read_support_format_all(a);
if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block))
- cpio_errc(1, archive_errno(a),
- archive_error_string(a));
+ lafe_errc(1, archive_errno(a),
+ "%s", archive_error_string(a));
for (;;) {
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
break;
if (r != ARCHIVE_OK) {
- cpio_errc(1, archive_errno(a),
- archive_error_string(a));
+ lafe_errc(1, archive_errno(a),
+ "%s", archive_error_string(a));
}
- if (excluded(cpio, archive_entry_pathname(entry)))
+ if (lafe_excluded(cpio->matching, archive_entry_pathname(entry)))
continue;
if (cpio->option_rename) {
destpath = cpio_rename(archive_entry_pathname(entry));
@@ -725,28 +850,34 @@ mode_in(struct cpio *cpio)
archive_entry_pathname(entry),
archive_error_string(ext));
} else if (archive_entry_size(entry) > 0) {
- r = copy_data(a, ext);
+ r = extract_data(a, ext);
+ if (r != ARCHIVE_OK)
+ cpio->return_value = 1;
}
}
r = archive_read_close(a);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(a));
+ lafe_errc(1, 0, "%s", archive_error_string(a));
r = archive_write_close(ext);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(ext));
+ lafe_errc(1, 0, "%s", archive_error_string(ext));
if (!cpio->quiet) {
- blocks = (archive_position_uncompressed(a) + 511)
+ int64_t blocks = (archive_position_uncompressed(a) + 511)
/ 512;
- fprintf(stderr, "%lu %s\n", blocks,
+ fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
blocks == 1 ? "block" : "blocks");
}
archive_read_finish(a);
archive_write_finish(ext);
- exit(0);
+ exit(cpio->return_value);
}
+/*
+ * Exits if there's a fatal error. Returns ARCHIVE_OK
+ * if everything is kosher.
+ */
static int
-copy_data(struct archive *ar, struct archive *aw)
+extract_data(struct archive *ar, struct archive *aw)
{
int r;
size_t size;
@@ -758,14 +889,14 @@ copy_data(struct archive *ar, struct archive *aw)
if (r == ARCHIVE_EOF)
return (ARCHIVE_OK);
if (r != ARCHIVE_OK) {
- cpio_warnc(archive_errno(ar),
+ lafe_warnc(archive_errno(ar),
"%s", archive_error_string(ar));
- return (r);
+ exit(1);
}
r = archive_write_data_block(aw, block, size, offset);
if (r != ARCHIVE_OK) {
- cpio_warnc(archive_errno(aw),
- archive_error_string(aw));
+ lafe_warnc(archive_errno(aw),
+ "%s", archive_error_string(aw));
return (r);
}
}
@@ -776,59 +907,130 @@ mode_list(struct cpio *cpio)
{
struct archive *a;
struct archive_entry *entry;
- unsigned long blocks;
int r;
a = archive_read_new();
if (a == NULL)
- cpio_errc(1, 0, "Couldn't allocate archive object");
+ lafe_errc(1, 0, "Couldn't allocate archive object");
archive_read_support_compression_all(a);
archive_read_support_format_all(a);
if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block))
- cpio_errc(1, archive_errno(a),
- archive_error_string(a));
+ lafe_errc(1, archive_errno(a),
+ "%s", archive_error_string(a));
for (;;) {
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
break;
if (r != ARCHIVE_OK) {
- cpio_errc(1, archive_errno(a),
- archive_error_string(a));
+ lafe_errc(1, archive_errno(a),
+ "%s", archive_error_string(a));
}
- if (excluded(cpio, archive_entry_pathname(entry)))
+ if (lafe_excluded(cpio->matching, archive_entry_pathname(entry)))
continue;
- if (cpio->verbose) {
- /* TODO: uname/gname lookups */
- /* TODO: Clean this up. */
- fprintf(stdout,
- "%s%3d %8s%8s " CPIO_FILESIZE_PRINTF " %s\n",
- archive_entry_strmode(entry),
- archive_entry_nlink(entry),
- archive_entry_uname(entry),
- archive_entry_gname(entry),
- (CPIO_FILESIZE_TYPE)archive_entry_size(entry),
- archive_entry_pathname(entry));
- } else
+ if (cpio->verbose)
+ list_item_verbose(cpio, entry);
+ else
fprintf(stdout, "%s\n", archive_entry_pathname(entry));
}
r = archive_read_close(a);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(a));
+ lafe_errc(1, 0, "%s", archive_error_string(a));
if (!cpio->quiet) {
- blocks = (archive_position_uncompressed(a) + 511)
+ int64_t blocks = (archive_position_uncompressed(a) + 511)
/ 512;
- fprintf(stderr, "%lu %s\n", blocks,
+ fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
blocks == 1 ? "block" : "blocks");
}
archive_read_finish(a);
exit(0);
}
+/*
+ * Display information about the current file.
+ *
+ * The format here roughly duplicates the output of 'ls -l'.
+ * This is based on SUSv2, where 'tar tv' is documented as
+ * listing additional information in an "unspecified format,"
+ * and 'pax -l' is documented as using the same format as 'ls -l'.
+ */
+static void
+list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
+{
+ char size[32];
+ char date[32];
+ char uids[16], gids[16];
+ const char *uname, *gname;
+ FILE *out = stdout;
+ const char *fmt;
+ time_t mtime;
+ static time_t now;
+
+ if (!now)
+ time(&now);
+
+ if (cpio->option_numeric_uid_gid) {
+ /* Format numeric uid/gid for display. */
+ strcpy(uids, cpio_i64toa(archive_entry_uid(entry)));
+ uname = uids;
+ strcpy(gids, cpio_i64toa(archive_entry_gid(entry)));
+ gname = gids;
+ } else {
+ /* Use uname if it's present, else lookup name from uid. */
+ uname = archive_entry_uname(entry);
+ if (uname == NULL)
+ uname = lookup_uname(cpio, archive_entry_uid(entry));
+ /* Use gname if it's present, else lookup name from gid. */
+ gname = archive_entry_gname(entry);
+ if (gname == NULL)
+ gname = lookup_gname(cpio, archive_entry_gid(entry));
+ }
+
+ /* Print device number or file size. */
+ if (archive_entry_filetype(entry) == AE_IFCHR
+ || archive_entry_filetype(entry) == AE_IFBLK) {
+ snprintf(size, sizeof(size), "%lu,%lu",
+ (unsigned long)archive_entry_rdevmajor(entry),
+ (unsigned long)archive_entry_rdevminor(entry));
+ } else {
+ strcpy(size, cpio_i64toa(archive_entry_size(entry)));
+ }
+
+ /* Format the time using 'ls -l' conventions. */
+ mtime = archive_entry_mtime(entry);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Windows' strftime function does not support %e format. */
+ if (mtime - now > 365*86400/2
+ || mtime - now < -365*86400/2)
+ fmt = cpio->day_first ? "%d %b %Y" : "%b %d %Y";
+ else
+ fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M";
+#else
+ if (abs(mtime - now) > (365/2)*86400)
+ fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y";
+ else
+ fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
+#endif
+ strftime(date, sizeof(date), fmt, localtime(&mtime));
+
+ fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
+ archive_entry_strmode(entry),
+ archive_entry_nlink(entry),
+ uname, gname, size, date,
+ archive_entry_pathname(entry));
+
+ /* Extra information for links. */
+ if (archive_entry_hardlink(entry)) /* Hard link */
+ fprintf(out, " link to %s", archive_entry_hardlink(entry));
+ else if (archive_entry_symlink(entry)) /* Symbolic link */
+ fprintf(out, " -> %s", archive_entry_symlink(entry));
+ fprintf(out, "\n");
+}
+
static void
mode_pass(struct cpio *cpio, const char *destdir)
{
- struct line_reader *lr;
+ struct lafe_line_reader *lr;
const char *p;
int r;
@@ -840,21 +1042,40 @@ mode_pass(struct cpio *cpio, const char *destdir)
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)
- cpio_errc(1, 0, "Failed to allocate archive object");
+ lafe_errc(1, 0, "Failed to allocate archive object");
r = archive_write_disk_set_options(cpio->archive, cpio->extract_flags);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(cpio->archive));
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->archive));
cpio->linkresolver = archive_entry_linkresolver_new();
archive_write_disk_set_standard_lookup(cpio->archive);
- lr = process_lines_init("-", cpio->line_separator);
- while ((p = process_lines_next(lr)) != NULL)
+
+ cpio->archive_read_disk = archive_read_disk_new();
+ if (cpio->archive_read_disk == NULL)
+ lafe_errc(1, 0, "Failed to allocate archive object");
+ if (cpio->option_follow_links)
+ archive_read_disk_set_symlink_logical(cpio->archive_read_disk);
+ else
+ archive_read_disk_set_symlink_physical(cpio->archive_read_disk);
+ archive_read_disk_set_standard_lookup(cpio->archive_read_disk);
+
+ lr = lafe_line_reader("-", cpio->option_null);
+ while ((p = lafe_line_reader_next(lr)) != NULL)
file_to_archive(cpio, p);
- process_lines_free(lr);
+ lafe_line_reader_free(lr);
archive_entry_linkresolver_free(cpio->linkresolver);
r = archive_write_close(cpio->archive);
if (r != ARCHIVE_OK)
- cpio_errc(1, 0, archive_error_string(cpio->archive));
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->archive));
+
+ if (!cpio->quiet) {
+ int64_t blocks =
+ (archive_position_uncompressed(cpio->archive) + 511)
+ / 512;
+ fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
+ blocks == 1 ? "block" : "blocks");
+ }
+
archive_write_finish(cpio->archive);
}
@@ -901,126 +1122,146 @@ cpio_rename(const char *name)
return (ret);
}
+static void
+free_cache(struct name_cache *cache)
+{
+ size_t i;
+
+ if (cache != NULL) {
+ for (i = 0; i < cache->size; i++)
+ free(cache->cache[i].name);
+ free(cache);
+ }
+}
/*
- * Read lines from file and do something with each one. If option_null
- * is set, lines are terminated with zero bytes; otherwise, they're
- * terminated with newlines.
- *
- * This uses a self-sizing buffer to handle arbitrarily-long lines.
+ * Lookup uname/gname from uid/gid, return NULL if no match.
*/
-struct line_reader {
- FILE *f;
- char *buff, *buff_end, *line_start, *line_end, *p;
- char *pathname;
- size_t buff_length;
- int separator;
- int ret;
-};
-
-struct line_reader *
-process_lines_init(const char *pathname, char separator)
+static const char *
+lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable,
+ int (*lookup_fn)(struct cpio *, const char **, id_t), id_t id)
{
- struct line_reader *lr;
+ char asnum[16];
+ struct name_cache *cache;
+ const char *name;
+ int slot;
+
+
+ if (*name_cache_variable == NULL) {
+ *name_cache_variable = malloc(sizeof(struct name_cache));
+ if (*name_cache_variable == NULL)
+ lafe_errc(1, ENOMEM, "No more memory");
+ memset(*name_cache_variable, 0, sizeof(struct name_cache));
+ (*name_cache_variable)->size = name_cache_size;
+ }
- lr = calloc(1, sizeof(*lr));
- if (lr == NULL)
- cpio_errc(1, ENOMEM, "Can't open %s", pathname);
+ cache = *name_cache_variable;
+ cache->probes++;
- lr->separator = separator;
- lr->pathname = strdup(pathname);
+ slot = id % cache->size;
+ if (cache->cache[slot].name != NULL) {
+ if (cache->cache[slot].id == id) {
+ cache->hits++;
+ return (cache->cache[slot].name);
+ }
+ free(cache->cache[slot].name);
+ cache->cache[slot].name = NULL;
+ }
- if (strcmp(pathname, "-") == 0)
- lr->f = stdin;
- else
- lr->f = fopen(pathname, "r");
- if (lr->f == NULL)
- cpio_errc(1, errno, "Couldn't open %s", pathname);
- lr->buff_length = 8192;
- lr->buff = malloc(lr->buff_length);
- if (lr->buff == NULL)
- cpio_errc(1, ENOMEM, "Can't read %s", pathname);
- lr->line_start = lr->line_end = lr->buff_end = lr->buff;
-
- return (lr);
+ if (lookup_fn(cpio, &name, id) == 0) {
+ if (name == NULL || name[0] == '\0') {
+ /* If lookup failed, format it as a number. */
+ snprintf(asnum, sizeof(asnum), "%u", (unsigned)id);
+ name = asnum;
+ }
+ cache->cache[slot].name = strdup(name);
+ if (cache->cache[slot].name != NULL) {
+ cache->cache[slot].id = id;
+ return (cache->cache[slot].name);
+ }
+ /*
+ * Conveniently, NULL marks an empty slot, so
+ * if the strdup() fails, we've just failed to
+ * cache it. No recovery necessary.
+ */
+ }
+ return (NULL);
}
-const char *
-process_lines_next(struct line_reader *lr)
+static const char *
+lookup_uname(struct cpio *cpio, uid_t uid)
{
- size_t bytes_wanted, bytes_read, new_buff_size;
- char *line_start, *p;
+ return (lookup_name(cpio, &cpio->uname_cache,
+ &lookup_uname_helper, (id_t)uid));
+}
- for (;;) {
- /* If there's a line in the buffer, return it immediately. */
- while (lr->line_end < lr->buff_end) {
- if (*lr->line_end == lr->separator) {
- *lr->line_end = '\0';
- line_start = lr->line_start;
- lr->line_start = lr->line_end + 1;
- lr->line_end = lr->line_start;
- return (line_start);
- } else
- lr->line_end++;
- }
+static int
+lookup_uname_helper(struct cpio *cpio, const char **name, id_t id)
+{
+ struct passwd *pwent;
- /* If we're at end-of-file, process the final data. */
- if (lr->f == NULL) {
- /* If there's more text, return one last line. */
- if (lr->line_end > lr->line_start) {
- *lr->line_end = '\0';
- line_start = lr->line_start;
- lr->line_start = lr->line_end + 1;
- lr->line_end = lr->line_start;
- return (line_start);
- }
- /* Otherwise, we're done. */
- return (NULL);
- }
+ (void)cpio; /* UNUSED */
- /* Buffer only has part of a line. */
- if (lr->line_start > lr->buff) {
- /* Move a leftover fractional line to the beginning. */
- memmove(lr->buff, lr->line_start,
- lr->buff_end - lr->line_start);
- lr->buff_end -= lr->line_start - lr->buff;
- lr->line_end -= lr->line_start - lr->buff;
- lr->line_start = lr->buff;
- } else {
- /* Line is too big; enlarge the buffer. */
- new_buff_size = lr->buff_length * 2;
- if (new_buff_size <= lr->buff_length)
- cpio_errc(1, ENOMEM,
- "Line too long in %s", lr->pathname);
- lr->buff_length = new_buff_size;
- p = realloc(lr->buff, new_buff_size);
- if (p == NULL)
- cpio_errc(1, ENOMEM,
- "Line too long in %s", lr->pathname);
- lr->buff_end = p + (lr->buff_end - lr->buff);
- lr->line_end = p + (lr->line_end - lr->buff);
- lr->line_start = lr->buff = p;
- }
+ errno = 0;
+ pwent = getpwuid((uid_t)id);
+ if (pwent == NULL) {
+ *name = NULL;
+ if (errno != 0 && errno != ENOENT)
+ lafe_warnc(errno, "getpwuid(%d) failed", id);
+ return (errno);
+ }
- /* Get some more data into the buffer. */
- bytes_wanted = lr->buff + lr->buff_length - lr->buff_end;
- bytes_read = fread(lr->buff_end, 1, bytes_wanted, lr->f);
- lr->buff_end += bytes_read;
-
- if (ferror(lr->f))
- cpio_errc(1, errno, "Can't read %s", lr->pathname);
- if (feof(lr->f)) {
- if (lr->f != stdin)
- fclose(lr->f);
- lr->f = NULL;
- }
+ *name = pwent->pw_name;
+ return (0);
+}
+
+static const char *
+lookup_gname(struct cpio *cpio, gid_t gid)
+{
+ return (lookup_name(cpio, &cpio->gname_cache,
+ &lookup_gname_helper, (id_t)gid));
+}
+
+static int
+lookup_gname_helper(struct cpio *cpio, const char **name, id_t id)
+{
+ struct group *grent;
+
+ (void)cpio; /* UNUSED */
+
+ errno = 0;
+ grent = getgrgid((gid_t)id);
+ if (grent == NULL) {
+ *name = NULL;
+ if (errno != 0)
+ lafe_warnc(errno, "getgrgid(%d) failed", id);
+ return (errno);
}
+
+ *name = grent->gr_name;
+ return (0);
}
-void
-process_lines_free(struct line_reader *lr)
+/*
+ * It would be nice to just use printf() for formatting large numbers,
+ * but the compatibility problems are a big headache. Hence the
+ * following simple utility function.
+ */
+const char *
+cpio_i64toa(int64_t n0)
{
- free(lr->buff);
- free(lr->pathname);
- free(lr);
+ // 2^64 =~ 1.8 * 10^19, so 20 decimal digits suffice.
+ // We also need 1 byte for '-' and 1 for '\0'.
+ static char buff[22];
+ int64_t n = n0 < 0 ? -n0 : n0;
+ char *p = buff + sizeof(buff);
+
+ *--p = '\0';
+ do {
+ *--p = '0' + (int)(n % 10);
+ n /= 10;
+ } while (n > 0);
+ if (n0 < 0)
+ *--p = '-';
+ return p;
}
diff --git a/archivers/libarchive/files/cpio/cpio.h b/archivers/libarchive/files/cpio/cpio.h
index 3afd9520309..3eed83494b8 100644
--- a/archivers/libarchive/files/cpio/cpio.h
+++ b/archivers/libarchive/files/cpio/cpio.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/usr.bin/cpio/cpio.h,v 1.2 2008/06/21 02:20:20 kientzle Exp $
+ * $FreeBSD: src/usr.bin/cpio/cpio.h,v 1.7 2008/12/06 07:30:40 kientzle Exp $
*/
#ifndef CPIO_H_INCLUDED
@@ -31,7 +31,7 @@
#include "cpio_platform.h"
#include <stdio.h>
-#define DEFAULT_BYTES_PER_BLOCK (20*512)
+#include "matching.h"
/*
* The internal state for the "cpio" program.
@@ -42,8 +42,11 @@
* functions.
*/
struct cpio {
+ /* Option parsing */
+ const char *optarg;
+
/* Options */
- char *filename;
+ const char *filename;
char mode; /* -i -o -p */
char compress; /* -j, -y, or -z */
const char *format; /* -H format */
@@ -53,58 +56,54 @@ struct cpio {
int extract_flags; /* Flags for extract operation */
char symlink_mode; /* H or L, per BSD conventions */
const char *compress_program;
- char line_separator; /* --null ? '\0' : '\n' */
int option_append; /* -A, only relevant for -o */
int option_atime_restore; /* -a */
int option_follow_links; /* -L */
int option_link; /* -l */
int option_list; /* -t */
+ char option_null; /* --null */
+ int option_numeric_uid_gid; /* -n */
int option_rename; /* -r */
char *destdir;
size_t pass_destpath_alloc;
char *pass_destpath;
int uid_override;
int gid_override;
+ int day_first; /* true if locale prefers day/mon */
/* If >= 0, then close this when done. */
int fd;
/* Miscellaneous state information */
struct archive *archive;
+ struct archive *archive_read_disk;
int argc;
char **argv;
int return_value; /* Value returned by main() */
struct archive_entry_linkresolver *linkresolver;
+ struct name_cache *uname_cache;
+ struct name_cache *gname_cache;
+
/* Work data. */
- struct matching *matching;
+ struct lafe_matching *matching;
char *buff;
size_t buff_size;
};
-/* Name of this program; used in error reporting, initialized in main(). */
-const char *cpio_progname;
-
-void cpio_errc(int _eval, int _code, const char *fmt, ...);
-void cpio_warnc(int _code, const char *fmt, ...);
-
-int owner_parse(const char *, int *, int *);
+const char *owner_parse(const char *, int *, int *);
/* Fake short equivalents for long options that otherwise lack them. */
enum {
OPTION_INSECURE = 1,
+ OPTION_LZMA,
+ OPTION_NO_PRESERVE_OWNER,
+ OPTION_PRESERVE_OWNER,
OPTION_QUIET,
OPTION_VERSION
};
-struct line_reader;
-
-struct line_reader *process_lines_init(const char *, char separator);
-const char *process_lines_next(struct line_reader *);
-void process_lines_free(struct line_reader *);
-
int cpio_getopt(struct cpio *cpio);
-int include_from_file(struct cpio *, const char *);
#endif
diff --git a/archivers/libarchive/files/cpio/cpio_platform.h b/archivers/libarchive/files/cpio/cpio_platform.h
index 31451982982..31d9a738fcb 100644
--- a/archivers/libarchive/files/cpio/cpio_platform.h
+++ b/archivers/libarchive/files/cpio/cpio_platform.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: src/usr.bin/cpio/cpio_platform.h,v 1.2 2008/12/06 07:15:42 kientzle Exp $
*/
/*
@@ -37,19 +37,18 @@
#if defined(PLATFORM_CONFIG_H)
/* Use hand-built config.h in environments that need it. */
#include PLATFORM_CONFIG_H
-#elif defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../config.h"
#else
-/* Warn if cpio hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no built-in configuration in cpio_platform.h.
-#endif /* !HAVE_CONFIG_H */
+/* Read config.h or die trying. */
+#include "config.h"
+#endif
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
-#else
-/* Just leaving this macro replacement empty leads to a dangling semicolon. */
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
#define __FBSDID(a) struct _undefined_hack
#endif
@@ -63,22 +62,16 @@
#include "archive_entry.h"
#endif
-/*
- * We need to be able to display a filesize using printf(). The type
- * and format string here must be compatible with one another and
- * large enough for any file.
- */
-#if HAVE_UINTMAX_T
-#define CPIO_FILESIZE_TYPE uintmax_t
-#define CPIO_FILESIZE_PRINTF "%ju"
+/* How to mark functions that don't return. */
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_DEAD __attribute__((__noreturn__))
#else
-#if HAVE_UNSIGNED_LONG_LONG
-#define CPIO_FILESIZE_TYPE unsigned long long
-#define CPIO_FILESIZE_PRINTF "%llu"
-#else
-#define CPIO_FILESIZE_TYPE unsigned long
-#define CPIO_FILESIZE_PRINTF "%lu"
+#define __LA_DEAD
#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "cpio_windows.h"
#endif
#endif /* !CPIO_PLATFORM_H_INCLUDED */
diff --git a/archivers/libarchive/files/cpio/cpio_windows.c b/archivers/libarchive/files/cpio/cpio_windows.c
new file mode 100644
index 00000000000..420e01d5e19
--- /dev/null
+++ b/archivers/libarchive/files/cpio/cpio_windows.c
@@ -0,0 +1,338 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#include "cpio_platform.h"
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <io.h>
+#include <stddef.h>
+#ifdef HAVE_SYS_UTIME_H
+#include <sys/utime.h>
+#endif
+#include <sys/stat.h>
+#include <process.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <windows.h>
+#include <sddl.h>
+
+#include "cpio.h"
+#include "err.h"
+
+#define EPOC_TIME (116444736000000000ULL)
+
+static void cpio_dosmaperr(unsigned long);
+
+/*
+ * Prepend "\\?\" to the path name and convert it to unicode to permit
+ * an extended-length path for a maximum total path length of 32767
+ * characters.
+ * see also http://msdn.microsoft.com/en-us/library/aa365247.aspx
+ */
+static wchar_t *
+permissive_name(const char *name)
+{
+ wchar_t *wn, *wnp;
+ wchar_t *ws, *wsp;
+ DWORD l, len, slen, alloclen;
+ int unc;
+
+ len = (DWORD)strlen(name);
+ wn = malloc((len + 1) * sizeof(wchar_t));
+ if (wn == NULL)
+ return (NULL);
+ l = MultiByteToWideChar(CP_ACP, 0, name, len, wn, len);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wn[l] = L'\0';
+
+ /* Get a full path names */
+ l = GetFullPathNameW(wn, 0, NULL, NULL);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wnp = malloc(l * sizeof(wchar_t));
+ if (wnp == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ len = GetFullPathNameW(wn, l, wnp, NULL);
+ free(wn);
+ wn = wnp;
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'?' && wnp[3] == L'\\')
+ /* We have already permissive names. */
+ return (wn);
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'.' && wnp[3] == L'\\') {
+ /* Device names */
+ if (((wnp[4] >= L'a' && wnp[4] <= L'z') ||
+ (wnp[4] >= L'A' && wnp[4] <= L'Z')) &&
+ wnp[5] == L':' && wnp[6] == L'\\')
+ wnp[2] = L'?';/* Not device names. */
+ return (wn);
+ }
+
+ unc = 0;
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' && wnp[2] != L'\\') {
+ wchar_t *p = &wnp[2];
+
+ /* Skip server-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\') {
+ wchar_t *rp = ++p;
+ /* Skip share-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\' && p != rp) {
+ /* Now, match patterns such as
+ * "\\server-name\share-name\" */
+ wnp += 2;
+ len -= 2;
+ unc = 1;
+ }
+ }
+ }
+
+ alloclen = slen = 4 + (unc * 4) + len + 1;
+ ws = wsp = malloc(slen * sizeof(wchar_t));
+ if (ws == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ /* prepend "\\?\" */
+ wcsncpy(wsp, L"\\\\?\\", 4);
+ wsp += 4;
+ slen -= 4;
+ if (unc) {
+ /* append "UNC\" ---> "\\?\UNC\" */
+ wcsncpy(wsp, L"UNC\\", 4);
+ wsp += 4;
+ slen -= 4;
+ }
+ wcsncpy(wsp, wnp, slen);
+ free(wn);
+ ws[alloclen - 1] = L'\0';
+ return (ws);
+}
+
+static HANDLE
+cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
+ DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+{
+ wchar_t *wpath;
+ HANDLE handle;
+
+ handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
+ lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
+ hTemplateFile);
+ if (handle != INVALID_HANDLE_VALUE)
+ return (handle);
+ if (GetLastError() != ERROR_PATH_NOT_FOUND)
+ return (handle);
+ wpath = permissive_name(path);
+ if (wpath == NULL)
+ return (handle);
+ handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
+ lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
+ hTemplateFile);
+ free(wpath);
+ return (handle);
+}
+
+#define WINTIME(sec, usec) ((Int32x32To64(sec, 10000000) + EPOC_TIME) + (usec * 10))
+static int
+__hutimes(HANDLE handle, const struct __timeval *times)
+{
+ ULARGE_INTEGER wintm;
+ FILETIME fatime, fmtime;
+
+ wintm.QuadPart = WINTIME(times[0].tv_sec, times[0].tv_usec);
+ fatime.dwLowDateTime = wintm.LowPart;
+ fatime.dwHighDateTime = wintm.HighPart;
+ wintm.QuadPart = WINTIME(times[1].tv_sec, times[1].tv_usec);
+ fmtime.dwLowDateTime = wintm.LowPart;
+ fmtime.dwHighDateTime = wintm.HighPart;
+ if (SetFileTime(handle, NULL, &fatime, &fmtime) == 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ return (0);
+}
+
+int
+futimes(int fd, const struct __timeval *times)
+{
+
+ return (__hutimes((HANDLE)_get_osfhandle(fd), times));
+}
+
+int
+utimes(const char *name, const struct __timeval *times)
+{
+ int ret;
+ HANDLE handle;
+
+ handle = cpio_CreateFile(name, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (handle == INVALID_HANDLE_VALUE) {
+ cpio_dosmaperr(GetLastError());
+ return (-1);
+ }
+ ret = __hutimes(handle, times);
+ CloseHandle(handle);
+ return (ret);
+}
+
+/*
+ * The following function was modified from PostgreSQL sources and is
+ * subject to the copyright below.
+ */
+/*-------------------------------------------------------------------------
+ *
+ * win32error.c
+ * Map win32 error codes to errno values
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * $PostgreSQL: pgsql/src/port/win32error.c,v 1.4 2008/01/01 19:46:00 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+/*
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+*/
+
+static const struct {
+ DWORD winerr;
+ int doserr;
+} doserrors[] =
+{
+ { ERROR_INVALID_FUNCTION, EINVAL },
+ { ERROR_FILE_NOT_FOUND, ENOENT },
+ { ERROR_PATH_NOT_FOUND, ENOENT },
+ { ERROR_TOO_MANY_OPEN_FILES, EMFILE },
+ { ERROR_ACCESS_DENIED, EACCES },
+ { ERROR_INVALID_HANDLE, EBADF },
+ { ERROR_ARENA_TRASHED, ENOMEM },
+ { ERROR_NOT_ENOUGH_MEMORY, ENOMEM },
+ { ERROR_INVALID_BLOCK, ENOMEM },
+ { ERROR_BAD_ENVIRONMENT, E2BIG },
+ { ERROR_BAD_FORMAT, ENOEXEC },
+ { ERROR_INVALID_ACCESS, EINVAL },
+ { ERROR_INVALID_DATA, EINVAL },
+ { ERROR_INVALID_DRIVE, ENOENT },
+ { ERROR_CURRENT_DIRECTORY, EACCES },
+ { ERROR_NOT_SAME_DEVICE, EXDEV },
+ { ERROR_NO_MORE_FILES, ENOENT },
+ { ERROR_LOCK_VIOLATION, EACCES },
+ { ERROR_SHARING_VIOLATION, EACCES },
+ { ERROR_BAD_NETPATH, ENOENT },
+ { ERROR_NETWORK_ACCESS_DENIED, EACCES },
+ { ERROR_BAD_NET_NAME, ENOENT },
+ { ERROR_FILE_EXISTS, EEXIST },
+ { ERROR_CANNOT_MAKE, EACCES },
+ { ERROR_FAIL_I24, EACCES },
+ { ERROR_INVALID_PARAMETER, EINVAL },
+ { ERROR_NO_PROC_SLOTS, EAGAIN },
+ { ERROR_DRIVE_LOCKED, EACCES },
+ { ERROR_BROKEN_PIPE, EPIPE },
+ { ERROR_DISK_FULL, ENOSPC },
+ { ERROR_INVALID_TARGET_HANDLE, EBADF },
+ { ERROR_INVALID_HANDLE, EINVAL },
+ { ERROR_WAIT_NO_CHILDREN, ECHILD },
+ { ERROR_CHILD_NOT_COMPLETE, ECHILD },
+ { ERROR_DIRECT_ACCESS_HANDLE, EBADF },
+ { ERROR_NEGATIVE_SEEK, EINVAL },
+ { ERROR_SEEK_ON_DEVICE, EACCES },
+ { ERROR_DIR_NOT_EMPTY, ENOTEMPTY },
+ { ERROR_NOT_LOCKED, EACCES },
+ { ERROR_BAD_PATHNAME, ENOENT },
+ { ERROR_MAX_THRDS_REACHED, EAGAIN },
+ { ERROR_LOCK_FAILED, EACCES },
+ { ERROR_ALREADY_EXISTS, EEXIST },
+ { ERROR_FILENAME_EXCED_RANGE, ENOENT },
+ { ERROR_NESTING_NOT_ALLOWED, EAGAIN },
+ { ERROR_NOT_ENOUGH_QUOTA, ENOMEM }
+};
+
+static void
+cpio_dosmaperr(unsigned long e)
+{
+ int i;
+
+ if (e == 0) {
+ errno = 0;
+ return;
+ }
+
+ for (i = 0; i < sizeof(doserrors); i++) {
+ if (doserrors[i].winerr == e) {
+ errno = doserrors[i].doserr;
+ return;
+ }
+ }
+
+ /* fprintf(stderr, "unrecognized win32 error code: %lu", e); */
+ errno = EINVAL;
+ return;
+}
+#endif
diff --git a/archivers/libarchive/files/cpio/cpio_windows.h b/archivers/libarchive/files/cpio/cpio_windows.h
new file mode 100644
index 00000000000..105bf69991d
--- /dev/null
+++ b/archivers/libarchive/files/cpio/cpio_windows.h
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef CPIO_WINDOWS_H
+#define CPIO_WINDOWS_H 1
+
+#include <io.h>
+#include <string.h>
+
+#define getgrgid(id) NULL
+#define getgrnam(name) NULL
+#define getpwnam(name) NULL
+#define getpwuid(id) NULL
+
+#ifdef _MSC_VER
+#define snprintf sprintf_s
+#define strdup _strdup
+#define open _open
+#define read _read
+#define close _close
+#endif
+
+struct passwd {
+ char *pw_name;
+ uid_t pw_uid;
+ gid_t pw_gid;
+};
+
+struct group {
+ char *gr_name;
+ gid_t gr_gid;
+};
+
+struct _timeval64i32 {
+ time_t tv_sec;
+ long tv_usec;
+};
+#define __timeval _timeval64i32
+
+extern int futimes(int fd, const struct __timeval *times);
+#ifndef HAVE_FUTIMES
+#define HAVE_FUTIMES 1
+#endif
+extern int utimes(const char *name, const struct __timeval *times);
+#ifndef HAVE_UTIMES
+#define HAVE_UTIMES 1
+#endif
+
+#endif /* CPIO_WINDOWS_H */
diff --git a/archivers/libarchive/files/cpio/test/CMakeLists.txt b/archivers/libarchive/files/cpio/test/CMakeLists.txt
new file mode 100644
index 00000000000..a822bcdfba5
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/CMakeLists.txt
@@ -0,0 +1,79 @@
+############################################
+#
+# How to build bsdcpio_test
+#
+############################################
+IF(ENABLE_CPIO AND ENABLE_TEST)
+ SET(bsdcpio_test_SOURCES
+ ../cmdline.c
+ ../../libarchive_fe/err.c
+ ../../libarchive_fe/pathmatch.c
+ main.c
+ test.h
+ test_0.c
+ test_basic.c
+ test_cmdline.c
+ test_format_newc.c
+ test_gcpio_compat.c
+ test_option_B_upper.c
+ test_option_C_upper.c
+ test_option_J_upper.c
+ test_option_L_upper.c
+ test_option_Z_upper.c
+ test_option_a.c
+ test_option_c.c
+ test_option_d.c
+ test_option_f.c
+ test_option_help.c
+ test_option_l.c
+ test_option_lzma.c
+ test_option_m.c
+ test_option_t.c
+ test_option_u.c
+ test_option_version.c
+ test_option_y.c
+ test_option_z.c
+ test_owner_parse.c
+ test_passthrough_dotdot.c
+ test_passthrough_reverse.c
+ test_pathmatch.c
+ )
+ IF(WIN32 AND NOT CYGWIN)
+ LIST(APPEND bsdcpio_test_SOURCES ../cpio_windows.h)
+ ENDIF(WIN32 AND NOT CYGWIN)
+
+ #
+ # Register target
+ #
+ ADD_EXECUTABLE(bsdcpio_test ${bsdcpio_test_SOURCES})
+ SET_PROPERTY(TARGET bsdcpio_test PROPERTY COMPILE_DEFINITIONS LIST_H)
+
+ #
+ # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
+ #
+ GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
+ ${CMAKE_CURRENT_LIST_FILE} ${bsdcpio_test_SOURCES})
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+ # list.h has a line DEFINE_TEST(testname) for every
+ # test. We can use that to define the tests for cmake by
+ # defining a DEFINE_TEST macro and reading list.h in.
+ MACRO (DEFINE_TEST _testname)
+ ADD_TEST_28(
+ NAME bsdcpio_${_testname}
+ COMMAND bsdcpio_test -vv
+ -p $<TARGET_FILE:bsdcpio>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
+ ENDMACRO (DEFINE_TEST _testname)
+
+ INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
+
+ # Experimental new test handling
+ ADD_CUSTOM_TARGET(run_bsdcpio_test
+ COMMAND bsdcpio_test -p ${BSDCPIO} -r ${CMAKE_CURRENT_SOURCE_DIR})
+ ADD_DEPENDENCIES(run_bsdcpio_test bsdcpio)
+ ADD_DEPENDENCIES(run_all_tests run_bsdcpio_test)
+ENDIF(ENABLE_CPIO AND ENABLE_TEST)
+
diff --git a/archivers/libarchive/files/cpio/test/list.h b/archivers/libarchive/files/cpio/test/list.h
index 42cc5588218..55968c363fa 100644
--- a/archivers/libarchive/files/cpio/test/list.h
+++ b/archivers/libarchive/files/cpio/test/list.h
@@ -1,15 +1,20 @@
DEFINE_TEST(test_0)
DEFINE_TEST(test_basic)
+DEFINE_TEST(test_cmdline)
DEFINE_TEST(test_format_newc)
DEFINE_TEST(test_gcpio_compat)
-DEFINE_TEST(test_option_B)
-DEFINE_TEST(test_option_L)
+DEFINE_TEST(test_option_B_upper)
+DEFINE_TEST(test_option_C_upper)
+DEFINE_TEST(test_option_J_upper)
+DEFINE_TEST(test_option_L_upper)
+DEFINE_TEST(test_option_Z_upper)
DEFINE_TEST(test_option_a)
DEFINE_TEST(test_option_c)
DEFINE_TEST(test_option_d)
-DEFINE_TEST(test_option_ell)
DEFINE_TEST(test_option_f)
DEFINE_TEST(test_option_help)
+DEFINE_TEST(test_option_l)
+DEFINE_TEST(test_option_lzma)
DEFINE_TEST(test_option_m)
DEFINE_TEST(test_option_t)
DEFINE_TEST(test_option_u)
@@ -17,4 +22,6 @@ DEFINE_TEST(test_option_version)
DEFINE_TEST(test_option_y)
DEFINE_TEST(test_option_z)
DEFINE_TEST(test_owner_parse)
+DEFINE_TEST(test_passthrough_dotdot)
+DEFINE_TEST(test_passthrough_reverse)
DEFINE_TEST(test_pathmatch)
diff --git a/archivers/libarchive/files/cpio/test/main.c b/archivers/libarchive/files/cpio/test/main.c
index e0f8c2e1175..a8b68146eb7 100644
--- a/archivers/libarchive/files/cpio/test/main.c
+++ b/archivers/libarchive/files/cpio/test/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Various utility routines useful for test programs.
- * Each test program is linked against this file.
- */
#include "test.h"
-
#include <errno.h>
#include <locale.h>
#include <stdarg.h>
@@ -38,148 +33,318 @@
* This same file is used pretty much verbatim for all test harnesses.
*
* The next few lines are the only differences.
+ * TODO: Move this into a separate configuration header, have all test
+ * suites share one copy of this file.
*/
-#define PROGRAM "bsdcpio" /* Name of program being tested. */
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kientzle Exp $");
+#define KNOWNREF "test_option_f.cpio.uu"
#define ENVBASE "BSDCPIO" /* Prefix for environment variables. */
+#define PROGRAM "bsdcpio" /* Name of program being tested. */
+#undef LIBRARY /* Not testing a library. */
#undef EXTRA_DUMP /* How to dump extra data */
/* How to generate extra version info. */
#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "")
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.2 2008/06/21 02:17:18 kientzle Exp $");
/*
- * "list.h" is simply created by "grep DEFINE_TEST"; it has
- * a line like
- * DEFINE_TEST(test_function)
- * for each test.
- * Include it here with a suitable DEFINE_TEST to declare all of the
- * test functions.
+ *
+ * Windows support routines
+ *
+ * Note: Configuration is a tricky issue. Using HAVE_* feature macros
+ * in the test harness is dangerous because they cover up
+ * configuration errors. The classic example of this is omitting a
+ * configure check. If libarchive and libarchive_test both look for
+ * the same feature macro, such errors are hard to detect. Platform
+ * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
+ * easily lead to very messy code. It's best to limit yourself
+ * to only the most generic programming techniques in the test harness
+ * and thus avoid conditionals altogether. Where that's not possible,
+ * try to minimize conditionals by grouping platform-specific tests in
+ * one place (e.g., test_acl_freebsd) or by adding new assert()
+ * functions (e.g., assertMakeHardlink()) to cover up platform
+ * differences. Platform-specific coding in libarchive_test is often
+ * a symptom that some capability is missing from libarchive itself.
*/
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void);
-#include "list.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <io.h>
+#include <windows.h>
+#ifndef F_OK
+#define F_OK (0)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) ((m) & _S_IFDIR)
+#endif
+#ifndef S_ISREG
+#define S_ISREG(m) ((m) & _S_IFREG)
+#endif
+#if !defined(__BORLANDC__)
+#define access _access
+#define chdir _chdir
+#endif
+#ifndef fileno
+#define fileno _fileno
+#endif
+/*#define fstat _fstat64*/
+#if !defined(__BORLANDC__)
+#define getcwd _getcwd
+#endif
+#define lstat stat
+/*#define lstat _stat64*/
+/*#define stat _stat64*/
+#define rmdir _rmdir
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#define umask _umask
+#endif
+#define int64_t __int64
+#endif
+
+#if defined(HAVE__CrtSetReportMode)
+# include <crtdbg.h>
+#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+void *GetFunctionKernel32(const char *name)
+{
+ static HINSTANCE lib;
+ static int set;
+ if (!set) {
+ set = 1;
+ lib = LoadLibrary("kernel32.dll");
+ }
+ if (lib == NULL) {
+ fprintf(stderr, "Can't load kernel32.dll?!\n");
+ exit(1);
+ }
+ return (void *)GetProcAddress(lib, name);
+}
+
+static int
+my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateSymbolicLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, flags);
+}
+
+static int
+my_CreateHardLinkA(const char *linkname, const char *target)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateHardLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, NULL);
+}
+
+int
+my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
+{
+ HANDLE h;
+ int r;
+
+ memset(bhfi, 0, sizeof(*bhfi));
+ h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE)
+ return (0);
+ r = GetFileInformationByHandle(h, bhfi);
+ CloseHandle(h);
+ return (r);
+}
+#endif
-/* Interix doesn't define these in a standard header. */
-#if __INTERIX__
-extern char *optarg;
-extern int optind;
+#if defined(HAVE__CrtSetReportMode)
+static void
+invalid_parameter_handler(const wchar_t * expression,
+ const wchar_t * function, const wchar_t * file,
+ unsigned int line, uintptr_t pReserved)
+{
+ /* nop */
+}
#endif
+/*
+ *
+ * OPTIONS FLAGS
+ *
+ */
+
/* Enable core dump on failure. */
static int dump_on_failure = 0;
-/* Default is to remove temp dirs for successful tests. */
+/* Default is to remove temp dirs and log data for successful tests. */
static int keep_temp_files = 0;
-/* Default is to print some basic information about each test. */
-static int quiet_flag = 0;
-/* Default is to summarize repeated failures. */
-static int verbose = 0;
-/* Cumulative count of component failures. */
+/* Default is to just report pass/fail for each test. */
+static int verbosity = 0;
+#define VERBOSITY_SUMMARY_ONLY -1 /* -q */
+#define VERBOSITY_PASSFAIL 0 /* Default */
+#define VERBOSITY_LIGHT_REPORT 1 /* -v */
+#define VERBOSITY_FULL 2 /* -vv */
+/* A few places generate even more output for verbosity > VERBOSITY_FULL,
+ * mostly for debugging the test harness itself. */
+/* Cumulative count of assertion failures. */
static int failures = 0;
-/* Cumulative count of skipped component tests. */
+/* Cumulative count of reported skips. */
static int skips = 0;
-/* Cumulative count of assertions. */
+/* Cumulative count of assertions checked. */
static int assertions = 0;
/* Directory where uuencoded reference files can be found. */
-static char *refdir;
-
-/*
- * My own implementation of the standard assert() macro emits the
- * message in the same format as GCC (file:line: message).
- * It also includes some additional useful information.
- * This makes it a lot easier to skim through test failures in
- * Emacs. ;-)
- *
- * It also supports a few special features specifically to simplify
- * test harnesses:
- * failure(fmt, args) -- Stores a text string that gets
- * printed if the following assertion fails, good for
- * explaining subtle tests.
- */
-static char msg[4096];
+static const char *refdir;
/*
- * For each test source file, we remember how many times each
- * failure was reported.
+ * Report log information selectively to console and/or disk log.
*/
-static const char *failed_filename = NULL;
-static struct line {
- int line;
- int count;
-} failed_lines[1000];
-
-/*
- * Count this failure; return the number of previous failures.
- */
-static int
-previous_failures(const char *filename, int line)
+static int log_console = 0;
+static FILE *logfile;
+static void
+vlogprintf(const char *fmt, va_list ap)
{
- unsigned int i;
- int count;
+#ifdef va_copy
+ va_list lfap;
+ va_copy(lfap, ap);
+#endif
+ if (log_console)
+ vfprintf(stdout, fmt, ap);
+ if (logfile != NULL)
+#ifdef va_copy
+ vfprintf(logfile, fmt, lfap);
+ va_end(lfap);
+#else
+ vfprintf(logfile, fmt, ap);
+#endif
+}
- if (failed_filename == NULL || strcmp(failed_filename, filename) != 0)
- memset(failed_lines, 0, sizeof(failed_lines));
- failed_filename = filename;
+static void
+logprintf(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vlogprintf(fmt, ap);
+ va_end(ap);
+}
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == line) {
- count = failed_lines[i].count;
- failed_lines[i].count++;
- return (count);
- }
- if (failed_lines[i].line == 0) {
- failed_lines[i].line = line;
- failed_lines[i].count = 1;
- return (0);
- }
- }
- return (0);
+/* Set up a message to display only if next assertion fails. */
+static char msgbuff[4096];
+static const char *msg, *nextmsg;
+void
+failure(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vsprintf(msgbuff, fmt, ap);
+ va_end(ap);
+ nextmsg = msgbuff;
}
/*
* Copy arguments into file-local variables.
+ * This was added to permit vararg assert() functions without needing
+ * variadic wrapper macros. Turns out that the vararg capability is almost
+ * never used, so almost all of the vararg assertions can be simplified
+ * by removing the vararg capability and reworking the wrapper macro to
+ * pass __FILE__, __LINE__ directly into the function instead of using
+ * this hook. I suspect this machinery is used so rarely that we
+ * would be better off just removing it entirely. That would simplify
+ * the code here noticably.
*/
static const char *test_filename;
static int test_line;
static void *test_extra;
-void test_setup(const char *filename, int line)
+void assertion_setup(const char *filename, int line)
{
test_filename = filename;
test_line = line;
}
+/* Called at the beginning of each assert() function. */
+static void
+assertion_count(const char *file, int line)
+{
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ ++assertions;
+ /* Proper handling of "failure()" message. */
+ msg = nextmsg;
+ nextmsg = NULL;
+ /* Uncomment to print file:line after every assertion.
+ * Verbose, but occasionally useful in tracking down crashes. */
+ /* printf("Checked %s:%d\n", file, line); */
+}
+
/*
- * Inform user that we're skipping a test.
+ * For each test source file, we remember how many times each
+ * assertion was reported. Cleared before each new test,
+ * used by test_summarize().
*/
-void
-test_skipping(const char *fmt, ...)
+static struct line {
+ int count;
+ int skip;
+} failed_lines[10000];
+
+/* Count this failure, setup up log destination and handle initial report. */
+static void
+failure_start(const char *filename, int line, const char *fmt, ...)
{
va_list ap;
- if (previous_failures(test_filename, test_line))
- return;
+ /* Record another failure for this line. */
+ ++failures;
+ /* test_filename = filename; */
+ failed_lines[line].count++;
+
+ /* Determine whether to log header to console. */
+ switch (verbosity) {
+ case VERBOSITY_FULL:
+ log_console = 1;
+ break;
+ case VERBOSITY_LIGHT_REPORT:
+ log_console = (failed_lines[line].count < 2);
+ break;
+ default:
+ log_console = 0;
+ }
+ /* Log file:line header for this failure */
va_start(ap, fmt);
- fprintf(stderr, " *** SKIPPING: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
+#if _MSC_VER
+ logprintf("%s(%d): ", filename, line);
+#else
+ logprintf("%s:%d: ", filename, line);
+#endif
+ vlogprintf(fmt, ap);
va_end(ap);
- ++skips;
+ logprintf("\n");
+
+ if (msg != NULL && msg[0] != '\0') {
+ logprintf(" Description: %s\n", msg);
+ msg = NULL;
+ }
+
+ /* Determine whether to log details to console. */
+ if (verbosity == VERBOSITY_LIGHT_REPORT)
+ log_console = 0;
}
-/* Common handling of failed tests. */
+/* Complete reporting of failed tests. */
+/*
+ * The 'extra' hook here is used by libarchive to include libarchive
+ * error messages with assertion failures. It could also be used
+ * to add strerror() output, for example. Just define the EXTRA_DUMP()
+ * macro appropriately.
+ */
static void
-report_failure(void *extra)
+failure_finish(void *extra)
{
- if (msg[0] != '\0') {
- fprintf(stderr, " Description: %s\n", msg);
- msg[0] = '\0';
- }
-
+ (void)extra; /* UNUSED (maybe) */
#ifdef EXTRA_DUMP
if (extra != NULL)
- fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra));
-#else
- (void)extra; /* UNUSED */
+ logprintf(" detail: %s\n", EXTRA_DUMP(extra));
#endif
if (dump_on_failure) {
@@ -190,203 +355,154 @@ report_failure(void *extra)
}
}
-/*
- * Summarize repeated failures in the just-completed test file.
- * The reports above suppress multiple failures from the same source
- * line; this reports on any tests that did fail multiple times.
- */
-static int
-summarize_comparator(const void *a0, const void *b0)
-{
- const struct line *a = a0, *b = b0;
- if (a->line == 0 && b->line == 0)
- return (0);
- if (a->line == 0)
- return (1);
- if (b->line == 0)
- return (-1);
- return (a->line - b->line);
-}
-
-static void
-summarize(void)
-{
- unsigned int i;
-
- qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]),
- sizeof(failed_lines[0]), summarize_comparator);
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == 0)
- break;
- if (failed_lines[i].count > 1)
- fprintf(stderr, "%s:%d: Failed %d times\n",
- failed_filename, failed_lines[i].line,
- failed_lines[i].count);
- }
- /* Clear the failure history for the next file. */
- memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/* Set up a message to display only after a test fails. */
+/* Inform user that we're skipping some checks. */
void
-failure(const char *fmt, ...)
+test_skipping(const char *fmt, ...)
{
+ char buff[1024];
va_list ap;
+
va_start(ap, fmt);
- vsprintf(msg, fmt, ap);
+ vsprintf(buff, fmt, ap);
va_end(ap);
+ /* failure_start() isn't quite right, but is awfully convenient. */
+ failure_start(test_filename, test_line, "SKIPPING: %s", buff);
+ --failures; /* Undo failures++ in failure_start() */
+ /* Don't failure_finish() here. */
+ /* Mark as skip, so doesn't count as failed test. */
+ failed_lines[test_line].skip = 1;
+ ++skips;
}
+/*
+ *
+ * ASSERTIONS
+ *
+ */
+
/* Generic assert() just displays the failed condition. */
int
-test_assert(const char *file, int line, int value, const char *condition, void *extra)
+assertion_assert(const char *file, int line, int value,
+ const char *condition, void *extra)
{
- ++assertions;
- if (value) {
- msg[0] = '\0';
- return (value);
+ assertion_count(file, line);
+ if (!value) {
+ failure_start(file, line, "Assertion failed: %s", condition);
+ failure_finish(extra);
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (value);
- fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
- fprintf(stderr, " Condition: %s\n", condition);
- report_failure(extra);
return (value);
}
-/* assertEqualInt() displays the values of the two integers. */
+/* chdir() and report any errors */
int
-test_assert_equal_int(const char *file, int line,
- int v1, const char *e1, int v2, const char *e2, void *extra)
+assertion_chdir(const char *file, int line, const char *pathname)
{
- ++assertions;
- if (v1 == v2) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (chdir(pathname) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
- file, line);
- fprintf(stderr, " %s=%d\n", e1, v1);
- fprintf(stderr, " %s=%d\n", e2, v2);
- report_failure(extra);
+ failure_start(file, line, "chdir(\"%s\")", pathname);
+ failure_finish(NULL);
+ return (0);
+
+}
+
+/* Verify two integers are equal. */
+int
+assertion_equal_int(const char *file, int line,
+ long long v1, const char *e1, long long v2, const char *e2, void *extra)
+{
+ assertion_count(file, line);
+ if (v1 == v2)
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
+ failure_finish(extra);
return (0);
}
-static void strdump(const char *p)
+static void strdump(const char *e, const char *p)
{
+ const char *q = p;
+
+ logprintf(" %s = ", e);
if (p == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("NULL");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*p != '\0') {
unsigned int c = 0xff & *p++;
switch (c) {
- case '\a': fprintf(stderr, "\a"); break;
- case '\b': fprintf(stderr, "\b"); break;
- case '\n': fprintf(stderr, "\n"); break;
- case '\r': fprintf(stderr, "\r"); break;
+ case '\a': printf("\a"); break;
+ case '\b': printf("\b"); break;
+ case '\n': printf("\n"); break;
+ case '\r': printf("\r"); break;
default:
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
}
}
- fprintf(stderr, "\"");
+ logprintf("\"");
+ logprintf(" (length %d)\n", q == NULL ? -1 : (int)strlen(q));
}
-/* assertEqualString() displays the values of the two strings. */
+/* Verify two strings are equal, dump them if not. */
int
-test_assert_equal_string(const char *file, int line,
+assertion_equal_string(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (strcmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- strdump(v1);
- fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1));
- fprintf(stderr, " %s = ", e2);
- strdump(v2);
- fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2));
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ strdump(e1, v1);
+ strdump(e2, v2);
+ failure_finish(extra);
return (0);
}
-static void wcsdump(const wchar_t *w)
+static void
+wcsdump(const char *e, const wchar_t *w)
{
+ logprintf(" %s = ", e);
if (w == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("(null)");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*w != L'\0') {
unsigned int c = *w++;
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else if (c < 256)
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
else if (c < 0x10000)
- fprintf(stderr, "\\u%04X", c);
+ logprintf("\\u%04X", c);
else
- fprintf(stderr, "\\U%08X", c);
+ logprintf("\\U%08X", c);
}
- fprintf(stderr, "\"");
+ logprintf("\"\n");
}
-/* assertEqualWString() displays the values of the two strings. */
+/* Verify that two wide strings are equal, dump them if not. */
int
-test_assert_equal_wstring(const char *file, int line,
+assertion_equal_wstring(const char *file, int line,
const wchar_t *v1, const char *e1,
const wchar_t *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL) {
- if (v2 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (v2 == NULL) {
- if (v1 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (wcscmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || wcscmp(v1, v2) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- wcsdump(v1);
- fprintf(stderr, "\n");
- fprintf(stderr, " %s = ", e2);
- wcsdump(v2);
- fprintf(stderr, "\n");
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ wcsdump(e1, v1);
+ wcsdump(e2, v2);
+ failure_finish(extra);
return (0);
}
@@ -401,226 +517,956 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset)
size_t i, j;
char sep;
+ if (p == NULL) {
+ logprintf("(null)\n");
+ return;
+ }
for(i=0; i < l; i+=16) {
- fprintf(stderr, "%04x", i + offset);
+ logprintf("%04x", (unsigned)(i + offset));
sep = ' ';
for (j = 0; j < 16 && i + j < l; j++) {
if (ref != NULL && p[i + j] != ref[i + j])
sep = '_';
- fprintf(stderr, "%c%02x", sep, 0xff & (int)p[i+j]);
+ logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
if (ref != NULL && p[i + j] == ref[i + j])
sep = ' ';
}
for (; j < 16; j++) {
- fprintf(stderr, "%c ", sep);
+ logprintf("%c ", sep);
sep = ' ';
}
- fprintf(stderr, "%c", sep);
+ logprintf("%c", sep);
for (j=0; j < 16 && i + j < l; j++) {
int c = p[i + j];
if (c >= ' ' && c <= 126)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, ".");
+ logprintf(".");
}
- fprintf(stderr, "\n");
+ logprintf("\n");
}
}
-/* assertEqualMem() displays the values of the two memory blocks. */
-/* TODO: For long blocks, hexdump the first bytes that actually differ. */
+/* Verify that two blocks of memory are the same, display the first
+ * block of differences if they're not. */
int
-test_assert_equal_mem(const char *file, int line,
- const char *v1, const char *e1,
- const char *v2, const char *e2,
+assertion_equal_mem(const char *file, int line,
+ const void *_v1, const char *e1,
+ const void *_v2, const char *e2,
size_t l, const char *ld, void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (memcmp(v1, v2, l) == 0) {
- msg[0] = '\0';
+ const char *v1 = (const char *)_v1;
+ const char *v2 = (const char *)_v2;
+ size_t offset;
+
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
return (1);
+
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" size %s = %d\n", ld, (int)l);
+ /* Dump 48 bytes (3 lines) so that the first difference is
+ * in the second line. */
+ offset = 0;
+ while (l > 64 && memcmp(v1, v2, 32) == 0) {
+ /* Two lines agree, so step forward one line. */
+ v1 += 16;
+ v2 += 16;
+ l -= 16;
+ offset += 16;
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
- file, line);
- fprintf(stderr, " size %s = %d\n", ld, (int)l);
- fprintf(stderr, " Dump of %s\n", e1);
- hexdump(v1, v2, l < 32 ? l : 32, 0);
- fprintf(stderr, " Dump of %s\n", e2);
- hexdump(v2, v1, l < 32 ? l : 32, 0);
- fprintf(stderr, "\n");
- report_failure(extra);
+ logprintf(" Dump of %s\n", e1);
+ hexdump(v1, v2, l < 64 ? l : 64, offset);
+ logprintf(" Dump of %s\n", e2);
+ hexdump(v2, v1, l < 64 ? l : 64, offset);
+ logprintf("\n");
+ failure_finish(extra);
return (0);
}
+/* Verify that the named file exists and is empty. */
int
-test_assert_empty_file(const char *f1fmt, ...)
+assertion_empty_file(const char *f1fmt, ...)
{
char buff[1024];
char f1[1024];
struct stat st;
va_list ap;
ssize_t s;
- int fd;
-
+ FILE *f;
+ assertion_count(test_filename, test_line);
va_start(ap, f1fmt);
vsprintf(f1, f1fmt, ap);
va_end(ap);
if (stat(f1, &st) != 0) {
- fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
- report_failure(NULL);
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
return (0);
}
if (st.st_size == 0)
return (1);
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
-
- fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
- fprintf(stderr, " File size: %d\n", (int)st.st_size);
- fprintf(stderr, " Contents:\n");
- fd = open(f1, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, " Unable to open %s\n", f1);
+ failure_start(test_filename, test_line, "File should be empty: %s", f1);
+ logprintf(" File size: %d\n", (int)st.st_size);
+ logprintf(" Contents:\n");
+ f = fopen(f1, "rb");
+ if (f == NULL) {
+ logprintf(" Unable to open %s\n", f1);
} else {
- s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
- s = read(fd, buff, s);
+ s = ((off_t)sizeof(buff) < st.st_size) ?
+ (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
+ s = fread(buff, 1, s, f);
hexdump(buff, NULL, s, 0);
+ fclose(f);
}
- report_failure(NULL);
+ failure_finish(NULL);
return (0);
}
-/* assertEqualFile() asserts that two files have the same contents. */
+/* Verify that the named file exists and is not empty. */
+int
+assertion_non_empty_file(const char *f1fmt, ...)
+{
+ char f1[1024];
+ struct stat st;
+ va_list ap;
+
+ assertion_count(test_filename, test_line);
+ va_start(ap, f1fmt);
+ vsprintf(f1, f1fmt, ap);
+ va_end(ap);
+
+ if (stat(f1, &st) != 0) {
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (st.st_size == 0) {
+ failure_start(test_filename, test_line, "File empty: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify that two files have the same contents. */
/* TODO: hexdump the first bytes that actually differ. */
int
-test_assert_equal_file(const char *f1, const char *f2pattern, ...)
+assertion_equal_file(const char *fn1, const char *f2pattern, ...)
{
- char f2[1024];
+ char fn2[1024];
va_list ap;
char buff1[1024];
char buff2[1024];
- int fd1, fd2;
+ FILE *f1, *f2;
int n1, n2;
+ assertion_count(test_filename, test_line);
va_start(ap, f2pattern);
- vsprintf(f2, f2pattern, ap);
+ vsprintf(fn2, f2pattern, ap);
va_end(ap);
- fd1 = open(f1, O_RDONLY);
- fd2 = open(f2, O_RDONLY);
+ f1 = fopen(fn1, "rb");
+ f2 = fopen(fn2, "rb");
for (;;) {
- n1 = read(fd1, buff1, sizeof(buff1));
- n2 = read(fd2, buff2, sizeof(buff2));
+ n1 = fread(buff1, 1, sizeof(buff1), f1);
+ n2 = fread(buff2, 1, sizeof(buff2), f2);
if (n1 != n2)
break;
- if (n1 == 0 && n2 == 0)
+ if (n1 == 0 && n2 == 0) {
+ fclose(f1);
+ fclose(f2);
return (1);
+ }
if (memcmp(buff1, buff2, n1) != 0)
break;
}
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
- fprintf(stderr, "%s:%d: Files are not identical\n",
- test_filename, test_line);
- fprintf(stderr, " file1=\"%s\"\n", f1);
- fprintf(stderr, " file2=\"%s\"\n", f2);
- report_failure(test_extra);
+ fclose(f1);
+ fclose(f2);
+ failure_start(test_filename, test_line, "Files not identical");
+ logprintf(" file1=\"%s\"\n", fn1);
+ logprintf(" file2=\"%s\"\n", fn2);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file does exist. */
int
-test_assert_file_exists(const char *fpattern, ...)
+assertion_file_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!_access(f, 0))
+ return (1);
+#else
if (!access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File doesn't exist\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file doesn't exist. */
int
-test_assert_file_not_exists(const char *fpattern, ...)
+assertion_file_not_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (_access(f, 0))
+ return (1);
+#else
if (access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File exists and shouldn't\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should not exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
-/* assertFileContents() asserts the contents of a file. */
+/* Compare the contents of a file to a block of memory. */
int
-test_assert_file_contents(const void *buff, int s, const char *fpattern, ...)
+assertion_file_contents(const void *buff, int s, const char *fpattern, ...)
{
- char f[1024];
+ char fn[1024];
va_list ap;
char *contents;
- int fd;
+ FILE *f;
int n;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
- vsprintf(f, fpattern, ap);
+ vsprintf(fn, fpattern, ap);
va_end(ap);
- fd = open(f, O_RDONLY);
+ f = fopen(fn, "rb");
+ if (f == NULL) {
+ failure_start(test_filename, test_line,
+ "File should exist: %s", fn);
+ failure_finish(test_extra);
+ return (0);
+ }
contents = malloc(s * 2);
- n = read(fd, contents, s * 2);
+ n = fread(contents, 1, s * 2, f);
+ fclose(f);
if (n == s && memcmp(buff, contents, s) == 0) {
free(contents);
return (1);
}
- failures ++;
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File contents don't match\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- if (n > 0)
- hexdump(contents, buff, n, 0);
- else {
- fprintf(stderr, " File empty, contents should be:\n");
- hexdump(buff, NULL, s, 0);
+ failure_start(test_filename, test_line, "File contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n > 512 ? 512 : n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s > 512 ? 512 : n, 0);
+ }
+ failure_finish(test_extra);
+ free(contents);
+ return (0);
+}
+
+/* Check the contents of a text file, being tolerant of line endings. */
+int
+assertion_text_file_contents(const char *buff, const char *fn)
+{
+ char *contents;
+ const char *btxt, *ftxt;
+ FILE *f;
+ int n, s;
+
+ assertion_count(test_filename, test_line);
+ f = fopen(fn, "r");
+ if (f == NULL) {
+ failure_start(test_filename, test_line,
+ "File doesn't exist: %s", fn);
+ failure_finish(test_extra);
+ return (0);
+ }
+ s = strlen(buff);
+ contents = malloc(s * 2 + 128);
+ n = fread(contents, 1, s * 2 + 128 - 1, f);
+ if (n >= 0)
+ contents[n] = '\0';
+ fclose(f);
+ /* Compare texts. */
+ btxt = buff;
+ ftxt = (const char *)contents;
+ while (*btxt != '\0' && *ftxt != '\0') {
+ if (*btxt == *ftxt) {
+ ++btxt;
+ ++ftxt;
+ continue;
}
- report_failure(test_extra);
+ if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
+ /* Pass over different new line characters. */
+ ++btxt;
+ ftxt += 2;
+ continue;
+ }
+ break;
+ }
+ if (*btxt == '\0' && *ftxt == '\0') {
+ free(contents);
+ return (1);
}
+ failure_start(test_filename, test_line, "Contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s, 0);
+ }
+ failure_finish(test_extra);
free(contents);
return (0);
}
+/* Test that two paths point to the same file. */
+/* As a side-effect, asserts that both files exist. */
+static int
+is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(path1, &bhfi1);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = my_GetFileInformationByName(path2, &bhfi2);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
+ && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
+ && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
+#else
+ struct stat st1, st2;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(path1, &st1);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = lstat(path2, &st2);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
+#endif
+}
+
+int
+assertion_is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s are not hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+int
+assertion_is_not_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (!is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s should not be hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify a/b/mtime of 'pathname'. */
+/* If 'recent', verify that it's within last 10 seconds. */
+static int
+assertion_file_time(const char *file, int line,
+ const char *pathname, long t, long nsec, char type, int recent)
+{
+ long long filet, filet_nsec;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define EPOC_TIME (116444736000000000ULL)
+ FILETIME ftime, fbirthtime, fatime, fmtime;
+ ULARGE_INTEGER wintm;
+ HANDLE h;
+ ftime.dwLowDateTime = 0;
+ ftime.dwHighDateTime = 0;
+
+ assertion_count(file, line);
+ h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ failure_start(file, line, "Can't access %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
+ switch (type) {
+ case 'a': ftime = fatime; break;
+ case 'b': ftime = fbirthtime; break;
+ case 'm': ftime = fmtime; break;
+ }
+ CloseHandle(h);
+ if (r == 0) {
+ failure_start(file, line, "Can't GetFileTime %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ wintm.LowPart = ftime.dwLowDateTime;
+ wintm.HighPart = ftime.dwHighDateTime;
+ filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
+ filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
+ nsec = (nsec / 100) * 100; /* Round the request */
+#else
+ struct stat st;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Can't stat %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ switch (type) {
+ case 'a': filet = st.st_atime; break;
+ case 'm': filet = st.st_mtime; break;
+ case 'b': filet = 0; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+#if defined(__FreeBSD__)
+ switch (type) {
+ case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
+ case 'b': filet = st.st_birthtime;
+ filet_nsec = st.st_birthtimespec.tv_nsec; break;
+ case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ filet_nsec = (filet_nsec / 1000) * 1000;
+ nsec = (nsec / 1000) * 1000;
+#else
+ filet_nsec = nsec = 0; /* Generic POSIX only has whole seconds. */
+ if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
+#if defined(__HAIKU__)
+ if (type == 'a') return (1); /* Haiku doesn't have atime. */
+#endif
+#endif
+#endif
+ if (recent) {
+ /* Check that requested time is up-to-date. */
+ time_t now = time(NULL);
+ if (filet < now - 10 || filet > now + 1) {
+ failure_start(file, line,
+ "File %s has %ctime %ld, %ld seconds ago\n",
+ pathname, type, filet, now - filet);
+ failure_finish(NULL);
+ return (0);
+ }
+ } else if (filet != t || filet_nsec != nsec) {
+ failure_start(file, line,
+ "File %s has %ctime %ld.%09ld, expected %ld.%09ld",
+ pathname, type, filet, filet_nsec, t, nsec);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify atime of 'pathname'. */
+int
+assertion_file_atime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
+}
+
+/* Verify atime of 'pathname' is up-to-date. */
+int
+assertion_file_atime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
+}
+
+/* Verify birthtime of 'pathname'. */
+int
+assertion_file_birthtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
+}
+
+/* Verify birthtime of 'pathname' is up-to-date. */
+int
+assertion_file_birthtime_recent(const char *file, int line,
+ const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
+}
+
+/* Verify mtime of 'pathname'. */
+int
+assertion_file_mtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
+}
+
+/* Verify mtime of 'pathname' is up-to-date. */
+int
+assertion_file_mtime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
+}
+
+/* Verify number of links to 'pathname'. */
+int
+assertion_file_nlinks(const char *file, int line,
+ const char *pathname, int nlinks)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(pathname, &bhfi);
+ if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, bhfi.nNumberOfLinks, nlinks);
+ failure_finish(NULL);
+ return (0);
+#else
+ struct stat st;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && st.st_nlink == nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, st.st_nlink, nlinks);
+ failure_finish(NULL);
+ return (0);
+#endif
+}
+
+/* Verify size of 'pathname'. */
+int
+assertion_file_size(const char *file, int line, const char *pathname, long size)
+{
+ int64_t filesize;
+ int r;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ {
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ r = !my_GetFileInformationByName(pathname, &bhfi);
+ filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
+ }
+#else
+ {
+ struct stat st;
+ r = lstat(pathname, &st);
+ filesize = st.st_size;
+ }
+#endif
+ if (r == 0 && filesize == size)
+ return (1);
+ failure_start(file, line, "File %s has size %ld, expected %ld",
+ pathname, (long)filesize, (long)size);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
+int
+assertion_is_dir(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Dir should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ failure_start(file, line, "%s is not a dir", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "Dir %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Verify that 'pathname' is a regular file. If 'mode' is >= 0,
+ * verify that too. */
+int
+assertion_is_reg(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0 || !S_ISREG(st.st_mode)) {
+ failure_start(file, line, "File should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "File %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Check whether 'pathname' is a symbolic link. If 'contents' is
+ * non-NULL, verify that the symlink has those contents. */
+static int
+is_symlink(const char *file, int line,
+ const char *pathname, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)pathname; /* UNUSED */
+ (void)contents; /* UNUSED */
+ assertion_count(file, line);
+ /* Windows sort-of has real symlinks, but they're only usable
+ * by privileged users and are crippled even then, so there's
+ * really not much point in bothering with this. */
+ return (0);
+#else
+ char buff[300];
+ struct stat st;
+ ssize_t linklen;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line,
+ "Symlink should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISLNK(st.st_mode))
+ return (0);
+ if (contents == NULL)
+ return (1);
+ linklen = readlink(pathname, buff, sizeof(buff));
+ if (linklen < 0) {
+ failure_start(file, line, "Can't read symlink %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ buff[linklen] = '\0';
+ if (strcmp(buff, contents) != 0)
+ return (0);
+ return (1);
+#endif
+}
+
+/* Assert that path is a symlink that (optionally) contains contents. */
+int
+assertion_is_symlink(const char *file, int line,
+ const char *path, const char *contents)
+{
+ if (is_symlink(file, line, path, contents))
+ return (1);
+ if (contents)
+ failure_start(file, line, "File %s is not a symlink to %s",
+ path, contents);
+ else
+ failure_start(file, line, "File %s is not a symlink", path);
+ failure_finish(NULL);
+ return (0);
+}
+
+
+/* Create a directory and report any errors. */
+int
+assertion_make_dir(const char *file, int line, const char *dirname, int mode)
+{
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+ if (0 == _mkdir(dirname))
+ return (1);
+#else
+ if (0 == mkdir(dirname, mode))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create directory %s", dirname);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a file with the specified contents and report any failures. */
+int
+assertion_make_file(const char *file, int line,
+ const char *path, int mode, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* TODO: Rework this to set file mode as well. */
+ FILE *f;
+ (void)mode; /* UNUSED */
+ assertion_count(file, line);
+ f = fopen(path, "wb");
+ if (f == NULL) {
+ failure_start(file, line, "Could not create file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if (strlen(contents)
+ != fwrite(contents, 1, strlen(contents), f)) {
+ fclose(f);
+ failure_start(file, line,
+ "Could not write file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ fclose(f);
+ return (1);
+#else
+ int fd;
+ assertion_count(file, line);
+ fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
+ if (fd < 0) {
+ failure_start(file, line, "Could not create %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if ((ssize_t)strlen(contents)
+ != write(fd, contents, strlen(contents))) {
+ close(fd);
+ failure_start(file, line, "Could not write to %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ close(fd);
+ return (1);
+#endif
+}
+
+/* Create a hardlink and report any failures. */
+int
+assertion_make_hardlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ succeeded = my_CreateHardLinkA(newpath, linkto);
+#elif HAVE_LINK
+ succeeded = !link(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded)
+ return (1);
+ failure_start(file, line, "Could not create hardlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a symlink and report any failures. */
+int
+assertion_make_symlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ int targetIsDir = 0; /* TODO: Fix this */
+ assertion_count(file, line);
+ if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
+ return (1);
+#elif HAVE_SYMLINK
+ assertion_count(file, line);
+ if (0 == symlink(linkto, newpath))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create symlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Set umask, report failures. */
+int
+assertion_umask(const char *file, int line, int mask)
+{
+ assertion_count(file, line);
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ umask(mask);
+ return (1);
+}
+
+/*
+ *
+ * UTILITIES for use by tests.
+ *
+ */
+
+/*
+ * Check whether platform supports symlinks. This is intended
+ * for tests to use in deciding whether to bother testing symlink
+ * support; if the platform doesn't support symlinks, there's no point
+ * in checking whether the program being tested can create them.
+ *
+ * Note that the first time this test is called, we actually go out to
+ * disk to create and verify a symlink. This is necessary because
+ * symlink support is actually a property of a particular filesystem
+ * and can thus vary between directories on a single system. After
+ * the first call, this returns the cached result from memory, so it's
+ * safe to call it as often as you wish.
+ */
+int
+canSymlink(void)
+{
+ /* Remember the test result */
+ static int value = 0, tested = 0;
+ if (tested)
+ return (value);
+
+ ++tested;
+ assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, "a");
+ /* Note: Cygwin has its own symlink() emulation that does not
+ * use the Win32 CreateSymbolicLink() function. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
+#elif HAVE_SYMLINK
+ value = (0 == symlink("canSymlink.0", "canSymlink.1"))
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
+#endif
+ return (value);
+}
+
+/*
+ * Can this platform run the gzip program?
+ */
+/* Platform-dependent options for hiding the output of a subcommand. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
+#else
+static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
+#endif
+int
+canGzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the gunzip program?
+ */
+int
+canGunzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gunzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Sleep as needed; useful for verifying disk timestamp changes by
+ * ensuring that the wall-clock time has actually changed before we
+ * go back to re-read something from disk.
+ */
+void
+sleepUntilAfter(time_t t)
+{
+ while (t >= time(NULL))
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ Sleep(500);
+#else
+ sleep(1);
+#endif
+}
+
/*
* Call standard system() call, but build up the command line using
* sprintf() conventions.
@@ -634,6 +1480,8 @@ systemf(const char *fmt, ...)
va_start(ap, fmt);
vsprintf(buff, fmt, ap);
+ if (verbosity > VERBOSITY_FULL)
+ logprintf("Cmd: %s\n", buff);
r = system(buff);
va_end(ap);
return (r);
@@ -652,112 +1500,263 @@ slurpfile(size_t * sizep, const char *fmt, ...)
va_list ap;
char *p;
ssize_t bytes_read;
- int fd;
+ FILE *f;
int r;
va_start(ap, fmt);
vsprintf(filename, fmt, ap);
va_end(ap);
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
+ f = fopen(filename, "rb");
+ if (f == NULL) {
/* Note: No error; non-existent file is okay here. */
return (NULL);
}
- r = fstat(fd, &st);
+ r = fstat(fileno(f), &st);
if (r != 0) {
- fprintf(stderr, "Can't stat file %s\n", filename);
- close(fd);
+ logprintf("Can't stat file %s\n", filename);
+ fclose(f);
return (NULL);
}
- p = malloc(st.st_size + 1);
+ p = malloc((size_t)st.st_size + 1);
if (p == NULL) {
- fprintf(stderr, "Can't allocate %ld bytes of memory to read file %s\n", (long int)st.st_size, filename);
- close(fd);
+ logprintf("Can't allocate %ld bytes of memory to read file %s\n",
+ (long int)st.st_size, filename);
+ fclose(f);
return (NULL);
}
- bytes_read = read(fd, p, st.st_size);
+ bytes_read = fread(p, 1, (size_t)st.st_size, f);
if (bytes_read < st.st_size) {
- fprintf(stderr, "Can't read file %s\n", filename);
- close(fd);
+ logprintf("Can't read file %s\n", filename);
+ fclose(f);
free(p);
return (NULL);
}
p[st.st_size] = '\0';
if (sizep != NULL)
*sizep = (size_t)st.st_size;
- close(fd);
+ fclose(f);
return (p);
}
+/* Read a uuencoded file from the reference directory, decode, and
+ * write the result into the current directory. */
+#define UUDECODE(c) (((c) - 0x20) & 0x3f)
+void
+extract_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+
+ sprintf(buff, "%s/%s.uu", refdir, name);
+ in = fopen(buff, "r");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Read up to and including the 'begin' line. */
+ for (;;) {
+ if (fgets(buff, sizeof(buff), in) == NULL) {
+ /* TODO: This is a failure. */
+ return;
+ }
+ if (memcmp(buff, "begin ", 6) == 0)
+ break;
+ }
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while (fgets(buff, sizeof(buff), in) != NULL) {
+ char *p = buff;
+ int bytes;
+
+ if (memcmp(buff, "end", 3) == 0)
+ break;
+
+ bytes = UUDECODE(*p++);
+ while (bytes > 0) {
+ int n = 0;
+ /* Write out 1-3 bytes from that. */
+ if (bytes > 0) {
+ n = UUDECODE(*p++) << 18;
+ n |= UUDECODE(*p++) << 12;
+ fputc(n >> 16, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++) << 6;
+ fputc((n >> 8) & 0xFF, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++);
+ fputc(n & 0xFF, out);
+ --bytes;
+ }
+ }
+ }
+ fclose(out);
+ fclose(in);
+}
+
/*
- * "list.h" is automatically generated; it just has a lot of lines like:
- * DEFINE_TEST(function_name)
- * It's used above to declare all of the test functions.
- * We reuse it here to define a list of all tests (functions and names).
+ *
+ * TEST management
+ *
+ */
+
+/*
+ * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
+ * a line like
+ * DEFINE_TEST(test_function)
+ * for each test.
*/
+
+/* Use "list.h" to declare all of the test functions. */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void);
+#include "list.h"
+
+/* Use "list.h" to create a list of all tests (functions and names). */
#undef DEFINE_TEST
-#define DEFINE_TEST(n) { n, #n },
-struct { void (*func)(void); const char *name; } tests[] = {
+#define DEFINE_TEST(n) { n, #n, 0 },
+struct { void (*func)(void); const char *name; int failures; } tests[] = {
#include "list.h"
};
/*
- * Each test is run in a private work dir. Those work dirs
- * do have consistent and predictable names, in case a group
- * of tests need to collaborate. However, there is no provision
- * for requiring that tests run in a certain order.
+ * Summarize repeated failures in the just-completed test.
*/
-static int test_run(int i, const char *tmpdir)
+static void
+test_summarize(const char *filename, int failed)
{
- int failures_before = failures;
+ unsigned int i;
- if (!quiet_flag) {
- printf("%d: %s\n", i, tests[i].name);
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY:
+ printf(failed ? "E" : ".");
fflush(stdout);
+ break;
+ case VERBOSITY_PASSFAIL:
+ printf(failed ? "FAIL\n" : "ok\n");
+ break;
}
- /*
- * Always explicitly chdir() in case the last test moved us to
- * a strange place.
- */
- if (chdir(tmpdir)) {
- fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir %s\n",
- tmpdir);
- exit(1);
+ log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
+
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].count > 1 && !failed_lines[i].skip)
+ logprintf("%s:%d: Summary: Failed %d times\n",
+ filename, i, failed_lines[i].count);
+ }
+ /* Clear the failure history for the next file. */
+ memset(failed_lines, 0, sizeof(failed_lines));
+}
+
+/*
+ * Actually run a single test, with appropriate setup and cleanup.
+ */
+static int
+test_run(int i, const char *tmpdir)
+{
+ char logfilename[64];
+ int failures_before = failures;
+ int oldumask;
+
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
+ break;
+ case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
+ printf("%3d: %-50s", i, tests[i].name);
+ fflush(stdout);
+ break;
+ default: /* Title of test, details will follow */
+ printf("%3d: %s\n", i, tests[i].name);
}
- /* Create a temp directory for this specific test. */
- if (mkdir(tests[i].name, 0755)) {
+
+ /* Chdir to the top-level work directory. */
+ if (!assertChdir(tmpdir)) {
fprintf(stderr,
- "ERROR: Couldn't create temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to top work dir %s\n", tmpdir);
exit(1);
}
- /* Chdir() to that work directory. */
- if (chdir(tests[i].name)) {
+ /* Create a log file for this test. */
+ sprintf(logfilename, "%s.log", tests[i].name);
+ logfile = fopen(logfilename, "w");
+ fprintf(logfile, "%s\n\n", tests[i].name);
+ /* Chdir() to a work dir for this specific test. */
+ if (!assertMakeDir(tests[i].name, 0755)
+ || !assertChdir(tests[i].name)) {
fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to work dir %s/%s\n",
+ tmpdir, tests[i].name);
exit(1);
}
/* Explicitly reset the locale before each test. */
setlocale(LC_ALL, "C");
- /* Run the actual test. */
+ /* Record the umask before we run the test. */
+ umask(oldumask = umask(0));
+ /*
+ * Run the actual test.
+ */
(*tests[i].func)();
- /* Summarize the results of this test. */
- summarize();
- /* If there were no failures, we can remove the work dir. */
- if (failures == failures_before) {
- if (!keep_temp_files && chdir(tmpdir) == 0) {
+ /*
+ * Clean up and report afterwards.
+ */
+ /* Restore umask */
+ umask(oldumask);
+ /* Reset locale. */
+ setlocale(LC_ALL, "C");
+ /* Reset directory. */
+ if (!assertChdir(tmpdir)) {
+ fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
+ tmpdir);
+ exit(1);
+ }
+ /* Report per-test summaries. */
+ tests[i].failures = failures - failures_before;
+ test_summarize(test_filename, tests[i].failures);
+ /* Close the per-test log file. */
+ fclose(logfile);
+ logfile = NULL;
+ /* If there were no failures, we can remove the work dir and logfile. */
+ if (tests[i].failures == 0) {
+ if (!keep_temp_files && assertChdir(tmpdir)) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Make sure not to leave empty directories.
+ * Sometimes a processing of closing files used by tests
+ * is not done, then rmdir will be failed and it will
+ * leave a empty test directory. So we should wait a few
+ * seconds and retry rmdir. */
+ int r, t;
+ for (t = 0; t < 10; t++) {
+ if (t > 0)
+ Sleep(1000);
+ r = systemf("rmdir /S /Q %s", tests[i].name);
+ if (r == 0)
+ break;
+ }
+ systemf("del %s", logfilename);
+#else
systemf("rm -rf %s", tests[i].name);
+ systemf("rm %s", logfilename);
+#endif
}
}
/* Return appropriate status. */
- return (failures == failures_before ? 0 : 1);
+ return (tests[i].failures);
}
-static void usage(const char *program)
+/*
+ *
+ *
+ * MAIN and support routines.
+ *
+ *
+ */
+
+static void
+usage(const char *program)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
int i;
@@ -783,92 +1782,129 @@ static void usage(const char *program)
exit(1);
}
-#define UUDECODE(c) (((c) - 0x20) & 0x3f)
-
-void
-extract_reference_file(const char *name)
+static char *
+get_refdir(const char *d)
{
- char buff[1024];
- FILE *in, *out;
+ char tried[512] = { '\0' };
+ char buff[128];
+ char *pwd, *p;
+
+ /* If a dir was specified, try that */
+ if (d != NULL) {
+ pwd = NULL;
+ snprintf(buff, sizeof(buff), "%s", d);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+ goto failure;
+ }
- sprintf(buff, "%s/%s.uu", refdir, name);
- in = fopen(buff, "r");
- failure("Couldn't open reference file %s", buff);
- assert(in != NULL);
- if (in == NULL)
- return;
- /* Read up to and including the 'begin' line. */
- for (;;) {
- if (fgets(buff, sizeof(buff), in) == NULL) {
- /* TODO: This is a failure. */
- return;
- }
- if (memcmp(buff, "begin ", 6) == 0)
- break;
+ /* Get the current dir. */
+ pwd = getcwd(NULL, 0);
+ while (pwd[strlen(pwd) - 1] == '\n')
+ pwd[strlen(pwd) - 1] = '\0';
+
+ /* Look for a known file. */
+ snprintf(buff, sizeof(buff), "%s", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+#if defined(LIBRARY)
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY);
+#else
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM);
+#endif
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ if (memcmp(pwd, "/usr/obj", 8) == 0) {
+ snprintf(buff, sizeof(buff), "%s", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
}
- /* Now, decode the rest and write it. */
- /* Not a lot of error checking here; the input better be right. */
- out = fopen(name, "w");
- while (fgets(buff, sizeof(buff), in) != NULL) {
- char *p = buff;
- int bytes;
- if (memcmp(buff, "end", 3) == 0)
- break;
+failure:
+ printf("Unable to locate known reference file %s\n", KNOWNREF);
+ printf(" Checked following directories:\n%s\n", tried);
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+ DebugBreak();
+#endif
+ exit(1);
- bytes = UUDECODE(*p++);
- while (bytes > 0) {
- int n = 0;
- /* Write out 1-3 bytes from that. */
- if (bytes > 0) {
- n = UUDECODE(*p++) << 18;
- n |= UUDECODE(*p++) << 12;
- fputc(n >> 16, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++) << 6;
- fputc((n >> 8) & 0xFF, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++);
- fputc(n & 0xFF, out);
- --bytes;
- }
- }
- }
- fclose(out);
- fclose(in);
+success:
+ free(p);
+ free(pwd);
+ return strdup(buff);
}
-
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
- int i, tests_run = 0, tests_failed = 0, opt;
+ int i, tests_run = 0, tests_failed = 0, option;
time_t now;
char *refdir_alloc = NULL;
- char *progname, *p;
+ const char *progname;
+ const char *tmp, *option_arg, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
+ (void)argc; /* UNUSED */
+
+#if defined(HAVE__CrtSetReportMode)
+ /* To stop to run the default invalid parameter handler. */
+ _set_invalid_parameter_handler(invalid_parameter_handler);
+ /* Disable annoying assertion message box. */
+ _CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
+
/*
* Name of this program, used to build root of our temp directory
* tree.
*/
progname = p = argv[0];
while (*p != '\0') {
- if (*p == '/')
+ /* Support \ or / dir separators for Windows compat. */
+ if (*p == '/' || *p == '\\')
progname = p + 1;
++p;
}
#ifdef PROGRAM
/* Get the target program from environment, if available. */
- testprog = getenv(ENVBASE);
+ testprogfile = getenv(ENVBASE);
#endif
+ if (getenv("TMPDIR") != NULL)
+ tmp = getenv("TMPDIR");
+ else if (getenv("TMP") != NULL)
+ tmp = getenv("TMP");
+ else if (getenv("TEMP") != NULL)
+ tmp = getenv("TEMP");
+ else if (getenv("TEMPDIR") != NULL)
+ tmp = getenv("TEMPDIR");
+ else
+ tmp = "/tmp";
+
/* Allow -d to be controlled through the environment. */
if (getenv(ENVBASE "_DEBUG") != NULL)
dump_on_failure = 1;
@@ -877,46 +1913,86 @@ int main(int argc, char **argv)
refdir = getenv(ENVBASE "_TEST_FILES");
/*
- * Parse options.
+ * Parse options, without using getopt(), which isn't available
+ * on all platforms.
*/
- while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) {
- switch (opt) {
- case 'd':
- dump_on_failure = 1;
+ ++argv; /* Skip program name */
+ while (*argv != NULL) {
+ if (**argv != '-')
break;
- case 'k':
- keep_temp_files = 1;
- break;
- case 'p':
+ p = *argv++;
+ ++p; /* Skip '-' */
+ while (*p != '\0') {
+ option = *p++;
+ option_arg = NULL;
+ /* If 'opt' takes an argument, parse that. */
+ if (option == 'p' || option == 'r') {
+ if (*p != '\0')
+ option_arg = p;
+ else if (*argv == NULL) {
+ fprintf(stderr,
+ "Option -%c requires argument.\n",
+ option);
+ usage(progname);
+ } else
+ option_arg = *argv++;
+ p = ""; /* End of this option word. */
+ }
+
+ /* Now, handle the option. */
+ switch (option) {
+ case 'd':
+ dump_on_failure = 1;
+ break;
+ case 'k':
+ keep_temp_files = 1;
+ break;
+ case 'p':
#ifdef PROGRAM
- testprog = optarg;
+ testprogfile = option_arg;
#else
- usage(progname);
+ usage(progname);
#endif
- break;
- case 'q':
- quiet_flag++;
- break;
- case 'r':
- refdir = optarg;
- break;
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- usage(progname);
+ break;
+ case 'q':
+ verbosity--;
+ break;
+ case 'r':
+ refdir = option_arg;
+ break;
+ case 'v':
+ verbosity++;
+ break;
+ default:
+ usage(progname);
+ }
}
}
- argc -= optind;
- argv += optind;
/*
* Sanity-check that our options make sense.
*/
#ifdef PROGRAM
- if (testprog == NULL)
+ if (testprogfile == NULL)
usage(progname);
+ {
+ char *testprg;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Command.com sometimes rejects '/' separators. */
+ testprg = strdup(testprogfile);
+ for (i = 0; testprg[i] != '\0'; i++) {
+ if (testprg[i] == '/')
+ testprg[i] = '\\';
+ }
+ testprogfile = testprg;
+#endif
+ /* Quote the name that gets put into shell command lines. */
+ testprg = malloc(strlen(testprogfile) + 3);
+ strcpy(testprg, "\"");
+ strcat(testprg, testprogfile);
+ strcat(testprg, "\"");
+ testprog = testprg;
+ }
#endif
/*
@@ -925,40 +2001,37 @@ int main(int argc, char **argv)
* to make it easier to track the results of multiple tests.
*/
now = time(NULL);
- for (i = 0; i < 1000; i++) {
+ for (i = 0; ; i++) {
strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
"%Y-%m-%dT%H.%M.%S",
localtime(&now));
- sprintf(tmpdir, "/tmp/%s.%s-%03d", progname, tmpdir_timestamp, i);
- if (mkdir(tmpdir,0755) == 0)
+ sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
+ tmpdir_timestamp, i);
+ if (assertMakeDir(tmpdir,0755))
break;
- if (errno == EEXIST)
- continue;
- fprintf(stderr, "ERROR: Unable to create temp directory %s\n",
- tmpdir);
- exit(1);
+ if (i >= 999) {
+ fprintf(stderr,
+ "ERROR: Unable to create temp directory %s\n",
+ tmpdir);
+ exit(1);
+ }
}
/*
* If the user didn't specify a directory for locating
- * reference files, use the current directory for that.
+ * reference files, try to find the reference files in
+ * the "usual places."
*/
- if (refdir == NULL) {
- systemf("/bin/pwd > %s/refdir", tmpdir);
- refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
- p = refdir + strlen(refdir);
- while (p[-1] == '\n') {
- --p;
- *p = '\0';
- }
- systemf("rm %s/refdir", tmpdir);
- }
+ refdir = refdir_alloc = get_refdir(refdir);
/*
* Banner with basic information.
*/
- if (!quiet_flag) {
- printf("Running tests in: %s\n", tmpdir);
+ printf("\n");
+ printf("If tests fail or crash, details will be in:\n");
+ printf(" %s\n", tmpdir);
+ printf("\n");
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
printf("Reference files will be read from: %s\n", refdir);
#ifdef PROGRAM
printf("Running tests on: %s\n", testprog);
@@ -966,12 +2039,15 @@ int main(int argc, char **argv)
printf("Exercising: ");
fflush(stdout);
printf("%s\n", EXTRA_VERSION);
+ } else {
+ printf("Running ");
+ fflush(stdout);
}
/*
* Run some or all of the individual tests.
*/
- if (argc == 0) {
+ if (*argv == NULL) {
/* Default: Run all tests. */
for (i = 0; i < limit; i++) {
if (test_run(i, tmpdir))
@@ -980,15 +2056,30 @@ int main(int argc, char **argv)
}
} else {
while (*(argv) != NULL) {
- i = atoi(*argv);
- if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
- printf("*** INVALID Test %s\n", *argv);
- usage(progname);
+ if (**argv >= '0' && **argv <= '9') {
+ i = atoi(*argv);
+ if (i < 0 || i >= limit) {
+ printf("*** INVALID Test %s\n", *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
} else {
- if (test_run(i, tmpdir))
- tests_failed++;
- tests_run++;
+ for (i = 0; i < limit; ++i) {
+ if (strcmp(*argv, tests[i].name) == 0)
+ break;
+ }
+ if (i >= limit) {
+ printf("*** INVALID Test ``%s''\n",
+ *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
}
+ if (test_run(i, tmpdir))
+ tests_failed++;
+ tests_run++;
argv++;
}
}
@@ -996,20 +2087,38 @@ int main(int argc, char **argv)
/*
* Report summary statistics.
*/
- if (!quiet_flag) {
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
+ printf("\n");
+ printf("Totals:\n");
+ printf(" Tests run: %8d\n", tests_run);
+ printf(" Tests failed: %8d\n", tests_failed);
+ printf(" Assertions checked:%8d\n", assertions);
+ printf(" Assertions failed: %8d\n", failures);
+ printf(" Skips reported: %8d\n", skips);
+ }
+ if (failures) {
+ printf("\n");
+ printf("Failing tests:\n");
+ for (i = 0; i < limit; ++i) {
+ if (tests[i].failures)
+ printf(" %d: %s (%d failures)\n", i,
+ tests[i].name, tests[i].failures);
+ }
printf("\n");
- printf("%d of %d tests reported failures\n",
- tests_failed, tests_run);
- printf(" Total of %d assertions checked.\n", assertions);
- printf(" Total of %d assertions failed.\n", failures);
- printf(" Total of %d assertions skipped.\n", skips);
+ printf("Details for failing tests: %s\n", tmpdir);
+ printf("\n");
+ } else {
+ if (verbosity == VERBOSITY_SUMMARY_ONLY)
+ printf("\n");
+ printf("%d tests passed, no failures\n", tests_run);
}
free(refdir_alloc);
/* If the final tmpdir is empty, we can remove it. */
/* This should be the usual case when all tests succeed. */
+ assertChdir("..");
rmdir(tmpdir);
- return (tests_failed);
+ return (tests_failed ? 1 : 0);
}
diff --git a/archivers/libarchive/files/cpio/test/test.h b/archivers/libarchive/files/cpio/test/test.h
index 431d5d7c4d5..c7515501ba7 100644
--- a/archivers/libarchive/files/cpio/test/test.h
+++ b/archivers/libarchive/files/cpio/test/test.h
@@ -33,39 +33,95 @@
*/
#if defined(HAVE_CONFIG_H)
/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../../config.h"
+#include "config.h"
#elif defined(__FreeBSD__)
/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "../config_freebsd.h"
-#elif defined(_WIN32)
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
/* Win32 can't run the 'configure' script. */
-#include "../config_windows.h"
+#include "config_windows.h"
#else
/* Warn if the library hasn't been (automatically or manually) configured. */
#error Oops: No config.h and no pre-built configuration in test.h.
#endif
+#include <sys/types.h> /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+#if HAVE_DIRENT_H
#include <dirent.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#define dirent direct
+#endif
#include <errno.h>
#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
-#ifndef _WIN32
+#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <wchar.h>
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
#endif
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
+/*
+ * System-specific tweaks. We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
+ */
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "../cpio_windows.h"
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#endif
+#define LOCALE_DE "deu"
#else
-#define __FBSDID(a) /* null */
+#define LOCALE_DE "de_DE.UTF-8"
+#endif
+
+/* Visual Studio */
+#ifdef _MSC_VER
+#define snprintf sprintf_s
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+/* Cygwin-1.7.x is lazy about populating nlinks, so don't
+ * expect it to be accurate. */
+# define NLINKS_INACCURATE_FOR_DIRS
+#endif
+
+/* Haiku OS */
+#if defined(__HAIKU__)
+/* Haiku has typedefs in stdint.h (needed for int64_t) */
+#include <stdint.h>
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
#endif
/*
@@ -75,38 +131,81 @@
#define DEFINE_TEST(name) void name(void); void name(void)
/* An implementation of the standard assert() macro */
-#define assert(e) test_assert(__FILE__, __LINE__, (e), #e, NULL)
-
+#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
+/* chdir() and error if it fails */
+#define assertChdir(path) \
+ assertion_chdir(__FILE__, __LINE__, path)
/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-
+#define assertEqualInt(v1,v2) \
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* Assert two strings are the same. Reports value of each one if not. */
#define assertEqualString(v1,v2) \
- test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but v1 and v2 are wchar_t * */
#define assertEqualWString(v1,v2) \
- test_assert_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but raw blocks of bytes. */
#define assertEqualMem(v1, v2, l) \
- test_assert_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
/* Assert two files are the same; allow printf-style expansion of second name.
* See below for comments about variable arguments here...
*/
#define assertEqualFile \
- test_setup(__FILE__, __LINE__);test_assert_equal_file
+ assertion_setup(__FILE__, __LINE__);assertion_equal_file
/* Assert that a file is empty; supports printf-style arguments. */
#define assertEmptyFile \
- test_setup(__FILE__, __LINE__);test_assert_empty_file
+ assertion_setup(__FILE__, __LINE__);assertion_empty_file
+/* Assert that a file is not empty; supports printf-style arguments. */
+#define assertNonEmptyFile \
+ assertion_setup(__FILE__, __LINE__);assertion_non_empty_file
+#define assertFileAtime(pathname, sec, nsec) \
+ assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileAtimeRecent(pathname) \
+ assertion_file_atime_recent(__FILE__, __LINE__, pathname)
+#define assertFileBirthtime(pathname, sec, nsec) \
+ assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileBirthtimeRecent(pathname) \
+ assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileExists \
- test_setup(__FILE__, __LINE__);test_assert_file_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_exists
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileNotExists \
- test_setup(__FILE__, __LINE__);test_assert_file_not_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_not_exists
/* Assert that file contents match a string; supports printf-style arguments. */
#define assertFileContents \
- test_setup(__FILE__, __LINE__);test_assert_file_contents
+ assertion_setup(__FILE__, __LINE__);assertion_file_contents
+#define assertFileMtime(pathname, sec, nsec) \
+ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileMtimeRecent(pathname) \
+ assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
+#define assertFileNLinks(pathname, nlinks) \
+ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size) \
+ assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertTextFileContents \
+ assertion_setup(__FILE__, __LINE__);assertion_text_file_contents
+#define assertIsDir(pathname, mode) \
+ assertion_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsHardlink(path1, path2) \
+ assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsNotHardlink(path1, path2) \
+ assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsReg(pathname, mode) \
+ assertion_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents) \
+ assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
+/* Create a directory, report error if it fails. */
+#define assertMakeDir(dirname, mode) \
+ assertion_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeFile(path, mode, contents) \
+ assertion_make_file(__FILE__, __LINE__, path, mode, contents)
+#define assertMakeHardlink(newfile, oldfile) \
+ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto) \
+ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertUmask(mask) \
+ assertion_umask(__FILE__, __LINE__, mask)
/*
* This would be simple with C99 variadic macros, but I don't want to
@@ -115,26 +214,60 @@
* but effective.
*/
#define skipping \
- test_setup(__FILE__, __LINE__);test_skipping
+ assertion_setup(__FILE__, __LINE__);test_skipping
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
-void test_setup(const char *, int);
+int assertion_assert(const char *, int, int, const char *, void *);
+int assertion_chdir(const char *, int, const char *);
+int assertion_empty_file(const char *, ...);
+int assertion_equal_file(const char *, const char *, ...);
+int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
+int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
+int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int assertion_file_atime(const char *, int, const char *, long, long);
+int assertion_file_atime_recent(const char *, int, const char *);
+int assertion_file_birthtime(const char *, int, const char *, long, long);
+int assertion_file_birthtime_recent(const char *, int, const char *);
+int assertion_file_contents(const void *, int, const char *, ...);
+int assertion_file_exists(const char *, ...);
+int assertion_file_mtime(const char *, int, const char *, long, long);
+int assertion_file_mtime_recent(const char *, int, const char *);
+int assertion_file_nlinks(const char *, int, const char *, int);
+int assertion_file_not_exists(const char *, ...);
+int assertion_file_size(const char *, int, const char *, long);
+int assertion_is_dir(const char *, int, const char *, int);
+int assertion_is_hardlink(const char *, int, const char *, const char *);
+int assertion_is_not_hardlink(const char *, int, const char *, const char *);
+int assertion_is_reg(const char *, int, const char *, int);
+int assertion_is_symlink(const char *, int, const char *, const char *);
+int assertion_make_dir(const char *, int, const char *, int);
+int assertion_make_file(const char *, int, const char *, int, const char *);
+int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
+int assertion_make_symlink(const char *, int, const char *newpath, const char *);
+int assertion_non_empty_file(const char *, ...);
+int assertion_text_file_contents(const char *buff, const char *f);
+int assertion_umask(const char *, int, int);
+void assertion_setup(const char *, int);
+
void test_skipping(const char *fmt, ...);
-int test_assert(const char *, int, int, const char *, void *);
-int test_assert_empty_file(const char *, ...);
-int test_assert_equal_file(const char *, const char *, ...);
-int test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
-int test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
-int test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
-int test_assert_file_contents(const void *, int, const char *, ...);
-int test_assert_file_exists(const char *, ...);
-int test_assert_file_not_exists(const char *, ...);
/* Like sprintf, then system() */
int systemf(const char * fmt, ...);
+/* Delay until time() returns a value after this. */
+void sleepUntilAfter(time_t);
+
+/* Return true if this platform can create symlinks. */
+int canSymlink(void);
+
+/* Return true if this platform can run the "gzip" program. */
+int canGzip(void);
+
+/* Return true if this platform can run the "gunzip" program. */
+int canGunzip(void);
+
/* Suck file into string allocated via malloc(). Call free() when done. */
/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
char *slurpfile(size_t *, const char *fmt, ...);
@@ -147,4 +280,7 @@ void extract_reference_file(const char *);
*/
/* Pathname of exe to be tested. */
-char *testprog;
+const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+const char *testprog;
diff --git a/archivers/libarchive/files/cpio/test/test_0.c b/archivers/libarchive/files/cpio/test/test_0.c
index 7a72af1c8ed..75a1437fd70 100644
--- a/archivers/libarchive/files/cpio/test/test_0.c
+++ b/archivers/libarchive/files/cpio/test/test_0.c
@@ -29,16 +29,21 @@ __FBSDID("$FreeBSD$");
* This first test does basic sanity checks on the environment. For
* most of these, we just exit on failure.
*/
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define DEV_NULL "/dev/null"
+#else
+#define DEV_NULL "NUL"
+#endif
DEFINE_TEST(test_0)
{
struct stat st;
- failure("File %s does not exist?!", testprog);
- if (!assertEqualInt(0, stat(testprog, &st)))
+ failure("File %s does not exist?!", testprogfile);
+ if (!assertEqualInt(0, stat(testprogfile, &st)))
exit(1);
- failure("%s is not executable?!", testprog);
+ failure("%s is not executable?!", testprogfile);
if (!assert((st.st_mode & 0111) != 0))
exit(1);
@@ -46,9 +51,9 @@ DEFINE_TEST(test_0)
* Try to succesfully run the program; this requires that
* we know some option that will succeed.
*/
- if (0 == systemf("%s --version >/dev/null", testprog)) {
+ if (0 == systemf("%s --version >" DEV_NULL, testprog)) {
/* This worked. */
- } else if (0 == systemf("%s -W version >/dev/null", testprog)) {
+ } else if (0 == systemf("%s -W version >" DEV_NULL, testprog)) {
/* This worked. */
} else {
failure("Unable to successfully run any of the following:\n"
diff --git a/archivers/libarchive/files/cpio/test/test_basic.c b/archivers/libarchive/files/cpio/test/test_basic.c
index 7f1fe6de9f7..852b069a16e 100644
--- a/archivers/libarchive/files/cpio/test/test_basic.c
+++ b/archivers/libarchive/files/cpio/test/test_basic.c
@@ -23,71 +23,35 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_basic.c,v 1.4 2008/08/25 06:39:29 kientzle Exp $");
static void
-verify_files(const char *target)
+verify_files(const char *msg)
{
- struct stat st, st2;
- char buff[128];
- int r;
-
/*
* Verify unpacked files.
*/
/* Regular file with 2 links. */
- r = lstat("file", &st);
- failure("Failed to stat file %s/file, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st.st_mode));
- assertEqualInt(0644, st.st_mode & 0777);
- assertEqualInt(10, st.st_size);
- failure("file %s/file should have 2 links", target);
- assertEqualInt(2, st.st_nlink);
- }
+ assertIsReg("file", 0644);
+ failure(msg);
+ assertFileSize("file", 10);
+ assertFileNLinks("file", 2);
/* Another name for the same file. */
- r = lstat("linkfile", &st2);
- failure("Failed to stat file %s/linkfile, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st2.st_mode));
- assertEqualInt(0644, st2.st_mode & 0777);
- assertEqualInt(10, st2.st_size);
- failure("file %s/linkfile should have 2 links", target);
- assertEqualInt(2, st2.st_nlink);
- /* Verify that the two are really hardlinked. */
- assertEqualInt(st.st_dev, st2.st_dev);
- failure("%s/linkfile and %s/file should be hardlinked",
- target, target);
- assertEqualInt(st.st_ino, st2.st_ino);
- }
+ assertIsHardlink("linkfile", "file");
/* Symlink */
- r = lstat("symlink", &st);
- failure("Failed to stat file %s/symlink, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- failure("symlink should be a symlink; actual mode is %o",
- st.st_mode);
- assert(S_ISLNK(st.st_mode));
- if (S_ISLNK(st.st_mode)) {
- r = readlink("symlink", buff, sizeof(buff));
- assertEqualInt(r, 4);
- buff[r] = '\0';
- assertEqualString(buff, "file");
- }
- }
+ if (canSymlink())
+ assertIsSymlink("symlink", "file");
+
+ /* Another file with 1 link and different permissions. */
+ assertIsReg("file2", 0777);
+ assertFileSize("file2", 10);
+ assertFileNLinks("file2", 1);
/* dir */
- r = lstat("dir", &st);
- if (r == 0) {
- assertEqualInt(r, 0);
- assert(S_ISDIR(st.st_mode));
- assertEqualInt(0775, st.st_mode & 0777);
- }
+ assertIsDir("dir", 0775);
}
static void
@@ -98,7 +62,7 @@ basic_cpio(const char *target,
{
int r;
- if (!assertEqualInt(0, mkdir(target, 0775)))
+ if (!assertMakeDir(target, 0775))
return;
/* Use the cpio program to create an archive. */
@@ -107,11 +71,11 @@ basic_cpio(const char *target,
failure("Error invoking %s -o %s", testprog, pack_options);
assertEqualInt(r, 0);
- chdir(target);
+ assertChdir(target);
/* Verify stderr. */
failure("Expected: %s, options=%s", se, pack_options);
- assertFileContents(se, strlen(se), "pack.err");
+ assertTextFileContents(se, "pack.err");
/*
* Use cpio to unpack the archive into another directory.
@@ -123,11 +87,11 @@ basic_cpio(const char *target,
/* Verify stderr. */
failure("Error invoking %s -i %s in dir %s", testprog, unpack_options, target);
- assertFileContents(se, strlen(se), "unpack.err");
+ assertTextFileContents(se, "unpack.err");
- verify_files(target);
+ verify_files(pack_options);
- chdir("..");
+ assertChdir("..");
}
static void
@@ -135,70 +99,75 @@ passthrough(const char *target)
{
int r;
- if (!assertEqualInt(0, mkdir(target, 0775)))
+ if (!assertMakeDir(target, 0775))
return;
/*
* Use cpio passthrough mode to copy files to another directory.
*/
- r = systemf("%s -p -W quiet %s <filelist >%s/stdout 2>%s/stderr",
+ r = systemf("%s -p %s <filelist >%s/stdout 2>%s/stderr",
testprog, target, target, target);
failure("Error invoking %s -p", testprog);
assertEqualInt(r, 0);
- chdir(target);
+ assertChdir(target);
/* Verify stderr. */
failure("Error invoking %s -p in dir %s",
testprog, target);
- assertEmptyFile("stderr");
+ assertTextFileContents("1 block\n", "stderr");
- verify_files(target);
- chdir("..");
+ verify_files("passthrough");
+ assertChdir("..");
}
DEFINE_TEST(test_basic)
{
- int fd;
- int filelist;
- int oldumask;
+ FILE *filelist;
+ const char *msg;
- oldumask = umask(0);
+ assertUmask(0);
/*
* Create an assortment of files on disk.
*/
- filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+ filelist = fopen("filelist", "w");
/* File with 10 bytes content. */
- fd = open("file", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(10, write(fd, "123456789", 10));
- close(fd);
- write(filelist, "file\n", 5);
+ assertMakeFile("file", 0644, "1234567890");
+ fprintf(filelist, "file\n");
/* hardlink to above file. */
- assertEqualInt(0, link("file", "linkfile"));
- write(filelist, "linkfile\n", 9);
+ assertMakeHardlink("linkfile", "file");
+ fprintf(filelist, "linkfile\n");
/* Symlink to above file. */
- assertEqualInt(0, symlink("file", "symlink"));
- write(filelist, "symlink\n", 8);
+ if (canSymlink()) {
+ assertMakeSymlink("symlink", "file");
+ fprintf(filelist, "symlink\n");
+ }
+
+ /* Another file with different permissions. */
+ assertMakeFile("file2", 0777, "1234567890");
+ fprintf(filelist, "file2\n");
/* Directory. */
- assertEqualInt(0, mkdir("dir", 0775));
- write(filelist, "dir\n", 4);
+ assertMakeDir("dir", 0775);
+ fprintf(filelist, "dir\n");
/* All done. */
- close(filelist);
+ fclose(filelist);
+
+ assertUmask(022);
/* Archive/dearchive with a variety of options. */
- basic_cpio("copy", "", "", "1 block\n");
- basic_cpio("copy_odc", "--format=odc", "", "1 block\n");
+ msg = canSymlink() ? "2 blocks\n" : "1 block\n";
+ basic_cpio("copy", "", "", msg);
+ basic_cpio("copy_odc", "--format=odc", "", msg);
basic_cpio("copy_newc", "-H newc", "", "2 blocks\n");
- basic_cpio("copy_cpio", "-H odc", "", "1 block\n");
- basic_cpio("copy_ustar", "-H ustar", "", "7 blocks\n");
+ basic_cpio("copy_cpio", "-H odc", "", msg);
+ msg = canSymlink() ? "9 blocks\n" : "8 blocks\n";
+ basic_cpio("copy_ustar", "-H ustar", "", msg);
+
/* Copy in one step using -p */
passthrough("passthrough");
-
- umask(oldumask);
}
diff --git a/archivers/libarchive/files/cpio/test/test_cmdline.c b/archivers/libarchive/files/cpio/test/test_cmdline.c
new file mode 100644
index 00000000000..2dd7d651dc5
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_cmdline.c
@@ -0,0 +1,107 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test the command-line parsing.
+ */
+
+DEFINE_TEST(test_cmdline)
+{
+ FILE *f;
+
+ /* Create an empty file. */
+ f = fopen("empty", "wb");
+ assert(f != NULL);
+ fclose(f);
+
+ failure("-Q is an invalid option on every cpio program I know of");
+ assert(0 != systemf("%s -i -Q <empty >1.out 2>1.err", testprog));
+ assertEmptyFile("1.out");
+
+ failure("-f requires an argument");
+ assert(0 != systemf("%s -if <empty >2.out 2>2.err", testprog));
+ assertEmptyFile("2.out");
+
+ failure("-f requires an argument");
+ assert(0 != systemf("%s -i -f <empty >3.out 2>3.err", testprog));
+ assertEmptyFile("3.out");
+
+ failure("--format requires an argument");
+ assert(0 != systemf("%s -i --format <empty >4.out 2>4.err", testprog));
+ assertEmptyFile("4.out");
+
+ failure("--badopt is an invalid option");
+ assert(0 != systemf("%s -i --badop <empty >5.out 2>5.err", testprog));
+ assertEmptyFile("5.out");
+
+ failure("--badopt is an invalid option");
+ assert(0 != systemf("%s -i --badopt <empty >6.out 2>6.err", testprog));
+ assertEmptyFile("6.out");
+
+ failure("--n is ambiguous");
+ assert(0 != systemf("%s -i --n <empty >7.out 2>7.err", testprog));
+ assertEmptyFile("7.out");
+
+ failure("--create forbids an argument");
+ assert(0 != systemf("%s --create=arg <empty >8.out 2>8.err", testprog));
+ assertEmptyFile("8.out");
+
+ failure("-i with empty input should succeed");
+ assert(0 == systemf("%s -i <empty >9.out 2>9.err", testprog));
+ assertEmptyFile("9.out");
+
+ failure("-o with empty input should succeed");
+ assert(0 == systemf("%s -o <empty >10.out 2>10.err", testprog));
+
+ failure("-i -p is nonsense");
+ assert(0 != systemf("%s -i -p <empty >11.out 2>11.err", testprog));
+ assertEmptyFile("11.out");
+
+ failure("-p -i is nonsense");
+ assert(0 != systemf("%s -p -i <empty >12.out 2>12.err", testprog));
+ assertEmptyFile("12.out");
+
+ failure("-i -o is nonsense");
+ assert(0 != systemf("%s -i -o <empty >13.out 2>13.err", testprog));
+ assertEmptyFile("13.out");
+
+ failure("-o -i is nonsense");
+ assert(0 != systemf("%s -o -i <empty >14.out 2>14.err", testprog));
+ assertEmptyFile("14.out");
+
+ failure("-o -p is nonsense");
+ assert(0 != systemf("%s -o -p <empty >15.out 2>15.err", testprog));
+ assertEmptyFile("15.out");
+
+ failure("-p -o is nonsense");
+ assert(0 != systemf("%s -p -o <empty >16.out 2>16.err", testprog));
+ assertEmptyFile("16.out");
+
+ failure("-p with empty input should fail");
+ assert(0 != systemf("%s -p <empty >17.out 2>17.err", testprog));
+ assertEmptyFile("17.out");
+}
diff --git a/archivers/libarchive/files/cpio/test/test_format_newc.c b/archivers/libarchive/files/cpio/test/test_format_newc.c
index 0714bd427e2..06749a2f9ca 100644
--- a/archivers/libarchive/files/cpio/test/test_format_newc.c
+++ b/archivers/libarchive/files/cpio/test/test_format_newc.c
@@ -23,7 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_format_newc.c,v 1.2 2008/08/22 02:09:10 kientzle Exp $");
+
+/* Number of bytes needed to pad 'n' to multiple of 'block', assuming
+ * that 'block' is a power of two. This trick can be more easily
+ * remembered as -n & (block - 1), but many compilers quite reasonably
+ * warn about "-n" when n is an unsigned value. (~(n) + 1) is the
+ * same thing, but written in a way that won't offend anyone. */
+#define PAD(n, block) ((~(n) + 1) & ((block) - 1))
static int
is_hex(const char *p, size_t l)
@@ -63,60 +70,67 @@ from_hex(const char *p, size_t l)
DEFINE_TEST(test_format_newc)
{
- int fd, list;
+ FILE *list;
int r;
int devmajor, devminor, ino, gid;
+ int uid = -1;
time_t t, t2, now;
char *p, *e;
- size_t s;
- mode_t oldmask;
+ size_t s, fs, ns;
+
+ assertUmask(0);
- oldmask = umask(0);
+#if !defined(_WIN32)
+ uid = getuid();
+#endif
/*
* Create an assortment of files.
* TODO: Extend this to cover more filetypes.
*/
- list = open("list", O_CREAT | O_WRONLY, 0644);
+ list = fopen("list", "w");
/* "file1" */
- fd = open("file1", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(10, write(fd, "123456789", 10));
- close(fd);
- assertEqualInt(6, write(list, "file1\n", 6));
+ assertMakeFile("file1", 0644, "1234567890");
+ fprintf(list, "file1\n");
/* "hardlink" */
- assertEqualInt(0, link("file1", "hardlink"));
- assertEqualInt(9, write(list, "hardlink\n", 9));
+ assertMakeHardlink("hardlink", "file1");
+ fprintf(list, "hardlink\n");
/* Another hardlink, but this one won't be archived. */
- assertEqualInt(0, link("file1", "hardlink2"));
+ assertMakeHardlink("hardlink2", "file1");
/* "symlink" */
- assertEqualInt(0, symlink("file1", "symlink"));
- assertEqualInt(8, write(list, "symlink\n", 8));
+ if (canSymlink()) {
+ assertMakeSymlink("symlink", "file1");
+ fprintf(list, "symlink\n");
+ }
/* "dir" */
- assertEqualInt(0, mkdir("dir", 0775));
- assertEqualInt(4, write(list, "dir\n", 4));
+ assertMakeDir("dir", 0775);
+ fprintf(list, "dir\n");
/* Record some facts about what we just created: */
now = time(NULL); /* They were all created w/in last two seconds. */
/* Use the cpio program to create an archive. */
- close(list);
+ fclose(list);
r = systemf("%s -o --format=newc <list >newc.out 2>newc.err",
testprog);
if (!assertEqualInt(r, 0))
return;
/* Verify that nothing went to stderr. */
- assertFileContents("2 blocks\n", 9, "newc.err");
+ if (canSymlink()) {
+ assertTextFileContents("2 blocks\n", "newc.err");
+ } else {
+ assertTextFileContents("1 block\n", "newc.err");
+ }
/* Verify that stdout is a well-formed cpio file in "newc" format. */
p = slurpfile(&s, "newc.out");
- assertEqualInt(s, 1024);
+ assertEqualInt(s, canSymlink() ? 1024 : 512);
e = p;
/*
@@ -128,8 +142,15 @@ DEFINE_TEST(test_format_newc)
assert(is_hex(e, 110)); /* Entire header is octal digits. */
assertEqualMem(e + 0, "070701", 6); /* Magic */
ino = from_hex(e + 6, 8); /* ino */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Group members bits and others bits do not work. */
+ assertEqualInt(0x8180, from_hex(e + 14, 8) & 0xffc0); /* Mode */
+#else
assertEqualInt(0x81a4, from_hex(e + 14, 8)); /* Mode */
- assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+#endif
+ if (uid < 0)
+ uid = from_hex(e + 22, 8);
+ assertEqualInt(from_hex(e + 22, 8), uid); /* uid */
gid = from_hex(e + 30, 8); /* gid */
assertEqualMem(e + 38, "00000003", 8); /* nlink */
t = from_hex(e + 46, 8); /* mtime */
@@ -141,60 +162,81 @@ DEFINE_TEST(test_format_newc)
" first appearance should be empty, so this file size\n"
" field should be zero");
assertEqualInt(0, from_hex(e + 54, 8)); /* File size */
+ fs = from_hex(e + 54, 8);
+ fs += PAD(fs, 4);
devmajor = from_hex(e + 62, 8); /* devmajor */
devminor = from_hex(e + 70, 8); /* devminor */
assert(is_hex(e + 78, 8)); /* rdevmajor */
assert(is_hex(e + 86, 8)); /* rdevminor */
assertEqualMem(e + 94, "00000006", 8); /* Name size */
+ ns = from_hex(e + 94, 8);
+ ns += PAD(ns + 2, 4);
assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
assertEqualMem(e + 110, "file1\0", 6); /* Name contents */
/* Since there's another link, no file contents here. */
/* But add in file size so that an error here doesn't cascade. */
- e += 116 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
- /* "symlink" pointing to "file1" */
- assert(is_hex(e, 110));
- assertEqualMem(e + 0, "070701", 6); /* Magic */
- assert(is_hex(e + 6, 8)); /* ino */
- assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */
- assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
- assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
- assertEqualMem(e + 38, "00000001", 8); /* nlink */
- t2 = from_hex(e + 46, 8); /* mtime */
- failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
- assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
- assertEqualMem(e + 54, "00000005", 8); /* File size */
- assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
- assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
- assert(is_hex(e + 78, 8)); /* rdevmajor */
- assert(is_hex(e + 86, 8)); /* rdevminor */
- assertEqualMem(e + 94, "00000008", 8); /* Name size */
- assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
- assertEqualMem(e + 110, "symlink\0\0\0", 10); /* Name contents */
- assertEqualMem(e + 120, "file1\0\0\0", 8); /* symlink target */
- e += 120 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
+ e += 110 + fs + ns;
+
+ if (canSymlink()) {
+ /* "symlink" pointing to "file1" */
+ assert(is_hex(e, 110));
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assert(is_hex(e + 6, 8)); /* ino */
+ assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */
+ assertEqualInt(from_hex(e + 22, 8), uid); /* uid */
+ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
+ assertEqualMem(e + 38, "00000001", 8); /* nlink */
+ t2 = from_hex(e + 46, 8); /* mtime */
+ failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+ assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
+ assertEqualMem(e + 54, "00000005", 8); /* File size */
+ fs = from_hex(e + 54, 8);
+ fs += PAD(fs, 4);
+ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
+ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
+ assert(is_hex(e + 78, 8)); /* rdevmajor */
+ assert(is_hex(e + 86, 8)); /* rdevminor */
+ assertEqualMem(e + 94, "00000008", 8); /* Name size */
+ ns = from_hex(e + 94, 8);
+ ns += PAD(ns + 2, 4);
+ assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
+ assertEqualMem(e + 110, "symlink\0\0\0", 10); /* Name contents */
+ assertEqualMem(e + 110 + ns, "file1\0\0\0", 8); /* symlink target */
+ e += 110 + fs + ns;
+ }
/* "dir" */
assert(is_hex(e, 110));
assertEqualMem(e + 0, "070701", 6); /* Magic */
assert(is_hex(e + 6, 8)); /* ino */
- assertEqualInt(0x41fd, from_hex(e + 14, 8)); /* Mode */
- assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Group members bits and others bits do not work. */
+ assertEqualInt(0x41c0, from_hex(e + 14, 8) & 0xffc0); /* Mode */
+#else
+ /* Mode: sgid bit sometimes propagates from parent dirs, ignore it. */
+ assertEqualInt(040775, from_hex(e + 14, 8) & ~02000);
+#endif
+ assertEqualInt(from_hex(e + 22, 8), uid); /* uid */
assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
+#ifndef NLINKS_INACCURATE_FOR_DIRS
assertEqualMem(e + 38, "00000002", 8); /* nlink */
+#endif
t2 = from_hex(e + 46, 8); /* mtime */
failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
assertEqualMem(e + 54, "00000000", 8); /* File size */
+ fs = from_hex(e + 54, 8);
+ fs += PAD(fs, 4);
assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
assert(is_hex(e + 78, 8)); /* rdevmajor */
assert(is_hex(e + 86, 8)); /* rdevminor */
assertEqualMem(e + 94, "00000004", 8); /* Name size */
+ ns = from_hex(e + 94, 8);
+ ns += PAD(ns + 2, 4);
assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
assertEqualMem(e + 110, "dir\0\0\0", 6); /* Name contents */
- e += 116;
-
- /* TODO: Verify other types of entries. */
+ e += 110 + fs + ns;
/* Hardlink identical to "file1" */
/* Since we only wrote two of the three links to this
@@ -203,23 +245,32 @@ DEFINE_TEST(test_format_newc)
assertEqualMem(e + 0, "070701", 6); /* Magic */
failure("If these aren't the same, then the hardlink detection failed to match them.");
assertEqualInt(ino, from_hex(e + 6, 8)); /* ino */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Group members bits and others bits do not work. */
+ assertEqualInt(0x8180, from_hex(e + 14, 8) & 0xffc0); /* Mode */
+#else
assertEqualInt(0x81a4, from_hex(e + 14, 8)); /* Mode */
- assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+#endif
+ assertEqualInt(from_hex(e + 22, 8), uid); /* uid */
assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
assertEqualMem(e + 38, "00000003", 8); /* nlink */
t2 = from_hex(e + 46, 8); /* mtime */
failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
assertEqualInt(10, from_hex(e + 54, 8)); /* File size */
+ fs = from_hex(e + 54, 8);
+ fs += PAD(fs, 4);
assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
assert(is_hex(e + 78, 8)); /* rdevmajor */
assert(is_hex(e + 86, 8)); /* rdevminor */
assertEqualMem(e + 94, "00000009", 8); /* Name size */
+ ns = from_hex(e + 94, 8);
+ ns += PAD(ns + 2, 4);
assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
assertEqualMem(e + 110, "hardlink\0\0", 10); /* Name contents */
- assertEqualMem(e + 120, "123456789\0\0\0", 12); /* File contents */
- e += 120 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
+ assertEqualMem(e + 110 + ns, "1234567890\0\0", 12); /* File contents */
+ e += 110 + ns + fs;
/* Last entry is end-of-archive marker. */
assert(is_hex(e, 110));
@@ -240,6 +291,4 @@ DEFINE_TEST(test_format_newc)
assertEqualMem(e + 110, "TRAILER!!!\0\0", 12); /* Name */
free(p);
-
- umask(oldmask);
}
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat.c b/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
index 4c69abb6368..461e427c2e8 100644
--- a/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
@@ -23,19 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_gcpio_compat.c,v 1.2 2008/08/22 02:27:06 kientzle Exp $");
static void
unpack_test(const char *from, const char *options, const char *se)
{
- struct stat st, st2;
- char buff[128];
int r;
/* Create a work dir named after the file we're unpacking. */
- assertEqualInt(0, mkdir(from, 0775));
- chdir(from);
+ assertMakeDir(from, 0775);
+ assertChdir(from);
/*
* Use cpio to unpack the sample archive
@@ -48,80 +45,64 @@ unpack_test(const char *from, const char *options, const char *se)
assertEqualInt(r, 0);
/* Verify that nothing went to stderr. */
- assertFileContents(se, strlen(se), "unpack.err");
+ if (canSymlink()) {
+ failure("Error invoking %s -i %s < %s",
+ testprog, options, from);
+ assertTextFileContents(se, "unpack.err");
+ }
/*
* Verify unpacked files.
*/
/* Regular file with 2 links. */
- r = lstat("file", &st);
- failure("Failed to stat file %s/file, errno=%d", from, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st.st_mode));
- assertEqualInt(0644, st.st_mode & 0777);
- failure("file %s/file", from);
- assertEqualInt(10, st.st_size);
- failure("file %s/file", from);
- assertEqualInt(2, st.st_nlink);
- }
+ assertIsReg("file", 0644);
+ failure("%s", from);
+ assertFileSize("file", 10);
+ assertFileSize("linkfile", 10);
+ failure("%s", from);
+ assertFileNLinks("file", 2);
/* Another name for the same file. */
- r = lstat("linkfile", &st2);
- failure("Failed to stat file %s/linkfile, errno=%d", from, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st2.st_mode));
- assertEqualInt(0644, st2.st_mode & 0777);
- failure("file %s/file", from);
- assertEqualInt(10, st2.st_size);
- failure("file %s/file", from);
- assertEqualInt(2, st2.st_nlink);
- failure("file and linkfile should be hardlinked");
- assertEqualInt(st.st_dev, st2.st_dev);
- failure("file %s/file", from);
- assertEqualInt(st.st_ino, st2.st_ino);
- }
+ failure("%s", from);
+ assertIsHardlink("linkfile", "file");
+ assertFileSize("file", 10);
+ assertFileSize("linkfile", 10);
/* Symlink */
- r = lstat("symlink", &st);
- failure("Failed to stat file %s/symlink, errno=%d", from, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- failure("symlink should be a symlink; actual mode is %o",
- st.st_mode);
- assert(S_ISLNK(st.st_mode));
- if (S_ISLNK(st.st_mode)) {
- r = readlink("symlink", buff, sizeof(buff));
- assertEqualInt(r, 4);
- buff[r] = '\0';
- assertEqualString(buff, "file");
- }
- }
+ if (canSymlink())
+ assertIsSymlink("symlink", "file");
/* dir */
- r = lstat("dir", &st);
- if (r == 0) {
- assertEqualInt(r, 0);
- assert(S_ISDIR(st.st_mode));
- assertEqualInt(0775, st.st_mode & 0777);
- }
+ assertIsDir("dir", 0775);
- chdir("..");
+ assertChdir("..");
}
DEFINE_TEST(test_gcpio_compat)
{
- int oldumask;
-
- oldumask = umask(0);
+ assertUmask(0);
/* Dearchive sample files with a variety of options. */
- unpack_test("test_gcpio_compat_ref.bin", "", "1 block\n");
- unpack_test("test_gcpio_compat_ref.crc", "", "2 blocks\n");
- unpack_test("test_gcpio_compat_ref.newc", "", "2 blocks\n");
- unpack_test("test_gcpio_compat_ref.ustar", "", "7 blocks\n");
-
- umask(oldumask);
+ if (canSymlink()) {
+ unpack_test("test_gcpio_compat_ref.bin",
+ "--no-preserve-owner", "1 block\n");
+ unpack_test("test_gcpio_compat_ref.crc",
+ "--no-preserve-owner", "2 blocks\n");
+ unpack_test("test_gcpio_compat_ref.newc",
+ "--no-preserve-owner", "2 blocks\n");
+ /* gcpio-2.9 only reads 6 blocks here */
+ unpack_test("test_gcpio_compat_ref.ustar",
+ "--no-preserve-owner", "7 blocks\n");
+ } else {
+ unpack_test("test_gcpio_compat_ref_nosym.bin",
+ "--no-preserve-owner", "1 block\n");
+ unpack_test("test_gcpio_compat_ref_nosym.crc",
+ "--no-preserve-owner", "2 blocks\n");
+ unpack_test("test_gcpio_compat_ref_nosym.newc",
+ "--no-preserve-owner", "2 blocks\n");
+ /* gcpio-2.9 only reads 6 blocks here */
+ unpack_test("test_gcpio_compat_ref_nosym.ustar",
+ "--no-preserve-owner", "7 blocks\n");
+ }
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_B_upper.c b/archivers/libarchive/files/cpio/test/test_option_B_upper.c
new file mode 100644
index 00000000000..b040354b605
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_B_upper.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+
+DEFINE_TEST(test_option_B_upper)
+{
+ struct stat st;
+ int r;
+
+ /*
+ * Create a file on disk.
+ */
+ assertMakeFile("file", 0644, NULL);
+
+ /* Create an archive without -B; this should be 512 bytes. */
+ r = systemf("echo file | %s -o > small.cpio 2>small.err", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "small.err");
+ assertEqualInt(0, stat("small.cpio", &st));
+ assertEqualInt(512, st.st_size);
+
+ /* Create an archive with -B; this should be 5120 bytes. */
+ r = systemf("echo file | %s -oB > large.cpio 2>large.err", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "large.err");
+ assertEqualInt(0, stat("large.cpio", &st));
+ assertEqualInt(5120, st.st_size);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_C_upper.c b/archivers/libarchive/files/cpio/test/test_option_C_upper.c
new file mode 100644
index 00000000000..c8e63fd34fb
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_C_upper.c
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+
+DEFINE_TEST(test_option_C_upper)
+{
+ int r;
+
+ /*
+ * Create a file on disk.
+ */
+ assertMakeFile("file", 0644, NULL);
+
+ /* Create an archive without -C; this should be 512 bytes. */
+ r = systemf("echo file | %s -o > small.cpio 2>small.err", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "small.err");
+ assertFileSize("small.cpio", 512);
+
+ /* Create an archive with -C 513; this should be 513 bytes. */
+ r = systemf("echo file | %s -o -C 513 > 513.cpio 2>513.err",
+ testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "513.err");
+ assertFileSize("513.cpio", 513);
+
+ /* Create an archive with -C 12345; this should be 12345 bytes. */
+ r = systemf("echo file | %s -o -C12345 > 12345.cpio 2>12345.err",
+ testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "12345.err");
+ assertFileSize("12345.cpio", 12345);
+
+ /* Create an archive with invalid -C request */
+ assert(0 != systemf("echo file | %s -o -C > bad.cpio 2>bad.err",
+ testprog));
+ assertEmptyFile("bad.cpio");
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_J_upper.c b/archivers/libarchive/files/cpio/test/test_option_J_upper.c
new file mode 100644
index 00000000000..532aacf39cc
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_J_upper.c
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_J_upper)
+{
+ char *p;
+ int r;
+ size_t s;
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ /* Archive it with xz compression. */
+ r = systemf("echo f | %s -o -J >archive.out 2>archive.err",
+ testprog);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (r != 0) {
+ if (strstr(p, "compression not available") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without xz support");
+ return;
+ }
+ failure("-J option is broken");
+ assertEqualInt(r, 0);
+ return;
+ }
+ /* Check that the archive file has an xz signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "\3757zXZ", 5);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_L_upper.c b/archivers/libarchive/files/cpio/test/test_option_L_upper.c
new file mode 100644
index 00000000000..1774343f673
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_L_upper.c
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_L.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
+
+/* This is a little pointless, as Windows doesn't support symlinks
+ * (except for the seriously crippled CreateSymbolicLink API) so these
+ * tests won't run on Windows. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define CAT "type"
+#else
+#define CAT "cat"
+#endif
+
+DEFINE_TEST(test_option_L_upper)
+{
+ FILE *filelist;
+ int r;
+
+ if (!canSymlink()) {
+ skipping("Symlink tests");
+ return;
+ }
+
+ filelist = fopen("filelist", "w");
+
+ /* Create a file and a symlink to the file. */
+ assertMakeFile("file", 0644, "1234567890");
+ fprintf(filelist, "file\n");
+
+ /* Symlink to above file. */
+ assertMakeSymlink("symlink", "file");
+ fprintf(filelist, "symlink\n");
+
+ fclose(filelist);
+
+ r = systemf(CAT " filelist | %s -pd copy >copy.out 2>copy.err", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "copy.err");
+
+ failure("Regular -p without -L should preserve symlinks.");
+ assertIsSymlink("copy/symlink", NULL);
+
+ r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("copy-L.out");
+ assertTextFileContents("1 block\n", "copy-L.err");
+ failure("-pdL should dereference symlinks and turn them into files.");
+ assertIsReg("copy-L/symlink", -1);
+
+ r = systemf(CAT " filelist | %s -o >archive.out 2>archive.err", testprog);
+ failure("Error invoking %s -o ", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "archive.err");
+
+ assertMakeDir("unpack", 0755);
+ assertChdir("unpack");
+ r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog);
+ failure("Error invoking %s -i", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "unpack.err");
+ assertChdir("..");
+
+ assertIsSymlink("unpack/symlink", NULL);
+
+ r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog);
+ failure("Error invoking %s -oL", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "archive-L.err");
+
+ assertMakeDir("unpack-L", 0755);
+ assertChdir("unpack-L");
+ r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog);
+ failure("Error invoking %s -i < archive-L.out", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "unpack-L.err");
+ assertChdir("..");
+ assertIsReg("unpack-L/symlink", -1);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_Z_upper.c b/archivers/libarchive/files/cpio/test/test_option_Z_upper.c
new file mode 100644
index 00000000000..936ce0c2d3e
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_Z_upper.c
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_Z_upper)
+{
+ char *p;
+ int r;
+ size_t s;
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ /* Archive it with compress compression. */
+ r = systemf("echo f | %s -oZ >archive.out 2>archive.err",
+ testprog);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (r != 0) {
+ if (strstr(p, "compression not available") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without compress support");
+ return;
+ }
+ failure("-Z option is broken");
+ assertEqualInt(r, 0);
+ return;
+ }
+ /* Check that the archive file has a compress signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "\x1f\x9d", 2);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_a.c b/archivers/libarchive/files/cpio/test/test_option_a.c
index c063280f7d7..606de606e2c 100644
--- a/archivers/libarchive/files/cpio/test/test_option_a.c
+++ b/archivers/libarchive/files/cpio/test/test_option_a.c
@@ -23,8 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
+#if defined(HAVE_UTIME_H)
#include <utime.h>
-__FBSDID("$FreeBSD$");
+#elif defined(HAVE_SYS_UTIME_H)
+#include <sys/utime.h>
+#endif
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_a.c,v 1.3 2008/08/24 06:21:00 kientzle Exp $");
static struct {
const char *name;
@@ -53,19 +57,15 @@ test_create(void)
struct utimbuf times;
static const int numfiles = sizeof(files) / sizeof(files[0]);
int i;
- int fd;
for (i = 0; i < numfiles; ++i) {
- fd = open(files[i].name, O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
/*
* Note: Have to write at least one byte to the file.
* cpio doesn't bother reading the file if it's zero length,
* so the atime never gets changed in that case, which
* makes the tests below rather pointless.
*/
- assertEqualInt(1, write(fd, "a", 1));
- close(fd);
+ assertMakeFile(files[i].name, 0644, "a");
/* If utime() isn't supported on your platform, just
* #ifdef this section out. Most of the test below is
@@ -83,26 +83,21 @@ test_create(void)
}
/* Wait until the atime on the last file is actually in the past. */
- /* If utime() is supported above, there's no sleep here which
- * makes the test faster. */
- while (files[numfiles - 1].atime_sec >= time(NULL))
- sleep(1);
+ sleepUntilAfter(files[numfiles - 1].atime_sec);
}
DEFINE_TEST(test_option_a)
{
struct stat st;
int r;
- int f;
- char buff[64];
+ char *p;
/* Create all of the test files. */
test_create();
/* Sanity check; verify that atimes really do get modified. */
- f = open(files[0].name, O_RDONLY);
- assertEqualInt(1, read(f,buff, 1));
- assertEqualInt(0, close(f));
+ assert((p = slurpfile(NULL, "f0")) != NULL);
+ free(p);
assertEqualInt(0, stat("f0", &st));
if (st.st_atime == files[0].atime_sec) {
skipping("Cannot verify -a option\n"
@@ -118,7 +113,7 @@ DEFINE_TEST(test_option_a)
/* Copy the file without -a; should change the atime. */
r = systemf("echo %s | %s -pd copy-no-a > copy-no-a.out 2>copy-no-a.err", files[1].name, testprog);
assertEqualInt(r, 0);
- assertEmptyFile("copy-no-a.err");
+ assertTextFileContents("1 block\n", "copy-no-a.err");
assertEmptyFile("copy-no-a.out");
assertEqualInt(0, stat(files[1].name, &st));
failure("Copying file without -a should have changed atime.");
@@ -127,7 +122,7 @@ DEFINE_TEST(test_option_a)
/* Archive the file without -a; should change the atime. */
r = systemf("echo %s | %s -o > archive-no-a.out 2>archive-no-a.err", files[2].name, testprog);
assertEqualInt(r, 0);
- assertEmptyFile("copy-no-a.err");
+ assertTextFileContents("1 block\n", "copy-no-a.err");
assertEqualInt(0, stat(files[2].name, &st));
failure("Archiving file without -a should have changed atime.");
assert(st.st_atime != files[2].atime_sec);
@@ -142,7 +137,7 @@ DEFINE_TEST(test_option_a)
r = systemf("echo %s | %s -pad copy-a > copy-a.out 2>copy-a.err",
files[3].name, testprog);
assertEqualInt(r, 0);
- assertEmptyFile("copy-a.err");
+ assertTextFileContents("1 block\n", "copy-a.err");
assertEmptyFile("copy-a.out");
assertEqualInt(0, stat(files[3].name, &st));
failure("Copying file with -a should not have changed atime.");
@@ -152,7 +147,7 @@ DEFINE_TEST(test_option_a)
r = systemf("echo %s | %s -oa > archive-a.out 2>archive-a.err",
files[4].name, testprog);
assertEqualInt(r, 0);
- assertEmptyFile("copy-a.err");
+ assertTextFileContents("1 block\n", "copy-a.err");
assertEqualInt(0, stat(files[4].name, &st));
failure("Archiving file with -a should not have changed atime.");
assertEqualInt(st.st_atime, files[4].atime_sec);
diff --git a/archivers/libarchive/files/cpio/test/test_option_c.c b/archivers/libarchive/files/cpio/test/test_option_c.c
index 05b48c29cc3..241bcf67bb1 100644
--- a/archivers/libarchive/files/cpio/test/test_option_c.c
+++ b/archivers/libarchive/files/cpio/test/test_option_c.c
@@ -53,44 +53,47 @@ from_octal(const char *p, size_t l)
DEFINE_TEST(test_option_c)
{
- int fd, filelist;
+ FILE *filelist;
int r;
+ int uid = -1;
int dev, ino, gid;
time_t t, now;
char *p, *e;
size_t s;
- mode_t oldmask;
- oldmask = umask(0);
+ assertUmask(0);
+
+#if !defined(_WIN32)
+ uid = getuid();
+#endif
/*
* Create an assortment of files.
* TODO: Extend this to cover more filetypes.
*/
- filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+ filelist = fopen("filelist", "w");
/* "file" */
- fd = open("file", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(10, write(fd, "123456789", 10));
- close(fd);
- assertEqualInt(5, write(filelist, "file\n", 5));
+ assertMakeFile("file", 0644, "1234567890");
+ fprintf(filelist, "file\n");
/* "symlink" */
- assertEqualInt(0, symlink("file", "symlink"));
- assertEqualInt(8, write(filelist, "symlink\n", 8));
+ if (canSymlink()) {
+ assertMakeSymlink("symlink", "file");
+ fprintf(filelist, "symlink\n");
+ }
/* "dir" */
- assertEqualInt(0, mkdir("dir", 0775));
+ assertMakeDir("dir", 0775);
/* Record some facts about what we just created: */
now = time(NULL); /* They were all created w/in last two seconds. */
- assertEqualInt(4, write(filelist, "dir\n", 4));
+ fprintf(filelist, "dir\n");
/* Use the cpio program to create an archive. */
- close(filelist);
+ fclose(filelist);
r = systemf("%s -oc <filelist >basic.out 2>basic.err", testprog);
/* Verify that nothing went to stderr. */
- assertFileContents("1 block\n", 8, "basic.err");
+ assertTextFileContents("1 block\n", "basic.err");
/* Assert that the program finished. */
failure("%s -oc crashed", testprog);
@@ -114,8 +117,15 @@ DEFINE_TEST(test_option_c)
dev = from_octal(e + 6, 6);
assert(is_octal(e + 12, 6)); /* ino */
ino = from_octal(e + 12, 6);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Group members bits and others bits do not work. */
+ assertEqualMem(e + 18, "100666", 6); /* Mode */
+#else
assertEqualMem(e + 18, "100644", 6); /* Mode */
- assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
+#endif
+ if (uid < 0)
+ uid = from_octal(e + 24, 6);
+ assertEqualInt(from_octal(e + 24, 6), uid); /* uid */
assert(is_octal(e + 30, 6)); /* gid */
gid = from_octal(e + 30, 6);
assertEqualMem(e + 36, "000001", 6); /* nlink */
@@ -128,31 +138,37 @@ DEFINE_TEST(test_option_c)
assertEqualMem(e + 59, "000005", 6); /* Name size */
assertEqualMem(e + 65, "00000000012", 11); /* File size */
assertEqualMem(e + 76, "file\0", 5); /* Name contents */
- assertEqualMem(e + 81, "123456789\0", 10); /* File contents */
+ assertEqualMem(e + 81, "1234567890", 10); /* File contents */
e += 91;
- /* Second entry is "symlink" pointing to "file" */
- assert(is_octal(e, 76)); /* Entire header is octal digits. */
- assertEqualMem(e + 0, "070707", 6); /* Magic */
- assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */
- assert(dev != from_octal(e + 12, 6)); /* ino */
- assertEqualMem(e + 18, "120777", 6); /* Mode */
- assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
- assertEqualInt(gid, from_octal(e + 30, 6)); /* gid */
- assertEqualMem(e + 36, "000001", 6); /* nlink */
- failure("file entries should have rdev == 0 (dev was 0%o)",
- from_octal(e + 6, 6));
- assertEqualMem(e + 42, "000000", 6); /* rdev */
- t = from_octal(e + 48, 11); /* mtime */
- assert(t <= now); /* File wasn't created in future. */
- assert(t >= now - 2); /* File was created w/in last 2 secs. */
- assertEqualMem(e + 59, "000010", 6); /* Name size */
- assertEqualMem(e + 65, "00000000004", 11); /* File size */
- assertEqualMem(e + 76, "symlink\0", 8); /* Name contents */
- assertEqualMem(e + 84, "file", 4); /* Symlink target. */
- e += 88;
+ /* "symlink" pointing to "file" */
+ if (canSymlink()) {
+ assert(is_octal(e, 76)); /* Entire header is octal digits. */
+ assertEqualMem(e + 0, "070707", 6); /* Magic */
+ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */
+ assert(ino != from_octal(e + 12, 6)); /* ino */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* On Windows, symbolic link and group members bits and
+ * others bits do not work. */
+ assertEqualMem(e + 18, "120777", 6); /* Mode */
+#endif
+ assertEqualInt(from_octal(e + 24, 6), uid); /* uid */
+ assertEqualInt(gid, from_octal(e + 30, 6)); /* gid */
+ assertEqualMem(e + 36, "000001", 6); /* nlink */
+ failure("file entries should have rdev == 0 (dev was 0%o)",
+ from_octal(e + 6, 6));
+ assertEqualMem(e + 42, "000000", 6); /* rdev */
+ t = from_octal(e + 48, 11); /* mtime */
+ assert(t <= now); /* File wasn't created in future. */
+ assert(t >= now - 2); /* File was created w/in last 2 secs. */
+ assertEqualMem(e + 59, "000010", 6); /* Name size */
+ assertEqualMem(e + 65, "00000000004", 11); /* File size */
+ assertEqualMem(e + 76, "symlink\0", 8); /* Name contents */
+ assertEqualMem(e + 84, "file", 4); /* Symlink target. */
+ e += 88;
+ }
- /* Second entry is "dir" */
+ /* "dir" */
assert(is_octal(e, 76));
assertEqualMem(e + 0, "070707", 6); /* Magic */
/* Dev should be same as first entry. */
@@ -161,12 +177,21 @@ DEFINE_TEST(test_option_c)
/* Ino must be different from first entry. */
assert(is_octal(e + 12, 6)); /* ino */
assert(dev != from_octal(e + 12, 6));
- assertEqualMem(e + 18, "040775", 6); /* Mode */
- assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Group members bits and others bits do not work. */
+ assertEqualMem(e + 18, "040777", 6); /* Mode */
+#else
+ /* Accept 042775 to accomodate systems where sgid bit propagates. */
+ if (memcmp(e + 18, "042775", 6) != 0)
+ assertEqualMem(e + 18, "040775", 6); /* Mode */
+#endif
+ assertEqualInt(from_octal(e + 24, 6), uid); /* uid */
/* Gid should be same as first entry. */
assert(is_octal(e + 30, 6)); /* gid */
assertEqualInt(gid, from_octal(e + 30, 6));
+#ifndef NLINKS_INACCURATE_FOR_DIRS
assertEqualMem(e + 36, "000002", 6); /* Nlink */
+#endif
t = from_octal(e + 48, 11); /* mtime */
assert(t <= now); /* File wasn't created in future. */
assert(t >= now - 2); /* File was created w/in last 2 secs. */
@@ -193,6 +218,4 @@ DEFINE_TEST(test_option_c)
assertEqualMem(e + 76, "TRAILER!!!\0", 11); /* Name */
free(p);
-
- umask(oldmask);
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_d.c b/archivers/libarchive/files/cpio/test/test_option_d.c
index 370c82ae2d0..9ff14539698 100644
--- a/archivers/libarchive/files/cpio/test/test_option_d.c
+++ b/archivers/libarchive/files/cpio/test/test_option_d.c
@@ -28,41 +28,37 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_d)
{
- struct stat st;
- int r, fd;
+ int r;
/*
* Create a file in a directory.
*/
- assertEqualInt(0, mkdir("dir", 0755));
- fd = open("dir/file", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- close(fd);
+ assertMakeDir("dir", 0755);
+ assertMakeFile("dir/file", 0644, NULL);
/* Create an archive. */
r = systemf("echo dir/file | %s -o > archive.cpio 2>archive.err", testprog);
assertEqualInt(r, 0);
- assertFileContents("1 block\n", 8, "archive.err");
- assertEqualInt(0, stat("archive.cpio", &st));
- assertEqualInt(512, st.st_size);
+ assertTextFileContents("1 block\n", "archive.err");
+ assertFileSize("archive.cpio", 512);
/* Dearchive without -d, this should fail. */
- assertEqualInt(0, mkdir("without-d", 0755));
- assertEqualInt(0, chdir("without-d"));
+ assertMakeDir("without-d", 0755);
+ assertChdir("without-d");
r = systemf("%s -i < ../archive.cpio >out 2>err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("out");
/* And the file should not be restored. */
- assert(0 != stat("dir/file", &st));
+ assertFileNotExists("dir/file");
/* Dearchive with -d, this should succeed. */
- assertEqualInt(0, chdir(".."));
- assertEqualInt(0, mkdir("with-d", 0755));
- assertEqualInt(0, chdir("with-d"));
+ assertChdir("..");
+ assertMakeDir("with-d", 0755);
+ assertChdir("with-d");
r = systemf("%s -id < ../archive.cpio >out 2>err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("out");
- assertFileContents("1 block\n", 8, "err");
+ assertTextFileContents("1 block\n", "err");
/* And the file should be restored. */
- assertEqualInt(0, stat("dir/file", &st));
+ assertFileExists("dir/file");
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_f.c b/archivers/libarchive/files/cpio/test/test_option_f.c
index d1af91290d4..784e0858431 100644
--- a/archivers/libarchive/files/cpio/test/test_option_f.c
+++ b/archivers/libarchive/files/cpio/test/test_option_f.c
@@ -33,34 +33,44 @@ unpack(const char *dirname, const char *option)
{
int r;
- assertEqualInt(0, mkdir(dirname, 0755));
- assertEqualInt(0, chdir(dirname));
+ assertMakeDir(dirname, 0755);
+ assertChdir(dirname);
extract_reference_file("test_option_f.cpio");
r = systemf("%s -i %s < test_option_f.cpio > copy-no-a.out 2>copy-no-a.err", testprog, option);
assertEqualInt(0, r);
- assertEqualInt(0, chdir(".."));
+ assertChdir("..");
}
DEFINE_TEST(test_option_f)
{
/* Calibrate: No -f option, so everything should be extracted. */
- unpack("t0", "");
- assertEqualInt(0, access("t0/a123", F_OK));
- assertEqualInt(0, access("t0/a234", F_OK));
- assertEqualInt(0, access("t0/b123", F_OK));
- assertEqualInt(0, access("t0/b234", F_OK));
+ unpack("t0", "--no-preserve-owner");
+ assertFileExists("t0/a123");
+ assertFileExists("t0/a234");
+ assertFileExists("t0/b123");
+ assertFileExists("t0/b234");
/* Don't extract 'a*' files. */
- unpack("t1", "-f 'a*'");
- assert(0 != access("t1/a123", F_OK));
- assert(0 != access("t1/a234", F_OK));
- assertEqualInt(0, access("t1/b123", F_OK));
- assertEqualInt(0, access("t1/b234", F_OK));
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Single quotes isn't used by command.exe. */
+ unpack("t1", "--no-preserve-owner -f a*");
+#else
+ unpack("t1", "--no-preserve-owner -f 'a*'");
+#endif
+ assertFileNotExists("t1/a123");
+ assertFileNotExists("t1/a234");
+ assertFileExists("t1/b123");
+ assertFileExists("t1/b234");
/* Don't extract 'b*' files. */
- unpack("t2", "-f 'b*'");
- assertEqualInt(0, access("t2/a123", F_OK));
- assertEqualInt(0, access("t2/a234", F_OK));
- assert(0 != access("t2/b123", F_OK));
- assert(0 != access("t2/b234", F_OK));
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Single quotes isn't used by command.exe. */
+ unpack("t2", "--no-preserve-owner -f b*");
+#else
+ unpack("t2", "--no-preserve-owner -f 'b*'");
+#endif
+ assertFileExists("t2/a123");
+ assertFileExists("t2/a234");
+ assertFileNotExists("t2/b123");
+ assertFileNotExists("t2/b234");
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_help.c b/archivers/libarchive/files/cpio/test/test_option_help.c
index b9433a43a68..56234306f53 100644
--- a/archivers/libarchive/files/cpio/test/test_option_help.c
+++ b/archivers/libarchive/files/cpio/test/test_option_help.c
@@ -51,6 +51,7 @@ DEFINE_TEST(test_option_help)
/* Exercise --help option. */
r = systemf("%s --help >help.stdout 2>help.stderr", testprog);
+ assertEqualInt(r, 0);
failure("--help should generate nothing to stderr.");
assertEmptyFile("help.stderr");
/* Help message should start with name of program. */
@@ -67,6 +68,7 @@ DEFINE_TEST(test_option_help)
/* -h option should generate the same output. */
r = systemf("%s -h >h.stdout 2>h.stderr", testprog);
+ assertEqualInt(r, 0);
failure("-h should generate nothing to stderr.");
assertEmptyFile("h.stderr");
failure("stdout should be same for -h and --help");
@@ -74,6 +76,7 @@ DEFINE_TEST(test_option_help)
/* -W help should be another synonym. */
r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog);
+ assertEqualInt(r, 0);
failure("-W help should generate nothing to stderr.");
assertEmptyFile("Whelp.stderr");
failure("stdout should be same for -W help and --help");
diff --git a/archivers/libarchive/files/cpio/test/test_option_l.c b/archivers/libarchive/files/cpio/test/test_option_l.c
new file mode 100644
index 00000000000..5c76e688e6e
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_l.c
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_l)
+{
+ int r;
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ /* Copy the file to the "copy" dir. */
+ r = systemf("echo f | %s -pd copy >copy.out 2>copy.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Check that the copy is a true copy and not a link. */
+ assertIsNotHardlink("f", "copy/f");
+
+ /* Copy the file to the "link" dir with the -l option. */
+ r = systemf("echo f | %s -pld link >link.out 2>link.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Check that this is a link and not a copy. */
+ assertIsHardlink("f", "link/f");
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_lzma.c b/archivers/libarchive/files/cpio/test/test_option_lzma.c
new file mode 100644
index 00000000000..c6e33530150
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_lzma.c
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_lzma)
+{
+ char *p;
+ int r;
+ size_t s;
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ /* Archive it with lzma compression. */
+ r = systemf("echo f | %s -o --lzma >archive.out 2>archive.err",
+ testprog);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (r != 0) {
+ if (strstr(p, "compression not available") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without lzma support");
+ return;
+ }
+ failure("--lzma option is broken");
+ assertEqualInt(r, 0);
+ return;
+ }
+ /* Check that the archive file has an lzma signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "\x5d\00\00", 3);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_m.c b/archivers/libarchive/files/cpio/test/test_option_m.c
index d5bbad2e902..de880b2883e 100644
--- a/archivers/libarchive/files/cpio/test/test_option_m.c
+++ b/archivers/libarchive/files/cpio/test/test_option_m.c
@@ -28,9 +28,7 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_m)
{
- struct stat st;
int r;
- time_t now;
/*
* The reference archive has one file with an mtime in 1970, 1
@@ -38,33 +36,28 @@ DEFINE_TEST(test_option_m)
*/
/* Restored without -m, the result should have a current mtime. */
- assertEqualInt(0, mkdir("without-m", 0755));
- assertEqualInt(0, chdir("without-m"));
+ assertMakeDir("without-m", 0755);
+ assertChdir("without-m");
extract_reference_file("test_option_m.cpio");
- r = systemf("%s -i < test_option_m.cpio >out 2>err", testprog);
- now = time(NULL);
+ r = systemf("%s --no-preserve-owner -i < test_option_m.cpio >out 2>err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("out");
- assertFileContents("1 block\n", 8, "err");
- assertEqualInt(0, stat("file", &st));
+ assertTextFileContents("1 block\n", "err");
/* Should have been created within the last few seconds. */
- assert(st.st_mtime <= now);
- assert(st.st_mtime > now - 5);
+ assertFileMtimeRecent("file");
/* With -m, it should have an mtime in 1970. */
- assertEqualInt(0, chdir(".."));
- assertEqualInt(0, mkdir("with-m", 0755));
- assertEqualInt(0, chdir("with-m"));
+ assertChdir("..");
+ assertMakeDir("with-m", 0755);
+ assertChdir("with-m");
extract_reference_file("test_option_m.cpio");
- r = systemf("%s -im < test_option_m.cpio >out 2>err", testprog);
- now = time(NULL);
+ r = systemf("%s --no-preserve-owner -im < test_option_m.cpio >out 2>err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("out");
- assertFileContents("1 block\n", 8, "err");
- assertEqualInt(0, stat("file", &st));
+ assertTextFileContents("1 block\n", "err");
/*
* mtime in reference archive is '1' == 1 second after
* midnight Jan 1, 1970 UTC.
*/
- assertEqualInt(1, st.st_mtime);
+ assertFileMtime("file", 1, 0);
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_t.c b/archivers/libarchive/files/cpio/test/test_option_t.c
index c9cdd0bc8a2..4427bb3a6cd 100644
--- a/archivers/libarchive/files/cpio/test/test_option_t.c
+++ b/archivers/libarchive/files/cpio/test/test_option_t.c
@@ -28,20 +28,68 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_t)
{
+ char *p;
int r;
/* List reference archive, make sure the TOC is correct. */
extract_reference_file("test_option_t.cpio");
- r = systemf("%s -it < test_option_t.cpio >t.out 2>t.err", testprog);
+ r = systemf("%s -it < test_option_t.cpio >it.out 2>it.err", testprog);
assertEqualInt(r, 0);
- assertFileContents("1 block\n", 8, "t.err");
+ assertTextFileContents("1 block\n", "it.err");
extract_reference_file("test_option_t.stdout");
- assertEqualFile("t.out", "test_option_t.stdout");
+ p = slurpfile(NULL, "test_option_t.stdout");
+ assertTextFileContents(p, "it.out");
+ free(p);
+
+ /* We accept plain "-t" as a synonym for "-it" */
+ r = systemf("%s -t < test_option_t.cpio >t.out 2>t.err", testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "t.err");
+ extract_reference_file("test_option_t.stdout");
+ p = slurpfile(NULL, "test_option_t.stdout");
+ assertTextFileContents(p, "t.out");
+ free(p);
+
+ /* But "-ot" is an error. */
+ assert(0 != systemf("%s -ot < test_option_t.cpio >ot.out 2>ot.err",
+ testprog));
+ assertEmptyFile("ot.out");
/* List reference archive verbosely, make sure the TOC is correct. */
r = systemf("%s -itv < test_option_t.cpio >tv.out 2>tv.err", testprog);
assertEqualInt(r, 0);
- assertFileContents("1 block\n", 8, "tv.err");
+ assertTextFileContents("1 block\n", "tv.err");
extract_reference_file("test_option_tv.stdout");
- assertEqualFile("tv.out", "test_option_tv.stdout");
+
+ /* This doesn't work because the usernames on different systems
+ * are different and cpio now looks up numeric UIDs on
+ * the local system. */
+ /* assertEqualFile("tv.out", "test_option_tv.stdout"); */
+
+ /* List reference archive with numeric IDs, verify TOC is correct. */
+ r = systemf("%s -itnv < test_option_t.cpio >itnv.out 2>itnv.err",
+ testprog);
+ assertEqualInt(r, 0);
+ assertTextFileContents("1 block\n", "itnv.err");
+ p = slurpfile(NULL, "itnv.out");
+ /* Since -n uses numeric UID/GID, this part should be the
+ * same on every system. */
+ assertEqualMem(p, "-rw-r--r-- 1 1000 1000 0 ",42);
+ /* Date varies depending on local timezone. */
+ if (memcmp(p + 42, "Dec 31 1969", 12) == 0) {
+ /* East of Greenwich we get Dec 31, 1969. */
+ } else {
+ /* West of Greenwich get Jan 1, 1970 */
+ assertEqualMem(p + 42, "Jan ", 4);
+ /* Some systems format "Jan 01", some "Jan 1" */
+ assert(p[46] == ' ' || p[46] == '0');
+ assertEqualMem(p + 47, "1 1970 ", 8);
+ }
+ assertEqualMem(p + 54, " file", 5);
+ free(p);
+
+ /* But "-n" without "-t" is an error. */
+ assert(0 != systemf("%s -in < test_option_t.cpio >in.out 2>in.err",
+ testprog));
+ assertEmptyFile("in.out");
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu b/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu
index baead3ee324..e28888ac474 100644
--- a/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu
+++ b/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu
@@ -1,5 +1,6 @@
-$FreeBSD$
+$FreeBSD: src/usr.bin/cpio/test/test_option_tv.stdout.uu,v 1.2 2008/11/29 20:22:02 kientzle Exp $
begin 644 test_option_tv.stdout
-G+7)W+7(M+7(M+2`@(#$@("`H;G5L;"D@("AN=6QL*2`P(&9I;&4*
+M+7)W+7(M+7(M+2`@(#$@=&EM("`@("`@=&EM("`@("`@("`@("`@(#`@1&5C
+/(#,Q("`Q.38Y(&9I;&4*
`
end
diff --git a/archivers/libarchive/files/cpio/test/test_option_u.c b/archivers/libarchive/files/cpio/test/test_option_u.c
index 7abd7f0f0ef..08058aa4539 100644
--- a/archivers/libarchive/files/cpio/test/test_option_u.c
+++ b/archivers/libarchive/files/cpio/test/test_option_u.c
@@ -23,7 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
+#if defined(HAVE_UTIME_H)
#include <utime.h>
+#elif defined(HAVE_SYS_UTIME_H)
+#include <sys/utime.h>
+#endif
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_u)
@@ -31,14 +35,10 @@ DEFINE_TEST(test_option_u)
struct utimbuf times;
char *p;
size_t s;
- int fd;
int r;
/* Create a file. */
- fd = open("f", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(1, write(fd, "a", 1));
- close(fd);
+ assertMakeFile("f", 0644, "a");
/* Copy the file to the "copy" dir. */
r = systemf("echo f | %s -pd copy >copy.out 2>copy.err",
@@ -51,10 +51,7 @@ DEFINE_TEST(test_option_u)
assertEqualMem(p, "a", 1);
/* Recreate the file with a single "b" */
- fd = open("f", O_CREAT | O_TRUNC | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(1, write(fd, "b", 1));
- close(fd);
+ assertMakeFile("f", 0644, "b");
/* Set the mtime to the distant past. */
memset(&times, 0, sizeof(times));
diff --git a/archivers/libarchive/files/cpio/test/test_option_version.c b/archivers/libarchive/files/cpio/test/test_option_version.c
index 95258eb7e82..7345da1e515 100644
--- a/archivers/libarchive/files/cpio/test/test_option_version.c
+++ b/archivers/libarchive/files/cpio/test/test_option_version.c
@@ -74,10 +74,14 @@ verify(const char *p, size_t s)
/* Skip a single trailing a,b,c, or d. */
if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
++q;
- /* All terminated by a newline. */
+ /* All terminated by end-of-line: \r, \r\n, or \n */
assert(s >= 1);
failure("Version: %s", p);
- assertEqualMem(q, "\n", 1);
+ if (*q == '\x0d') {
+ if (q[1] != '\0')
+ assertEqualMem(q, "\x0d\x0a", 2);
+ } else
+ assertEqualMem(q, "\x0a", 1);
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_y.c b/archivers/libarchive/files/cpio/test/test_option_y.c
index 56852a805f4..58734966ce6 100644
--- a/archivers/libarchive/files/cpio/test/test_option_y.c
+++ b/archivers/libarchive/files/cpio/test/test_option_y.c
@@ -23,30 +23,35 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_y.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
DEFINE_TEST(test_option_y)
{
char *p;
- int fd;
int r;
size_t s;
/* Create a file. */
- fd = open("f", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(1, write(fd, "a", 1));
- close(fd);
+ assertMakeFile("f", 0644, "a");
/* Archive it with bzip2 compression. */
r = systemf("echo f | %s -oy >archive.out 2>archive.err",
testprog);
- assertFileContents("1 block\n", 8, "archive.err");
- failure("-y (bzip) option seems to be broken");
- if (assertEqualInt(r, 0)) {
- /* Check that the archive file has a bzip2 signature. */
- p = slurpfile(&s, "archive.out");
- assert(s > 2);
- assertEqualMem(p, "BZh9", 4);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (r != 0) {
+ if (strstr(p, "compression not available") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without bzip2 support");
+ return;
+ }
+ failure("-y option is broken");
+ assertEqualInt(r, 0);
+ return;
}
+ assertTextFileContents("1 block\n", "archive.err");
+ /* Check that the archive file has a bzip2 signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "BZh9", 4);
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_z.c b/archivers/libarchive/files/cpio/test/test_option_z.c
index 15337a4ca15..91d37ac1983 100644
--- a/archivers/libarchive/files/cpio/test/test_option_z.c
+++ b/archivers/libarchive/files/cpio/test/test_option_z.c
@@ -28,25 +28,29 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_z)
{
char *p;
- int fd;
int r;
size_t s;
/* Create a file. */
- fd = open("f", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(1, write(fd, "a", 1));
- close(fd);
+ assertMakeFile("f", 0644, "a");
/* Archive it with gzip compression. */
r = systemf("echo f | %s -oz >archive.out 2>archive.err",
testprog);
- failure("-z option seems to be broken");
- assertEqualInt(r, 0);
- if (r == 0) {
- /* Check that the archive file has a gzip signature. */
- p = slurpfile(&s, "archive.out");
- assert(s > 2);
- assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (r != 0) {
+ if (strstr(p, "compression not available") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without gzip support");
+ return;
+ }
+ failure("-z option is broken");
+ assertEqualInt(r, 0);
+ return;
}
+ /* Check that the archive file has a gzip signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 4);
+ assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
}
diff --git a/archivers/libarchive/files/cpio/test/test_owner_parse.c b/archivers/libarchive/files/cpio/test/test_owner_parse.c
index 1adbce4a9fc..9875e91e4ad 100644
--- a/archivers/libarchive/files/cpio/test/test_owner_parse.c
+++ b/archivers/libarchive/files/cpio/test/test_owner_parse.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,25 +26,86 @@
__FBSDID("$FreeBSD$");
#include "../cpio.h"
+#include "err.h"
+
+#if !defined(_WIN32)
+#define ROOT "root"
+static int root_uids[] = { 0 };
+static int root_gids[] = { 0 };
+#elif defined(__CYGWIN__)
+/* On cygwin, the Administrator user most likely exists (unless
+ * it has been renamed or is in a non-English localization), but
+ * its primary group membership depends on how the user set up
+ * their /etc/passwd. Likely values are 513 (None), 545 (Users),
+ * or 544 (Administrators). Just check for one of those...
+ * TODO: Handle non-English localizations...e.g. French 'Administrateur'
+ * Use CreateWellKnownSID() and LookupAccountName()?
+ */
+#define ROOT "Administrator"
+static int root_uids[] = { 500 };
+static int root_gids[] = { 513, 545, 544 };
+#endif
+
+#if defined(ROOT)
+static int
+int_in_list(int i, int *l, size_t n)
+{
+ while (n-- > 0)
+ if (*l++ == i)
+ return (1);
+ failure("%d", i);
+ return (0);
+}
+#endif
DEFINE_TEST(test_owner_parse)
{
+#if !defined(ROOT)
+ skipping("No uid/gid configuration for this OS");
+#else
int uid, gid;
- cpio_progname = "Ignore this message";
+ assert(NULL == owner_parse(ROOT, &uid, &gid));
+ assert(int_in_list(uid, root_uids,
+ sizeof(root_uids)/sizeof(root_uids[0])));
+ assertEqualInt(-1, gid);
+
- assertEqualInt(0, owner_parse("root", &uid, &gid));
- assertEqualInt(0, uid);
+ assert(NULL == owner_parse(ROOT ":", &uid, &gid));
+ assert(int_in_list(uid, root_uids,
+ sizeof(root_uids)/sizeof(root_uids[0])));
+ assert(int_in_list(gid, root_gids,
+ sizeof(root_gids)/sizeof(root_gids[0])));
+
+ assert(NULL == owner_parse(ROOT ".", &uid, &gid));
+ assert(int_in_list(uid, root_uids,
+ sizeof(root_uids)/sizeof(root_uids[0])));
+ assert(int_in_list(gid, root_gids,
+ sizeof(root_gids)/sizeof(root_gids[0])));
+
+ assert(NULL == owner_parse("111", &uid, &gid));
+ assertEqualInt(111, uid);
assertEqualInt(-1, gid);
+ assert(NULL == owner_parse("112:", &uid, &gid));
+ assertEqualInt(112, uid);
+ /* Can't assert gid, since we don't know gid for user #112. */
+
+ assert(NULL == owner_parse("113.", &uid, &gid));
+ assertEqualInt(113, uid);
+ /* Can't assert gid, since we don't know gid for user #113. */
+
+ assert(NULL == owner_parse(":114", &uid, &gid));
+ assertEqualInt(-1, uid);
+ assertEqualInt(114, gid);
- assertEqualInt(0, owner_parse("root:", &uid, &gid));
- assertEqualInt(0, uid);
- assertEqualInt(0, gid);
+ assert(NULL == owner_parse(".115", &uid, &gid));
+ assertEqualInt(-1, uid);
+ assertEqualInt(115, gid);
- assertEqualInt(0, owner_parse("root.", &uid, &gid));
- assertEqualInt(0, uid);
- assertEqualInt(0, gid);
+ assert(NULL == owner_parse("116:117", &uid, &gid));
+ assertEqualInt(116, uid);
+ assertEqualInt(117, gid);
/*
* TODO: Lookup current user/group name, build strings and
@@ -52,17 +113,9 @@ DEFINE_TEST(test_owner_parse)
* users.
*/
- /*
- * TODO: Rework owner_parse to either return a char * pointing
- * to an error message or accept a function pointer to an
- * error-reporting routine so that the following tests don't
- * generate any output.
- *
- * Alternatively, redirect stderr temporarily to suppress the output.
- */
-
- assertEqualInt(1, owner_parse(":nonexistentgroup", &uid, &gid));
- assertEqualInt(1, owner_parse("root:nonexistentgroup", &uid, &gid));
- assertEqualInt(1,
+ assert(NULL != owner_parse(":nonexistentgroup", &uid, &gid));
+ assert(NULL != owner_parse(ROOT ":nonexistentgroup", &uid, &gid));
+ assert(NULL !=
owner_parse("nonexistentuser:nonexistentgroup", &uid, &gid));
+#endif
}
diff --git a/archivers/libarchive/files/cpio/test/test_passthrough_dotdot.c b/archivers/libarchive/files/cpio/test/test_passthrough_dotdot.c
new file mode 100644
index 00000000000..bb04341a4c7
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_passthrough_dotdot.c
@@ -0,0 +1,76 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_passthrough_dotdot.c,v 1.4 2008/08/24 06:21:00 kientzle Exp $");
+
+/*
+ * Verify that "cpio -p .." works.
+ */
+
+DEFINE_TEST(test_passthrough_dotdot)
+{
+ int r;
+ FILE *filelist;
+
+ assertUmask(0);
+
+ /*
+ * Create an assortment of files on disk.
+ */
+ filelist = fopen("filelist", "w");
+
+ /* Directory. */
+ assertMakeDir("dir", 0755);
+ assertChdir("dir");
+
+ fprintf(filelist, ".\n");
+
+ /* File with 10 bytes content. */
+ assertMakeFile("file", 0642, "1234567890");
+ fprintf(filelist, "file\n");
+
+ /* All done. */
+ fclose(filelist);
+
+
+ /*
+ * Use cpio passthrough mode to copy files to another directory.
+ */
+ r = systemf("%s -pdvm .. <../filelist >../stdout 2>../stderr",
+ testprog);
+ failure("Error invoking %s -pd ..", testprog);
+ assertEqualInt(r, 0);
+
+ assertChdir("..");
+
+ /* Verify stderr and stdout. */
+ assertTextFileContents("../.\n../file\n1 block\n", "stderr");
+ assertEmptyFile("stdout");
+
+ /* Regular file. */
+ assertIsReg("file", 0642);
+ assertFileSize("file", 10);
+ assertFileNLinks("file", 1);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_passthrough_reverse.c b/archivers/libarchive/files/cpio/test/test_passthrough_reverse.c
new file mode 100644
index 00000000000..674e52bc0a1
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_passthrough_reverse.c
@@ -0,0 +1,85 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_passthrough_reverse.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
+
+/*
+ * As reported by Bernd Walter: Some people are in the habit of
+ * using "find -d" to generate a list for cpio -p because that
+ * copies the top-level dir last, which preserves owner and mode
+ * information. That's not necessary for bsdcpio (libarchive defers
+ * restoring directory information), but bsdcpio should still generate
+ * the correct results with this usage.
+ */
+
+DEFINE_TEST(test_passthrough_reverse)
+{
+ int r;
+ FILE *filelist;
+
+ assertUmask(0);
+
+ /*
+ * Create an assortment of files on disk.
+ */
+ filelist = fopen("filelist", "w");
+
+ /* Directory. */
+ assertMakeDir("dir", 0743);
+
+ /* File with 10 bytes content. */
+ assertMakeFile("dir/file", 0644, "1234567890");
+ fprintf(filelist, "dir/file\n");
+
+ /* Write dir last. */
+ fprintf(filelist, "dir\n");
+
+ /* All done. */
+ fclose(filelist);
+
+
+ /*
+ * Use cpio passthrough mode to copy files to another directory.
+ */
+ r = systemf("%s -pdvm out <filelist >stdout 2>stderr", testprog);
+ failure("Error invoking %s -pd out", testprog);
+ assertEqualInt(r, 0);
+
+ assertChdir("out");
+
+ /* Verify stderr and stdout. */
+ assertTextFileContents("out/dir/file\nout/dir\n1 block\n",
+ "../stderr");
+ assertEmptyFile("../stdout");
+
+ /* dir */
+ assertIsDir("dir", 0743);
+
+
+ /* Regular file. */
+ assertIsReg("dir/file", 0644);
+ assertFileSize("dir/file", 10);
+ assertFileNLinks("dir/file", 1);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_pathmatch.c b/archivers/libarchive/files/cpio/test/test_pathmatch.c
index 83528c01ffb..177c2bcc4af 100644
--- a/archivers/libarchive/files/cpio/test/test_pathmatch.c
+++ b/archivers/libarchive/files/cpio/test/test_pathmatch.c
@@ -25,7 +25,7 @@
#include "test.h"
__FBSDID("$FreeBSD$");
-#include "../pathmatch.h"
+#include "pathmatch.h"
/*
* Verify that the pattern matcher implements the wildcard logic specified
@@ -38,128 +38,206 @@ __FBSDID("$FreeBSD$");
*
* The specification in SUSv2 is a bit incomplete, I assume the following:
* Trailing '-' in [...] is not special.
+ *
+ * TODO: Figure out if there's a good way to extend this to handle
+ * Windows paths that use '\' as a path separator. <sigh>
*/
DEFINE_TEST(test_pathmatch)
{
- assertEqualInt(1, pathmatch("*","", 0));
- assertEqualInt(1, pathmatch("*","a", 0));
- assertEqualInt(1, pathmatch("*","abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("a/b/c", "a/b/c", 0));
+ assertEqualInt(0, lafe_pathmatch("a/b/", "a/b/c", 0));
+ assertEqualInt(0, lafe_pathmatch("a/b", "a/b/c", 0));
+ assertEqualInt(0, lafe_pathmatch("a/b/c", "a/b/", 0));
+ assertEqualInt(0, lafe_pathmatch("a/b/c", "a/b", 0));
+
+ /* Empty pattern only matches empty string. */
+ assertEqualInt(1, lafe_pathmatch("","", 0));
+ assertEqualInt(0, lafe_pathmatch("","a", 0));
+ assertEqualInt(1, lafe_pathmatch("*","", 0));
+ assertEqualInt(1, lafe_pathmatch("*","a", 0));
+ assertEqualInt(1, lafe_pathmatch("*","abcd", 0));
/* SUSv2: * matches / */
- assertEqualInt(1, pathmatch("*","abcd/efgh/ijkl", 0));
- assertEqualInt(1, pathmatch("abcd*efgh/ijkl","abcd/efgh/ijkl", 0));
- assertEqualInt(1, pathmatch("abcd***efgh/ijkl","abcd/efgh/ijkl", 0));
- assertEqualInt(1, pathmatch("abcd***/efgh/ijkl","abcd/efgh/ijkl", 0));
- assertEqualInt(0, pathmatch("?", "", 0));
- assertEqualInt(0, pathmatch("?", "\0", 0));
- assertEqualInt(1, pathmatch("?", "a", 0));
- assertEqualInt(0, pathmatch("?", "ab", 0));
- assertEqualInt(1, pathmatch("?", ".", 0));
- assertEqualInt(1, pathmatch("?", "?", 0));
- assertEqualInt(1, pathmatch("a", "a", 0));
- assertEqualInt(0, pathmatch("a", "ab", 0));
- assertEqualInt(0, pathmatch("a", "ab", 0));
- assertEqualInt(1, pathmatch("a?c", "abc", 0));
+ assertEqualInt(1, lafe_pathmatch("*","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, lafe_pathmatch("abcd*efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, lafe_pathmatch("abcd***efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, lafe_pathmatch("abcd***/efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(0, lafe_pathmatch("?", "", 0));
+ assertEqualInt(0, lafe_pathmatch("?", "\0", 0));
+ assertEqualInt(1, lafe_pathmatch("?", "a", 0));
+ assertEqualInt(0, lafe_pathmatch("?", "ab", 0));
+ assertEqualInt(1, lafe_pathmatch("?", ".", 0));
+ assertEqualInt(1, lafe_pathmatch("?", "?", 0));
+ assertEqualInt(1, lafe_pathmatch("a", "a", 0));
+ assertEqualInt(0, lafe_pathmatch("a", "ab", 0));
+ assertEqualInt(0, lafe_pathmatch("a", "ab", 0));
+ assertEqualInt(1, lafe_pathmatch("a?c", "abc", 0));
/* SUSv2: ? matches / */
- assertEqualInt(1, pathmatch("a?c", "a/c", 0));
- assertEqualInt(1, pathmatch("a?*c*", "a/c", 0));
- assertEqualInt(1, pathmatch("*a*", "a/c", 0));
- assertEqualInt(1, pathmatch("*a*", "/a/c", 0));
- assertEqualInt(1, pathmatch("*a*", "defaaaaaaa", 0));
- assertEqualInt(0, pathmatch("a*", "defghi", 0));
- assertEqualInt(0, pathmatch("*a*", "defghi", 0));
- assertEqualInt(1, pathmatch("abc[def", "abc[def", 0));
- assertEqualInt(0, pathmatch("abc[def]", "abc[def", 0));
- assertEqualInt(0, pathmatch("abc[def", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[def]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[def]", "abce", 0));
- assertEqualInt(1, pathmatch("abc[def]", "abcf", 0));
- assertEqualInt(0, pathmatch("abc[def]", "abcg", 0));
- assertEqualInt(1, pathmatch("abc[d*f]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[d*f]", "abc*", 0));
- assertEqualInt(0, pathmatch("abc[d*f]", "abcdefghi", 0));
- assertEqualInt(0, pathmatch("abc[d*", "abcdefghi", 0));
- assertEqualInt(1, pathmatch("abc[d*", "abc[defghi", 0));
- assertEqualInt(1, pathmatch("abc[d-f]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[d-f]", "abce", 0));
- assertEqualInt(1, pathmatch("abc[d-f]", "abcf", 0));
- assertEqualInt(0, pathmatch("abc[d-f]", "abcg", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abce", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcf", 0));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcg", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abch", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abci", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcj", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abck", 0));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcl", 0));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abc-", 0));
+ assertEqualInt(1, lafe_pathmatch("a?c", "a/c", 0));
+ assertEqualInt(1, lafe_pathmatch("a?*c*", "a/c", 0));
+ assertEqualInt(1, lafe_pathmatch("*a*", "a/c", 0));
+ assertEqualInt(1, lafe_pathmatch("*a*", "/a/c", 0));
+ assertEqualInt(1, lafe_pathmatch("*a*", "defaaaaaaa", 0));
+ assertEqualInt(0, lafe_pathmatch("a*", "defghi", 0));
+ assertEqualInt(0, lafe_pathmatch("*a*", "defghi", 0));
+
+ /* Character classes */
+ assertEqualInt(1, lafe_pathmatch("abc[def", "abc[def", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[def]", "abc[def", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[def", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[def]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[def]", "abce", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[def]", "abcf", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[def]", "abcg", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d*f]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d*f]", "abc*", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d*f]", "abcdefghi", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d*", "abcdefghi", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d*", "abc[defghi", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-f]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-f]", "abce", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-f]", "abcf", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-f]", "abcg", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-fh-k]", "abca", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abce", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abcf", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-fh-k]", "abcg", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abch", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abci", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abcj", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-k]", "abck", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-fh-k]", "abcl", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-fh-k]", "abc-", 0));
+
+ /* [] matches nothing, [!] is the same as ? */
+ assertEqualInt(0, lafe_pathmatch("abc[]efg", "abcdefg", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[]efg", "abcqefg", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[]efg", "abcefg", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!]efg", "abcdefg", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!]efg", "abcqefg", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[!]efg", "abcefg", 0));
/* I assume: Trailing '-' is non-special. */
- assertEqualInt(0, pathmatch("abc[d-fh-]", "abcl", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abch", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-", 0));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d-fh-]", "abcl", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-]", "abch", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-]", "abc-", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-fh-]", "abc-", 0));
/* ']' can be backslash-quoted within a character class. */
- assertEqualInt(1, pathmatch("abc[\\]]", "abc]", 0));
- assertEqualInt(1, pathmatch("abc[\\]d]", "abc]", 0));
- assertEqualInt(1, pathmatch("abc[\\]d]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[d\\]]", "abc]", 0));
- assertEqualInt(1, pathmatch("abc[d\\]]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[d]e]", "abcde]", 0));
- assertEqualInt(1, pathmatch("abc[d\\]e]", "abc]", 0));
- assertEqualInt(0, pathmatch("abc[d\\]e]", "abcd]e", 0));
- assertEqualInt(0, pathmatch("abc[d]e]", "abc]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\]]", "abc]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\]d]", "abc]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\]d]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d\\]]", "abc]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d\\]]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d]e]", "abcde]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d\\]e]", "abc]", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d\\]e]", "abcd]e", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d]e]", "abc]", 0));
/* backslash-quoted chars can appear as either end of a range. */
- assertEqualInt(1, pathmatch("abc[\\d-f]gh", "abcegh", 0));
- assertEqualInt(0, pathmatch("abc[\\d-f]gh", "abcggh", 0));
- assertEqualInt(0, pathmatch("abc[\\d-f]gh", "abc\\gh", 0));
- assertEqualInt(1, pathmatch("abc[d-\\f]gh", "abcegh", 0));
- assertEqualInt(1, pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
- assertEqualInt(1, pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\d-f]gh", "abcegh", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[\\d-f]gh", "abcggh", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[\\d-f]gh", "abc\\gh", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d-\\f]gh", "abcegh", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
/* backslash-quoted '-' isn't special. */
- assertEqualInt(0, pathmatch("abc[d\\-f]gh", "abcegh", 0));
- assertEqualInt(1, pathmatch("abc[d\\-f]gh", "abc-gh", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[d\\-f]gh", "abcegh", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[d\\-f]gh", "abc-gh", 0));
/* Leading '!' negates a character class. */
- assertEqualInt(0, pathmatch("abc[!d]", "abcd", 0));
- assertEqualInt(1, pathmatch("abc[!d]", "abce", 0));
- assertEqualInt(1, pathmatch("abc[!d]", "abcc", 0));
- assertEqualInt(0, pathmatch("abc[!d-z]", "abcq", 0));
- assertEqualInt(1, pathmatch("abc[!d-gi-z]", "abch", 0));
- assertEqualInt(1, pathmatch("abc[!fgijkl]", "abch", 0));
- assertEqualInt(0, pathmatch("abc[!fghijkl]", "abch", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[!d]", "abcd", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!d]", "abce", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!d]", "abcc", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[!d-z]", "abcq", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!d-gi-z]", "abch", 0));
+ assertEqualInt(1, lafe_pathmatch("abc[!fgijkl]", "abch", 0));
+ assertEqualInt(0, lafe_pathmatch("abc[!fghijkl]", "abch", 0));
/* Backslash quotes next character. */
- assertEqualInt(0, pathmatch("abc\\[def]", "abc\\d", 0));
- assertEqualInt(1, pathmatch("abc\\[def]", "abc[def]", 0));
- assertEqualInt(0, pathmatch("abc\\\\[def]", "abc[def]", 0));
- assertEqualInt(0, pathmatch("abc\\\\[def]", "abc\\[def]", 0));
- assertEqualInt(1, pathmatch("abc\\\\[def]", "abc\\d", 0));
+ assertEqualInt(0, lafe_pathmatch("abc\\[def]", "abc\\d", 0));
+ assertEqualInt(1, lafe_pathmatch("abc\\[def]", "abc[def]", 0));
+ assertEqualInt(0, lafe_pathmatch("abc\\\\[def]", "abc[def]", 0));
+ assertEqualInt(0, lafe_pathmatch("abc\\\\[def]", "abc\\[def]", 0));
+ assertEqualInt(1, lafe_pathmatch("abc\\\\[def]", "abc\\d", 0));
+ assertEqualInt(1, lafe_pathmatch("abcd\\", "abcd\\", 0));
+ assertEqualInt(0, lafe_pathmatch("abcd\\", "abcd\\[", 0));
+ assertEqualInt(0, lafe_pathmatch("abcd\\", "abcde", 0));
+ assertEqualInt(0, lafe_pathmatch("abcd\\[", "abcd\\", 0));
/*
* Because '.' and '/' have special meanings, we can
* identify many equivalent paths even if they're expressed
- * differently.
+ * differently. (But quoting a character with '\\' suppresses
+ * special meanings!)
*/
- assertEqualInt(1, pathmatch("./abc/./def/", "abc/def/", 0));
- assertEqualInt(1, pathmatch("abc/def", "./././abc/./def", 0));
- assertEqualInt(1, pathmatch("abc/def/././//", "./././abc/./def/", 0));
- assertEqualInt(1, pathmatch(".////abc/.//def", "./././abc/./def", 0));
- assertEqualInt(1, pathmatch("./abc?def/", "abc/def/", 0));
+ assertEqualInt(0, lafe_pathmatch("a/b/", "a/bc", 0));
+ assertEqualInt(1, lafe_pathmatch("a/./b", "a/b", 0));
+ assertEqualInt(0, lafe_pathmatch("a\\/./b", "a/b", 0));
+ assertEqualInt(0, lafe_pathmatch("a/\\./b", "a/b", 0));
+ assertEqualInt(0, lafe_pathmatch("a/.\\/b", "a/b", 0));
+ assertEqualInt(0, lafe_pathmatch("a\\/\\.\\/b", "a/b", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def/", "abc/def/", 0));
+ assertEqualInt(1, lafe_pathmatch("abc/def", "./././abc/./def", 0));
+ assertEqualInt(1, lafe_pathmatch("abc/def/././//", "./././abc/./def/", 0));
+ assertEqualInt(1, lafe_pathmatch(".////abc/.//def", "./././abc/./def", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc?def/", "abc/def/", 0));
failure("\"?./\" is not the same as \"/./\"");
- assertEqualInt(0, pathmatch("./abc?./def/", "abc/def/", 0));
+ assertEqualInt(0, lafe_pathmatch("./abc?./def/", "abc/def/", 0));
failure("Trailing '/' should match no trailing '/'");
- assertEqualInt(1, pathmatch("./abc/./def/", "abc/def", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def/", "abc/def", 0));
failure("Trailing '/./' is still the same directory.");
- assertEqualInt(1, pathmatch("./abc/./def/./", "abc/def", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def/./", "abc/def", 0));
failure("Trailing '/.' is still the same directory.");
- assertEqualInt(1, pathmatch("./abc/./def/.", "abc/def", 0));
- assertEqualInt(1, pathmatch("./abc/./def", "abc/def/", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def/.", "abc/def", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def", "abc/def/", 0));
failure("Trailing '/./' is still the same directory.");
- assertEqualInt(1, pathmatch("./abc/./def", "abc/def/./", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc/./def", "abc/def/./", 0));
failure("Trailing '/.' is still the same directory.");
- assertEqualInt(1, pathmatch("./abc*/./def", "abc/def/.", 0));
+ assertEqualInt(1, lafe_pathmatch("./abc*/./def", "abc/def/.", 0));
+
+ /* Matches not anchored at beginning. */
+ assertEqualInt(0,
+ lafe_pathmatch("bcd", "abcd", PATHMATCH_NO_ANCHOR_START));
+ assertEqualInt(1,
+ lafe_pathmatch("abcd", "abcd", PATHMATCH_NO_ANCHOR_START));
+ assertEqualInt(0,
+ lafe_pathmatch("^bcd", "abcd", PATHMATCH_NO_ANCHOR_START));
+ assertEqualInt(1,
+ lafe_pathmatch("b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
+ assertEqualInt(0,
+ lafe_pathmatch("b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
+ assertEqualInt(0,
+ lafe_pathmatch("^b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
+
+ /* Matches not anchored at end. */
+ assertEqualInt(0,
+ lafe_pathmatch("bcd", "abcd", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("abcd", "abcd", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("abcd", "abcd/", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("abcd", "abcd/.", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(0,
+ lafe_pathmatch("abc", "abcd", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(0,
+ lafe_pathmatch("a/b/c$", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c$", "a/b/c", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c$", "a/b/c/", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c/", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(0,
+ lafe_pathmatch("a/b/c/$", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c/$", "a/b/c/", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(1,
+ lafe_pathmatch("a/b/c/$", "a/b/c", PATHMATCH_NO_ANCHOR_END));
+ assertEqualInt(0,
+ lafe_pathmatch("b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
}
diff --git a/archivers/libarchive/files/doc/html/Makefile b/archivers/libarchive/files/doc/html/Makefile
new file mode 100644
index 00000000000..dcab40e5129
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/Makefile
@@ -0,0 +1,46 @@
+
+default: all
+
+
+archive_entry.3.html: ../mdoc2man.awk ../../libarchive/archive_entry.3
+ groff -mdoc -T html ../../libarchive/archive_entry.3 > archive_entry.3.html
+
+archive_read.3.html: ../mdoc2man.awk ../../libarchive/archive_read.3
+ groff -mdoc -T html ../../libarchive/archive_read.3 > archive_read.3.html
+
+archive_read_disk.3.html: ../mdoc2man.awk ../../libarchive/archive_read_disk.3
+ groff -mdoc -T html ../../libarchive/archive_read_disk.3 > archive_read_disk.3.html
+
+archive_util.3.html: ../mdoc2man.awk ../../libarchive/archive_util.3
+ groff -mdoc -T html ../../libarchive/archive_util.3 > archive_util.3.html
+
+archive_write.3.html: ../mdoc2man.awk ../../libarchive/archive_write.3
+ groff -mdoc -T html ../../libarchive/archive_write.3 > archive_write.3.html
+
+archive_write_disk.3.html: ../mdoc2man.awk ../../libarchive/archive_write_disk.3
+ groff -mdoc -T html ../../libarchive/archive_write_disk.3 > archive_write_disk.3.html
+
+cpio.5.html: ../mdoc2man.awk ../../libarchive/cpio.5
+ groff -mdoc -T html ../../libarchive/cpio.5 > cpio.5.html
+
+libarchive-formats.5.html: ../mdoc2man.awk ../../libarchive/libarchive-formats.5
+ groff -mdoc -T html ../../libarchive/libarchive-formats.5 > libarchive-formats.5.html
+
+libarchive.3.html: ../mdoc2man.awk ../../libarchive/libarchive.3
+ groff -mdoc -T html ../../libarchive/libarchive.3 > libarchive.3.html
+
+libarchive_internals.3.html: ../mdoc2man.awk ../../libarchive/libarchive_internals.3
+ groff -mdoc -T html ../../libarchive/libarchive_internals.3 > libarchive_internals.3.html
+
+mtree.5.html: ../mdoc2man.awk ../../libarchive/mtree.5
+ groff -mdoc -T html ../../libarchive/mtree.5 > mtree.5.html
+
+tar.5.html: ../mdoc2man.awk ../../libarchive/tar.5
+ groff -mdoc -T html ../../libarchive/tar.5 > tar.5.html
+
+bsdtar.1.html: ../mdoc2man.awk ../../tar/bsdtar.1
+ groff -mdoc -T html ../../tar/bsdtar.1 > bsdtar.1.html
+
+bsdcpio.1.html: ../mdoc2man.awk ../../cpio/bsdcpio.1
+ groff -mdoc -T html ../../cpio/bsdcpio.1 > bsdcpio.1.html
+all: archive_entry.3.html archive_read.3.html archive_read_disk.3.html archive_util.3.html archive_write.3.html archive_write_disk.3.html cpio.5.html libarchive-formats.5.html libarchive.3.html libarchive_internals.3.html mtree.5.html tar.5.html bsdtar.1.html bsdcpio.1.html
diff --git a/archivers/libarchive/files/doc/html/archive_entry.3.html b/archivers/libarchive/files/doc/html/archive_entry.3.html
new file mode 100644
index 00000000000..7b30d7261d2
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_entry.3.html
@@ -0,0 +1,694 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:29 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_entry(3) FreeBSD Library Functions
+Manual archive_entry(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+
+<p style="margin-left:8%;"><b>archive_entry_acl_add_entry</b>,
+<b>archive_entry_acl_add_entry_w</b>,
+<b>archive_entry_acl_clear</b>,
+<b>archive_entry_acl_count</b>,
+<b>archive_entry_acl_next</b>,
+<b>archive_entry_acl_next_w</b>,
+<b>archive_entry_acl_reset</b>,
+<b>archive_entry_acl_text_w</b>, <b>archive_entry_atime</b>,
+<b>archive_entry_atime_nsec</b>, <b>archive_entry_clear</b>,
+<b>archive_entry_clone</b>,
+<b>archive_entry_copy_fflags_text</b>,
+<b>archive_entry_copy_fflags_text_w</b>,
+<b>archive_entry_copy_gname</b>,
+<b>archive_entry_copy_gname_w</b>,
+<b>archive_entry_copy_hardlink</b>,
+<b>archive_entry_copy_hardlink_w</b>,
+<b>archive_entry_copy_link</b>,
+<b>archive_entry_copy_link_w</b>,
+<b>archive_entry_copy_pathname_w</b>,
+<b>archive_entry_copy_sourcepath</b>,
+<b>archive_entry_copy_stat</b>,
+<b>archive_entry_copy_symlink</b>,
+<b>archive_entry_copy_symlink_w</b>,
+<b>archive_entry_copy_uname</b>,
+<b>archive_entry_copy_uname_w</b>, <b>archive_entry_dev</b>,
+<b>archive_entry_devmajor</b>,
+<b>archive_entry_devminor</b>,
+<b>archive_entry_filetype</b>, <b>archive_entry_fflags</b>,
+<b>archive_entry_fflags_text</b>, <b>archive_entry_free</b>,
+<b>archive_entry_gid</b>, <b>archive_entry_gname</b>,
+<b>archive_entry_hardlink</b>, <b>archive_entry_ino</b>,
+<b>archive_entry_mode</b>, <b>archive_entry_mtime</b>,
+<b>archive_entry_mtime_nsec</b>, <b>archive_entry_nlink</b>,
+<b>archive_entry_new</b>, <b>archive_entry_pathname</b>,
+<b>archive_entry_pathname_w</b>, <b>archive_entry_rdev</b>,
+<b>archive_entry_rdevmajor</b>,
+<b>archive_entry_rdevminor</b>,
+<b>archive_entry_set_atime</b>,
+<b>archive_entry_set_ctime</b>,
+<b>archive_entry_set_dev</b>,
+<b>archive_entry_set_devmajor</b>,
+<b>archive_entry_set_devminor</b>,
+<b>archive_entry_set_filetype</b>,
+<b>archive_entry_set_fflags</b>,
+<b>archive_entry_set_gid</b>,
+<b>archive_entry_set_gname</b>,
+<b>archive_entry_set_hardlink</b>,
+<b>archive_entry_set_link</b>,
+<b>archive_entry_set_mode</b>,
+<b>archive_entry_set_mtime</b>,
+<b>archive_entry_set_pathname</b>,
+<b>archive_entry_set_rdevmajor</b>,
+<b>archive_entry_set_rdevminor</b>,
+<b>archive_entry_set_size</b>,
+<b>archive_entry_set_symlink</b>,
+<b>archive_entry_set_uid</b>,
+<b>archive_entry_set_uname</b>, <b>archive_entry_size</b>,
+<b>archive_entry_sourcepath</b>, <b>archive_entry_stat</b>,
+<b>archive_entry_symlink</b>, <b>archive_entry_uid</b>,
+<b>archive_entry_uname</b> &mdash; functions for
+manipulating archive entry descriptions</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive_entry.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_entry_acl_add_entry</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;type</i>, <i>int&nbsp;permset</i>,
+<i>int&nbsp;tag</i>, <i>int&nbsp;qual</i>,
+<i>const&nbsp;char&nbsp;*name</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_entry_acl_add_entry_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;type</i>, <i>int&nbsp;permset</i>,
+<i>int&nbsp;tag</i>, <i>int&nbsp;qual</i>,
+<i>const&nbsp;wchar_t&nbsp;*name</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_acl_clear</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_acl_count</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;type</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_entry_acl_next</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;want_type</i>, <i>int&nbsp;*type</i>,
+<i>int&nbsp;*permset</i>, <i>int&nbsp;*tag</i>,
+<i>int&nbsp;*qual</i>,
+<i>const&nbsp;char&nbsp;**name</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_entry_acl_next_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;want_type</i>, <i>int&nbsp;*type</i>,
+<i>int&nbsp;*permset</i>, <i>int&nbsp;*tag</i>,
+<i>int&nbsp;*qual</i>,
+<i>const&nbsp;wchar_t&nbsp;**name</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_acl_reset</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;want_type</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const wchar_t
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_acl_text_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;flags</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>time_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_atime</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>long</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_atime_nsec</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive_entry *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_clear</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive_entry *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_clone</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char *
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_fflags_text_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const wchar_t
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_fflags_text_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_gname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_gname_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_hardlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_hardlink_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_sourcepath</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_pathname_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_stat</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;struct&nbsp;stat&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_symlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_symlink_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_uname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_copy_uname_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;wchar_t&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_dev</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_devmajor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_devminor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>mode_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_filetype</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_entry_fflags</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>unsigned&nbsp;long&nbsp;*set</i>,
+<i>unsigned&nbsp;long&nbsp;*clear</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_fflags_text</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_free</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_gname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_hardlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>ino_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_ino</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>mode_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_mode</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>time_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_mtime</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>long</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_mtime_nsec</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>unsigned
+int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_nlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive_entry *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_new</b>(<i>void</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_pathname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const wchar_t
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_pathname_w</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_rdev</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_rdevmajor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>dev_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_rdevminor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_dev</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_devmajor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_devminor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_filetype</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>unsigned&nbsp;int</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_entry_set_fflags</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>unsigned&nbsp;long&nbsp;set</i>,
+<i>unsigned&nbsp;long&nbsp;clear</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_gid</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>gid_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_gname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_hardlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_ino</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>unsigned&nbsp;long</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_link</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_mode</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>mode_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_mtime</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>time_t</i>, <i>long&nbsp;nanos</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_nlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>unsigned&nbsp;int</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_pathname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_rdev</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_rdevmajor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_rdevminor</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>dev_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_size</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int64_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_symlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_uid</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>uid_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_set_uname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>int64_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_size</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_sourcepath</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const struct
+stat *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_stat</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_symlink</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_entry_uname</b>(<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions create and
+manipulate data objects that represent entries within an
+archive. You can think of a struct archive_entry as a
+heavy-duty version of struct stat: it includes everything
+from struct stat plus associated pathname, textual group and
+user names, etc. These objects are used by libarchive(3) to
+represent the metadata associated with a particular entry in
+an archive.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Create and
+Destroy</b> <br>
+There are functions to allocate, destroy, clear, and copy
+<i>archive_entry</i> objects:</p>
+
+<p valign="top"><b>archive_entry_clear</b>()</p>
+
+<p style="margin-left:20%;">Erases the object, resetting
+all internal fields to the same state as a newly-created
+object. This is provided to allow you to quickly recycle
+objects without thrashing the heap.</p>
+
+<p valign="top"><b>archive_entry_clone</b>()</p>
+
+<p style="margin-left:20%;">A deep copy operation; all text
+fields are duplicated.</p>
+
+<p valign="top"><b>archive_entry_free</b>()</p>
+
+<p style="margin-left:20%;">Releases the struct
+archive_entry object.</p>
+
+<p valign="top"><b>archive_entry_new</b>()</p>
+
+<p style="margin-left:20%;">Allocate and return a blank
+struct archive_entry object.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Set and Get
+Functions</b> <br>
+Most of the functions here set or read entries in an object.
+Such functions have one of the following forms:</p>
+
+<p valign="top"><b>archive_entry_set_XXXX</b>()</p>
+
+<p style="margin-left:20%;">Stores the provided data in the
+object. In particular, for strings, the pointer is stored,
+not the referenced string.</p>
+
+<p valign="top"><b>archive_entry_copy_XXXX</b>()</p>
+
+<p style="margin-left:20%;">As above, except that the
+referenced data is copied into the object.</p>
+
+<p valign="top"><b>archive_entry_XXXX</b>()</p>
+
+<p style="margin-left:20%;">Returns the specified data. In
+the case of strings, a const-qualified pointer to the string
+is returned.</p>
+
+<p style="margin-left:8%;">String data can be set or
+accessed as wide character strings or normal <i>char</i>
+strings. The functions that use wide character strings are
+suffixed with <b>_w</b>. Note that these are different
+representations of the same data: For example, if you store
+a narrow string and read the corresponding wide string, the
+object will transparently convert formats using the current
+locale. Similarly, if you store a wide string and then store
+a narrow string for the same data, the previously-set wide
+string will be discarded in favor of the new data.</p>
+
+<p style="margin-left:8%; margin-top: 1em">There are a few
+set/get functions that merit additional description:</p>
+
+<p valign="top"><b>archive_entry_set_link</b>()</p>
+
+<p style="margin-left:20%;">This function sets the symlink
+field if it is already set. Otherwise, it sets the hardlink
+field.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>File
+Flags</b> <br>
+File flags are transparently converted between a bitmap
+representation and a textual format. For example, if you set
+the bitmap and ask for text, the library will build a
+canonical text format. However, if you set a text format and
+request a text format, you will get back the same text, even
+if it is ill-formed. If you need to canonicalize a textual
+flags string, you should first set the text form, then
+request the bitmap form, then use that to set the bitmap
+form. Setting the bitmap format will clear the internal text
+representation and force it to be reconstructed when you
+next request the text form.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The bitmap
+format consists of two integers, one containing bits that
+should be set, the other specifying bits that should be
+cleared. Bits not mentioned in either bitmap will be
+ignored. Usually, the bitmap of bits to be cleared will be
+set to zero. In unusual circumstances, you can force a
+fully-specified set of file flags by setting the bitmap of
+flags to clear to the complement of the bitmap of flags to
+set. (This differs from fflagstostr(3), which only includes
+names for set bits.) Converting a bitmap to a textual string
+is a platform-specific operation; bits that are not
+meaningful on the current platform will be ignored.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The canonical
+text format is a comma-separated list of flag names. The
+<b>archive_entry_copy_fflags_text</b>() and
+<b>archive_entry_copy_fflags_text_w</b>() functions parse
+the provided text and sets the internal bitmap values. This
+is a platform-specific operation; names that are not
+meaningful on the current platform will be ignored. The
+function returns a pointer to the start of the first name
+that was not recognized, or NULL if every name was
+recognized. Note that every name--including names that
+follow an unrecognized name--will be evaluated, and the
+bitmaps will be set to reflect every name that is
+recognized. (In particular, this differs from
+strtofflags(3), which stops parsing at the first
+unrecognized name.)</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>ACL
+Handling</b> <br>
+XXX This needs serious help. XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em">An
+&lsquo;&lsquo;Access Control List&rsquo;&rsquo; (ACL) is a
+list of permissions that grant access to particular users or
+groups beyond what would normally be provided by standard
+POSIX mode bits. The ACL handling here addresses some
+deficiencies in the POSIX.1e draft 17 ACL specification. In
+particular, POSIX.1e draft 17 specifies several different
+formats, but none of those formats include both textual
+user/group names and numeric UIDs/GIDs.</p>
+
+<p style="margin-left:8%; margin-top: 1em">XXX explain ACL
+stuff XXX</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">archive(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+May&nbsp;12, 2008 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/archive_read.3.html b/archivers/libarchive/files/doc/html/archive_read.3.html
new file mode 100644
index 00000000000..c37fcac189f
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_read.3.html
@@ -0,0 +1,820 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:31 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_read(3) FreeBSD Library Functions
+Manual archive_read(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>archive_read_new</b>,
+<b>archive_read_set_filter_options</b>,
+<b>archive_read_set_format_options</b>,
+<b>archive_read_set_options</b>,
+<b>archive_read_support_compression_all</b>,
+<b>archive_read_support_compression_bzip2</b>,
+<b>archive_read_support_compression_compress</b>,
+<b>archive_read_support_compression_gzip</b>,
+<b>archive_read_support_compression_lzma</b>,
+<b>archive_read_support_compression_none</b>,
+<b>archive_read_support_compression_xz</b>,
+<b>archive_read_support_compression_program</b>,
+<b>archive_read_support_compression_program_signature</b>,
+<b>archive_read_support_format_all</b>,
+<b>archive_read_support_format_ar</b>,
+<b>archive_read_support_format_cpio</b>,
+<b>archive_read_support_format_empty</b>,
+<b>archive_read_support_format_iso9660</b>,
+<b>archive_read_support_format_mtree,
+archive_read_support_format_raw,
+archive_read_support_format_tar</b>,
+<b>archive_read_support_format_zip</b>,
+<b>archive_read_open</b>, <b>archive_read_open2</b>,
+<b>archive_read_open_fd</b>, <b>archive_read_open_FILE</b>,
+<b>archive_read_open_filename</b>,
+<b>archive_read_open_memory</b>,
+<b>archive_read_next_header</b>,
+<b>archive_read_next_header2</b>, <b>archive_read_data</b>,
+<b>archive_read_data_block</b>,
+<b>archive_read_data_skip</b>,
+<b>archive_read_data_into_buffer</b>,
+<b>archive_read_data_into_fd</b>,
+<b>archive_read_extract</b>, <b>archive_read_extract2</b>,
+<b>archive_read_extract_set_progress_callback</b>,
+<b>archive_read_close</b>, <b>archive_read_finish</b>
+&mdash; functions for reading streaming archives</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_new</b>(<i>void</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_bzip2</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_compress</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_gzip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_lzma</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_none</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_compression_xz</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_support_compression_program</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*cmd</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_support_compression_program_signature</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*cmd</i>,
+<i>const&nbsp;void&nbsp;*signature</i>,
+<i>size_t&nbsp;signature_length</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_ar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_cpio</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_empty</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_iso9660</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_mtree</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_raw</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_tar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_support_format_zip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_set_filter_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_set_format_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_set_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_open</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>archive_open_callback&nbsp;*</i>,
+<i>archive_read_callback&nbsp;*</i>,
+<i>archive_close_callback&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_open2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>archive_open_callback&nbsp;*</i>,
+<i>archive_read_callback&nbsp;*</i>,
+<i>archive_skip_callback&nbsp;*</i>,
+<i>archive_close_callback&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_open_FILE</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>FILE&nbsp;*file</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_open_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;fd</i>, <i>size_t&nbsp;block_size</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_open_filename</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*filename</i>,
+<i>size_t&nbsp;block_size</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_open_memory</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*buff</i>, <i>size_t&nbsp;size</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_next_header</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;**</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_next_header2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>ssize_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*buff</i>, <i>size_t&nbsp;len</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_data_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;void&nbsp;**buff</i>, <i>size_t&nbsp;*len</i>,
+<i>off_t&nbsp;*offset</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_data_skip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_data_into_buffer</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*</i>, <i>ssize_t&nbsp;len</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_data_into_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;fd</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_extract</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>int&nbsp;flags</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_extract2</b>(<i>struct&nbsp;archive&nbsp;*src</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>,
+<i>struct&nbsp;archive&nbsp;*dest</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_read_extract_set_progress_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;(*func)(void&nbsp;*)</i>,
+<i>void&nbsp;*user_data</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions provide a
+complete API for reading streaming archives. The general
+process is to first create the struct archive object, set
+options, initialize the reader, iterate over the archive
+headers and associated data, then close the archive and
+release all resources. The following summary describes the
+functions in approximately the order they would be used:</p>
+
+<p valign="top"><b>archive_read_new</b>()</p>
+
+<p style="margin-left:20%;">Allocates and initializes a
+struct archive object suitable for reading from an
+archive.</p>
+
+
+<p valign="top"><b>archive_read_support_compression_bzip2</b>(),
+<b>archive_read_support_compression_compress</b>(),
+<b>archive_read_support_compression_gzip</b>(),
+<b>archive_read_support_compression_lzma</b>(),
+<b>archive_read_support_compression_none</b>(),
+<b>archive_read_support_compression_xz</b>()</p>
+
+<p style="margin-left:20%;">Enables auto-detection code and
+decompression support for the specified compression. Returns
+<b>ARCHIVE_OK</b> if the compression is fully supported, or
+<b>ARCHIVE_WARN</b> if the compression is supported only
+through an external program. Note that decompression using
+an external program is usually slower than decompression
+through built-in libraries. Note that
+&lsquo;&lsquo;none&rsquo;&rsquo; is always enabled by
+default.</p>
+
+
+<p valign="top"><b>archive_read_support_compression_all</b>()</p>
+
+<p style="margin-left:20%;">Enables all available
+decompression filters.</p>
+
+
+<p valign="top"><b>archive_read_support_compression_program</b>()</p>
+
+<p style="margin-left:20%;">Data is fed through the
+specified external program before being dearchived. Note
+that this disables automatic detection of the compression
+format, so it makes no sense to specify this in conjunction
+with any other decompression option.</p>
+
+
+<p valign="top"><b>archive_read_support_compression_program_signature</b>()</p>
+
+<p style="margin-left:20%;">This feeds data through the
+specified external program but only if the initial bytes of
+the data match the specified signature value.</p>
+
+<p valign="top"><b>archive_read_support_format_all</b>(),
+<b>archive_read_support_format_ar</b>(),
+<b>archive_read_support_format_cpio</b>(),
+<b>archive_read_support_format_empty</b>(),
+<b>archive_read_support_format_iso9660</b>(),
+<b>archive_read_support_format_mtree</b>(),
+<b>archive_read_support_format_tar</b>(),
+<b>archive_read_support_format_zip</b>()</p>
+
+<p style="margin-left:20%;">Enables support---including
+auto-detection code---for the specified archive format. For
+example, <b>archive_read_support_format_tar</b>() enables
+support for a variety of standard tar formats, old-style
+tar, ustar, pax interchange format, and many common
+variants. For convenience,
+<b>archive_read_support_format_all</b>() enables support for
+all available formats. Only empty archives are supported by
+default.</p>
+
+
+<p valign="top"><b>archive_read_support_format_raw</b>()</p>
+
+<p style="margin-left:20%;">The
+&lsquo;&lsquo;raw&rsquo;&rsquo; format handler allows
+libarchive to be used to read arbitrary data. It treats any
+data stream as an archive with a single entry. The pathname
+of this entry is &lsquo;&lsquo;data&rsquo;&rsquo;; all other
+entry fields are unset. This is not enabled by
+<b>archive_read_support_format_all</b>() in order to avoid
+erroneous handling of damaged archives.</p>
+
+<p valign="top"><b>archive_read_set_filter_options</b>(),
+<b>archive_read_set_format_options</b>(),
+<b>archive_read_set_options</b>()</p>
+
+<p style="margin-left:20%;">Specifies options that will be
+passed to currently-registered filters (including
+decompression filters) and/or format readers. The argument
+is a comma-separated list of individual options. Individual
+options have one of the following forms:</p>
+
+<p valign="top"><i>option=value</i></p>
+
+<p style="margin-left:32%;">The option/value pair will be
+provided to every module. Modules that do not accept an
+option with this name will ignore it.</p>
+
+<p valign="top"><i>option</i></p>
+
+<p style="margin-left:32%; margin-top: 1em">The option will
+be provided to every module with a value of
+&lsquo;&lsquo;1&rsquo;&rsquo;.</p>
+
+<p valign="top"><i>!option</i></p>
+
+<p style="margin-left:32%;">The option will be provided to
+every module with a NULL value.</p>
+
+<p valign="top"><i>module:option=value</i>,
+<i>module:option</i>, <i>module:!option</i></p>
+
+<p style="margin-left:32%;">As above, but the corresponding
+option and value will be provided only to modules whose name
+matches <i>module</i>.</p>
+
+<p style="margin-left:20%;">The return value will be
+<b>ARCHIVE_OK</b> if any module accepts the option, or
+<b>ARCHIVE_WARN</b> if no module accepted the option, or
+<b>ARCHIVE_FATAL</b> if there was a fatal error while
+attempting to process the option.</p>
+
+<p style="margin-left:20%; margin-top: 1em">The currently
+supported options are:</p>
+
+<p valign="top">Format iso9660 <b><br>
+joliet</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">Support Joliet
+extensions. Defaults to enabled, use <b>!joliet</b> to
+disable.</p>
+
+<p valign="top"><b>archive_read_open</b>()</p>
+
+<p style="margin-left:20%;">The same as
+<b>archive_read_open2</b>(), except that the skip callback
+is assumed to be NULL.</p>
+
+<p valign="top"><b>archive_read_open2</b>()</p>
+
+<p style="margin-left:20%;">Freeze the settings, open the
+archive, and prepare for reading entries. This is the most
+generic version of this call, which accepts four callback
+functions. Most clients will want to use
+<b>archive_read_open_filename</b>(),
+<b>archive_read_open_FILE</b>(),
+<b>archive_read_open_fd</b>(), or
+<b>archive_read_open_memory</b>() instead. The library
+invokes the client-provided functions to obtain raw bytes
+from the archive.</p>
+
+<p valign="top"><b>archive_read_open_FILE</b>()</p>
+
+<p style="margin-left:20%;">Like
+<b>archive_read_open</b>(), except that it accepts a <i>FILE
+*</i> pointer. This function should not be used with tape
+drives or other devices that require strict I/O
+blocking.</p>
+
+<p valign="top"><b>archive_read_open_fd</b>()</p>
+
+<p style="margin-left:20%;">Like
+<b>archive_read_open</b>(), except that it accepts a file
+descriptor and block size rather than a set of function
+pointers. Note that the file descriptor will not be
+automatically closed at end-of-archive. This function is
+safe for use with tape drives or other blocked devices.</p>
+
+<p valign="top"><b>archive_read_open_file</b>()</p>
+
+<p style="margin-left:20%;">This is a deprecated synonym
+for <b>archive_read_open_filename</b>().</p>
+
+<p valign="top"><b>archive_read_open_filename</b>()</p>
+
+<p style="margin-left:20%;">Like
+<b>archive_read_open</b>(), except that it accepts a simple
+filename and a block size. A NULL filename represents
+standard input. This function is safe for use with tape
+drives or other blocked devices.</p>
+
+<p valign="top"><b>archive_read_open_memory</b>()</p>
+
+<p style="margin-left:20%;">Like
+<b>archive_read_open</b>(), except that it accepts a pointer
+and size of a block of memory containing the archive
+data.</p>
+
+<p valign="top"><b>archive_read_next_header</b>()</p>
+
+<p style="margin-left:20%;">Read the header for the next
+entry and return a pointer to a struct archive_entry. This
+is a convenience wrapper around
+<b>archive_read_next_header2</b>() that reuses an internal
+struct archive_entry object for each request.</p>
+
+<p valign="top"><b>archive_read_next_header2</b>()</p>
+
+<p style="margin-left:20%;">Read the header for the next
+entry and populate the provided struct archive_entry.</p>
+
+<p valign="top"><b>archive_read_data</b>()</p>
+
+<p style="margin-left:20%;">Read data associated with the
+header just read. Internally, this is a convenience function
+that calls <b>archive_read_data_block</b>() and fills any
+gaps with nulls so that callers see a single continuous
+stream of data.</p>
+
+<p valign="top"><b>archive_read_data_block</b>()</p>
+
+<p style="margin-left:20%;">Return the next available block
+of data for this entry. Unlike <b>archive_read_data</b>(),
+the <b>archive_read_data_block</b>() function avoids copying
+data and allows you to correctly handle sparse files, as
+supported by some archive formats. The library guarantees
+that offsets will increase and that blocks will not overlap.
+Note that the blocks returned from this function can be much
+larger than the block size read from disk, due to
+compression and internal buffer optimizations.</p>
+
+<p valign="top"><b>archive_read_data_skip</b>()</p>
+
+<p style="margin-left:20%;">A convenience function that
+repeatedly calls <b>archive_read_data_block</b>() to skip
+all of the data for this archive entry.</p>
+
+<p valign="top"><b>archive_read_data_into_buffer</b>()</p>
+
+<p style="margin-left:20%;">This function is deprecated and
+will be removed. Use <b>archive_read_data</b>() instead.</p>
+
+<p valign="top"><b>archive_read_data_into_fd</b>()</p>
+
+<p style="margin-left:20%;">A convenience function that
+repeatedly calls <b>archive_read_data_block</b>() to copy
+the entire entry to the provided file descriptor.</p>
+
+<p valign="top"><b>archive_read_extract</b>(),
+<b>archive_read_extract_set_skip_file</b>()</p>
+
+<p style="margin-left:20%;">A convenience function that
+wraps the corresponding archive_write_disk(3) interfaces.
+The first call to <b>archive_read_extract</b>() creates a
+restore object using archive_write_disk_new(3) and
+archive_write_disk_set_standard_lookup(3), then
+transparently invokes archive_write_disk_set_options(3),
+archive_write_header(3), archive_write_data(3), and
+archive_write_finish_entry(3) to create the entry on disk
+and copy data into it. The <i>flags</i> argument is passed
+unmodified to archive_write_disk_set_options(3).</p>
+
+<p valign="top"><b>archive_read_extract2</b>()</p>
+
+<p style="margin-left:20%;">This is another version of
+<b>archive_read_extract</b>() that allows you to provide
+your own restore object. In particular, this allows you to
+override the standard lookup functions using
+archive_write_disk_set_group_lookup(3), and
+archive_write_disk_set_user_lookup(3). Note that
+<b>archive_read_extract2</b>() does not accept a
+<i>flags</i> argument; you should use
+<b>archive_write_disk_set_options</b>() to set the restore
+options yourself.</p>
+
+
+<p valign="top"><b>archive_read_extract_set_progress_callback</b>()</p>
+
+<p style="margin-left:20%;">Sets a pointer to a
+user-defined callback that can be used for updating progress
+displays during extraction. The progress function will be
+invoked during the extraction of large regular files. The
+progress function will be invoked with the pointer provided
+to this call. Generally, the data pointed to should include
+a reference to the archive object and the archive_entry
+object so that various statistics can be retrieved for the
+progress display.</p>
+
+<p valign="top"><b>archive_read_close</b>()</p>
+
+<p style="margin-left:20%;">Complete the archive and invoke
+the close callback.</p>
+
+<p valign="top"><b>archive_read_finish</b>()</p>
+
+<p style="margin-left:20%;">Invokes
+<b>archive_read_close</b>() if it was not invoked manually,
+then release all resources. Note: In libarchive 1.x, this
+function was declared to return <i>void</i>, which made it
+impossible to detect certain errors when
+<b>archive_read_close</b>() was invoked implicitly from this
+function. The declaration is corrected beginning with
+libarchive 2.0.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Note that the
+library determines most of the relevant information about
+the archive by inspection. In particular, it automatically
+detects gzip(1) or bzip2(1) compression and transparently
+performs the appropriate decompression. It also
+automatically detects the archive format.</p>
+
+<p style="margin-left:8%; margin-top: 1em">A complete
+description of the struct archive and struct archive_entry
+objects can be found in the overview manual page for
+libarchive(3).</p>
+
+<p style="margin-top: 1em" valign="top"><b>CLIENT
+CALLBACKS</b></p>
+
+<p style="margin-left:8%;">The callback functions must
+match the following prototypes:</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+ssize_t</i></p>
+
+
+<p valign="top"><b>archive_read_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>const&nbsp;void&nbsp;**buffer</i>)</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+int</i></p>
+
+
+<p valign="top"><b>archive_skip_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>size_t&nbsp;request</i>)</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+int</i> <b>archive_open_callback</b>(<i>struct archive
+*</i>, <i>void *client_data</i>)</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+int</i> <b>archive_close_callback</b>(<i>struct archive
+*</i>, <i>void *client_data</i>)</p>
+
+<p style="margin-left:8%; margin-top: 1em">The open
+callback is invoked by <b>archive_open</b>(). It should
+return <b>ARCHIVE_OK</b> if the underlying file or data
+source is successfully opened. If the open fails, it should
+call <b>archive_set_error</b>() to register an error code
+and message and return <b>ARCHIVE_FATAL</b>.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The read
+callback is invoked whenever the library requires raw bytes
+from the archive. The read callback should read data into a
+buffer, set the const void **buffer argument to point to the
+available data, and return a count of the number of bytes
+available. The library will invoke the read callback again
+only after it has consumed this data. The library imposes no
+constraints on the size of the data blocks returned. On
+end-of-file, the read callback should return zero. On error,
+the read callback should invoke <b>archive_set_error</b>()
+to register an error code and message and return -1.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The skip
+callback is invoked when the library wants to ignore a block
+of data. The return value is the number of bytes actually
+skipped, which may differ from the request. If the callback
+cannot skip data, it should return zero. If the skip
+callback is not provided (the function pointer is NULL ),
+the library will invoke the read function instead and simply
+discard the result. A skip callback can provide significant
+performance gains when reading uncompressed archives from
+slow disk drives or other media that can skip quickly.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The close
+callback is invoked by archive_close when the archive
+processing is complete. The callback should return
+<b>ARCHIVE_OK</b> on success. On failure, the callback
+should invoke <b>archive_set_error</b>() to register an
+error code and message and return <b>ARCHIVE_FATAL.</b></p>
+
+<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p>
+
+<p style="margin-left:8%;">The following illustrates basic
+usage of the library. In this example, the callback
+functions are simply wrappers around the standard open(2),
+read(2), and close(2) system calls.</p>
+
+<p style="margin-left:17%; margin-top: 1em">void <br>
+list_archive(const char *name) <br>
+{ <br>
+struct mydata *mydata; <br>
+struct archive *a; <br>
+struct archive_entry *entry;</p>
+
+<p style="margin-left:17%; margin-top: 1em">mydata =
+malloc(sizeof(struct mydata)); <br>
+a = archive_read_new(); <br>
+mydata-&gt;name = name; <br>
+archive_read_support_compression_all(a); <br>
+archive_read_support_format_all(a); <br>
+archive_read_open(a, mydata, myopen, myread, myclose); <br>
+while (archive_read_next_header(a, &amp;entry) ==
+ARCHIVE_OK) { <br>
+printf(&quot;%s\n&quot;,archive_entry_pathname(entry)); <br>
+archive_read_data_skip(a); <br>
+} <br>
+archive_read_finish(a); <br>
+free(mydata); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">ssize_t <br>
+myread(struct archive *a, void *client_data, const void
+**buff) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">*buff =
+mydata-&gt;buff; <br>
+return (read(mydata-&gt;fd, mydata-&gt;buff, 10240)); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">int <br>
+myopen(struct archive *a, void *client_data) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
+open(mydata-&gt;name, O_RDONLY); <br>
+return (mydata-&gt;fd &gt;= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
+<br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">int <br>
+myclose(struct archive *a, void *client_data) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">if
+(mydata-&gt;fd &gt; 0) <br>
+close(mydata-&gt;fd); <br>
+return (ARCHIVE_OK); <br>
+}</p>
+
+<p style="margin-top: 1em" valign="top"><b>RETURN
+VALUES</b></p>
+
+<p style="margin-left:8%;">Most functions return zero on
+success, non-zero on error. The possible return codes
+include: <b>ARCHIVE_OK</b> (the operation succeeded),
+<b>ARCHIVE_WARN</b> (the operation succeeded but a
+non-critical error was encountered), <b>ARCHIVE_EOF</b>
+(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the
+operation failed but can be retried), and
+<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive
+should be closed immediately). Detailed error codes and
+textual descriptions are available from the
+<b>archive_errno</b>() and <b>archive_error_string</b>()
+functions.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_new</b>()
+returns a pointer to a freshly allocated struct archive
+object. It returns NULL on error.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_data</b>()
+returns a count of bytes actually read or zero at the end of
+the entry. On error, a value of <b>ARCHIVE_FATAL</b>,
+<b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is returned and
+an error code and textual description can be retrieved from
+the <b>archive_errno</b>() and <b>archive_error_string</b>()
+functions.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The library
+expects the client callbacks to behave similarly. If there
+is an error, you can use <b>archive_set_error</b>() to set
+an appropriate error code and description, then return one
+of the non-zero values above. (Note that the value
+eventually returned to the client may not be the same; many
+errors that are not critical at the level of basic I/O can
+prevent the archive from being properly read, thus most I/O
+errors eventually cause <b>ARCHIVE_FATAL</b> to be
+returned.)</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">tar(1), archive(3),
+archive_util(3), tar(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">Many traditional archiver
+programs treat empty files as valid empty archives. For
+example, many implementations of tar(1) allow you to append
+entries to an empty file. Of course, it is impossible to
+determine the format of an empty file by inspecting the
+contents, so this library treats empty files as having a
+special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+April&nbsp;13, 2009 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/archive_read_disk.3.html b/archivers/libarchive/files/doc/html/archive_read_disk.3.html
new file mode 100644
index 00000000000..2257ffedef9
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_read_disk.3.html
@@ -0,0 +1,341 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:31 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_read_disk(3) FreeBSD Library
+Functions Manual archive_read_disk(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>archive_read_disk_new</b>,
+<b>archive_read_disk_set_symlink_logical</b>,
+<b>archive_read_disk_set_symlink_physical</b>,
+<b>archive_read_disk_set_symlink_hybrid</b>,
+<b>archive_read_disk_entry_from_file</b>,
+<b>archive_read_disk_gname</b>,
+<b>archive_read_disk_uname</b>,
+<b>archive_read_disk_set_uname_lookup</b>,
+<b>archive_read_disk_set_gname_lookup</b>,
+<b>archive_read_disk_set_standard_lookup</b>,
+<b>archive_read_close</b>, <b>archive_read_finish</b>
+&mdash; functions for reading objects from disk</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_new</b>(<i>void</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_logical</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_physical</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_hybrid</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_gname</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>gid_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_uname</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>uid_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_disk_set_gname_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*(*lookup)(void&nbsp;*,&nbsp;gid_t)</i>,
+<i>void&nbsp;(*cleanup)(void&nbsp;*)</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_disk_set_uname_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*(*lookup)(void&nbsp;*,&nbsp;uid_t)</i>,
+<i>void&nbsp;(*cleanup)(void&nbsp;*)</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_disk_set_standard_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_read_disk_entry_from_file</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>, <i>int&nbsp;fd</i>,
+<i>const&nbsp;struct&nbsp;stat&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_read_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions provide an API
+for reading information about objects on disk. In
+particular, they provide an interface for populating struct
+archive_entry objects.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_new</b>()</p>
+
+<p style="margin-left:20%;">Allocates and initializes a
+struct archive object suitable for reading object
+information from disk.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_symlink_logical</b>(),
+<b>archive_read_disk_set_symlink_physical</b>(),
+<b>archive_read_disk_set_symlink_hybrid</b>()</p>
+
+<p style="margin-left:20%;">This sets the mode used for
+handling symbolic links. The
+&lsquo;&lsquo;logical&rsquo;&rsquo; mode follows all
+symbolic links. The &lsquo;&lsquo;physical&rsquo;&rsquo;
+mode does not follow any symbolic links. The
+&lsquo;&lsquo;hybrid&rsquo;&rsquo; mode currently behaves
+identically to the &lsquo;&lsquo;logical&rsquo;&rsquo;
+mode.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_gname</b>(),
+<b>archive_read_disk_uname</b>()</p>
+
+<p style="margin-left:20%;">Returns a user or group name
+given a gid or uid value. By default, these always return a
+NULL string.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_gname_lookup</b>(),
+<b>archive_read_disk_set_uname_lookup</b>()</p>
+
+<p style="margin-left:20%;">These allow you to override the
+functions used for user and group name lookups. You may also
+provide a void * pointer to a private data structure and a
+cleanup function for that data. The cleanup function will be
+invoked when the struct archive object is destroyed or when
+new lookup functions are registered.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_standard_lookup</b>()</p>
+
+<p style="margin-left:20%;">This convenience function
+installs a standard set of user and group name lookup
+functions. These functions use getpwid(3) and getgrid(3) to
+convert ids to names, defaulting to NULL if the names cannot
+be looked up. These functions also implement a simple memory
+cache to reduce the number of calls to getpwid(3) and
+getgrid(3).</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_disk_entry_from_file</b>()</p>
+
+<p style="margin-left:20%;">Populates a struct
+archive_entry object with information about a particular
+file. The archive_entry object must have already been
+created with archive_entry_new(3) and at least one of the
+source path or path fields must already be set. (If both are
+set, the source path will be used.)</p>
+
+<p style="margin-left:20%; margin-top: 1em">Information is
+read from disk using the path name from the struct
+archive_entry object. If a file descriptor is provided, some
+information will be obtained using that file descriptor, on
+platforms that support the appropriate system calls.</p>
+
+<p style="margin-left:20%; margin-top: 1em">If a pointer to
+a struct stat is provided, information from that structure
+will be used instead of reading from the disk where
+appropriate. This can provide performance benefits in
+scenarios where struct stat information has already been
+read from the disk as a side effect of some other operation.
+(For example, directory traversal libraries often provide
+this information.)</p>
+
+<p style="margin-left:20%; margin-top: 1em">Where
+necessary, user and group ids are converted to user and
+group names using the currently registered lookup functions
+above. This affects the file ownership fields and ACL values
+in the struct archive_entry object.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_read_close</b>()</p>
+
+<p style="margin-left:20%;">This currently does
+nothing.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_finish</b>()</p>
+
+<p style="margin-left:20%;">Invokes
+<b>archive_write_close</b>() if it was not invoked manually,
+then releases all resources.</p>
+
+<p style="margin-left:8%;">More information about the
+<i>struct archive</i> object and the overall design of the
+library can be found in the libarchive(3) overview.</p>
+
+<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p>
+
+<p style="margin-left:8%;">The following illustrates basic
+usage of the library by showing how to use it to copy an
+item on disk into an archive.</p>
+
+<p style="margin-left:17%; margin-top: 1em">void <br>
+file_to_archive(struct archive *a, const char *name) <br>
+{ <br>
+char buff[8192]; <br>
+size_t bytes_read; <br>
+struct archive *ard; <br>
+struct archive_entry *entry; <br>
+int fd;</p>
+
+<p style="margin-left:17%; margin-top: 1em">ard =
+archive_read_disk_new(); <br>
+archive_read_disk_set_standard_lookup(ard); <br>
+entry = archive_entry_new(); <br>
+fd = open(name, O_RDONLY); <br>
+if (fd &lt; 0) <br>
+return; <br>
+archive_entry_copy_sourcepath(entry, name); <br>
+archive_read_disk_entry_from_file(ard, entry, fd, NULL);
+<br>
+archive_write_header(a, entry); <br>
+while ((bytes_read = read(fd, buff, sizeof(buff))) &gt; 0)
+<br>
+archive_write_data(a, buff, bytes_read); <br>
+archive_write_finish_entry(a); <br>
+archive_read_finish(ard); <br>
+archive_entry_free(entry); <br>
+}</p>
+
+<p style="margin-top: 1em" valign="top"><b>RETURN
+VALUES</b></p>
+
+<p style="margin-left:8%;">Most functions return
+<b>ARCHIVE_OK</b> (zero) on success, or one of several
+negative error codes for errors. Specific error codes
+include: <b>ARCHIVE_RETRY</b> for operations that might
+succeed if retried, <b>ARCHIVE_WARN</b> for unusual
+conditions that do not prevent further operations, and
+<b>ARCHIVE_FATAL</b> for serious errors that make remaining
+operations impossible. The archive_errno(3) and
+archive_error_string(3) functions can be used to retrieve an
+appropriate error code and a textual error message. (See
+archive_util(3) for details.)</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_disk_new</b>()
+returns a pointer to a newly-allocated struct archive object
+or NULL if the allocation failed for any reason.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_disk_gname</b>()
+and <b>archive_read_disk_uname</b>() return const char *
+pointers to the textual name or NULL if the lookup failed
+for any reason. The returned pointer points to internal
+storage that may be reused on the next call to either of
+these functions; callers should copy the string if they need
+to continue accessing it.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">archive_read(3),
+archive_write(3), archive_write_disk(3), tar(1),
+libarchive(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3. The
+<b>archive_read_disk</b> interface was added to
+<b>libarchive 2.6</b> and first appeared in
+FreeBSD&nbsp;8.0.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@freebsd.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">The
+&lsquo;&lsquo;standard&rsquo;&rsquo; user name and group
+name lookup functions are not the defaults because
+getgrid(3) and getpwid(3) are sometimes too large for
+particular applications. The current design allows the
+application author to use a more compact implementation when
+appropriate.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The full list of
+metadata read from disk by
+<b>archive_read_disk_entry_from_file</b>() is necessarily
+system-dependent.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+<b>archive_read_disk_entry_from_file</b>() function reads as
+much information as it can from disk. Some method should be
+provided to limit this so that clients who do not need ACLs,
+for instance, can avoid the extra work needed to look up
+such information.</p>
+
+<p style="margin-left:8%; margin-top: 1em">This API should
+provide a set of methods for walking a directory tree. That
+would make it a direct parallel of the archive_read(3) API.
+When such methods are implemented, the
+&lsquo;&lsquo;hybrid&rsquo;&rsquo; symbolic link mode will
+make sense.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+March&nbsp;10, 2009 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/archive_util.3.html b/archivers/libarchive/files/doc/html/archive_util.3.html
new file mode 100644
index 00000000000..c4dd32cc36b
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_util.3.html
@@ -0,0 +1,210 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:32 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_util(3) FreeBSD Library Functions
+Manual archive_util(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>archive_clear_error</b>,
+<b>archive_compression</b>, <b>archive_compression_name</b>,
+<b>archive_copy_error</b>, <b>archive_errno</b>,
+<b>archive_error_string</b>, <b>archive_file_count</b>,
+<b>archive_format</b>, <b>archive_format_name</b>,
+<b>archive_set_error</b> &mdash; libarchive utility
+functions</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_clear_error</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_compression</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_compression_name</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_copy_error</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_errno</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_error_string</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_file_count</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_format</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>const char
+*</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_format_name</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>
+
+
+<p valign="top"><b>archive_set_error</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;error_code</i>,
+<i>const&nbsp;char&nbsp;*fmt</i>, <i>...</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions provide access
+to various information about the struct archive object used
+in the libarchive(3) library.</p>
+
+<p valign="top"><b>archive_clear_error</b>()</p>
+
+<p style="margin-left:20%;">Clears any error information
+left over from a previous call. Not generally used in client
+code.</p>
+
+<p valign="top"><b>archive_compression</b>()</p>
+
+<p style="margin-left:20%;">Returns a numeric code
+indicating the current compression. This value is set by
+<b>archive_read_open</b>().</p>
+
+<p valign="top"><b>archive_compression_name</b>()</p>
+
+<p style="margin-left:20%;">Returns a text description of
+the current compression suitable for display.</p>
+
+<p valign="top"><b>archive_copy_error</b>()</p>
+
+<p style="margin-left:20%;">Copies error information from
+one archive to another.</p>
+
+<p valign="top"><b>archive_errno</b>()</p>
+
+<p style="margin-left:20%;">Returns a numeric error code
+(see errno(2)) indicating the reason for the most recent
+error return.</p>
+
+<p valign="top"><b>archive_error_string</b>()</p>
+
+<p style="margin-left:20%;">Returns a textual error message
+suitable for display. The error message here is usually more
+specific than that obtained from passing the result of
+<b>archive_errno</b>() to strerror(3).</p>
+
+<p valign="top"><b>archive_file_count</b>()</p>
+
+<p style="margin-left:20%;">Returns a count of the number
+of files processed by this archive object. The count is
+incremented by calls to archive_write_header or
+archive_read_next_header.</p>
+
+<p valign="top"><b>archive_format</b>()</p>
+
+<p style="margin-left:20%;">Returns a numeric code
+indicating the format of the current archive entry. This
+value is set by a successful call to
+<b>archive_read_next_header</b>(). Note that it is common
+for this value to change from entry to entry. For example, a
+tar archive might have several entries that utilize GNU tar
+extensions and several entries that do not. These entries
+will have different format codes.</p>
+
+<p valign="top"><b>archive_format_name</b>()</p>
+
+<p style="margin-left:20%;">A textual description of the
+format of the current entry.</p>
+
+<p valign="top"><b>archive_set_error</b>()</p>
+
+<p style="margin-left:20%;">Sets the numeric error code and
+error description that will be returned by
+<b>archive_errno</b>() and <b>archive_error_string</b>().
+This function should be used within I/O callbacks to set
+system-specific error codes and error descriptions. This
+function accepts a printf-like format string and arguments.
+However, you should be careful to use only the following
+printf format specifiers: &lsquo;&lsquo;%c&rsquo;&rsquo;,
+&lsquo;&lsquo;%d&rsquo;&rsquo;,
+&lsquo;&lsquo;%jd&rsquo;&rsquo;,
+&lsquo;&lsquo;%jo&rsquo;&rsquo;,
+&lsquo;&lsquo;%ju&rsquo;&rsquo;,
+&lsquo;&lsquo;%jx&rsquo;&rsquo;,
+&lsquo;&lsquo;%ld&rsquo;&rsquo;,
+&lsquo;&lsquo;%lo&rsquo;&rsquo;,
+&lsquo;&lsquo;%lu&rsquo;&rsquo;,
+&lsquo;&lsquo;%lx&rsquo;&rsquo;,
+&lsquo;&lsquo;%o&rsquo;&rsquo;,
+&lsquo;&lsquo;%u&rsquo;&rsquo;,
+&lsquo;&lsquo;%s&rsquo;&rsquo;,
+&lsquo;&lsquo;%x&rsquo;&rsquo;,
+&lsquo;&lsquo;%%&rsquo;&rsquo;. Field-width specifiers and
+other printf features are not uniformly supported and should
+not be used.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">archive_read(3),
+archive_write(3), libarchive(3), printf(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+January&nbsp;8, 2005 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/archive_write.3.html b/archivers/libarchive/files/doc/html/archive_write.3.html
new file mode 100644
index 00000000000..e72c5d508df
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_write.3.html
@@ -0,0 +1,845 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:33 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_write(3) FreeBSD Library Functions
+Manual archive_write(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>archive_write_new</b>,
+<b>archive_write_set_format_cpio</b>,
+<b>archive_write_set_format_pax</b>,
+<b>archive_write_set_format_pax_restricted</b>,
+<b>archive_write_set_format_shar</b>,
+<b>archive_write_set_format_shar_binary</b>,
+<b>archive_write_set_format_ustar</b>,
+<b>archive_write_get_bytes_per_block</b>,
+<b>archive_write_set_bytes_per_block</b>,
+<b>archive_write_set_bytes_in_last_block</b>,
+<b>archive_write_set_compression_bzip2</b>,
+<b>archive_write_set_compression_compress</b>,
+<b>archive_write_set_compression_gzip</b>,
+<b>archive_write_set_compression_none</b>,
+<b>archive_write_set_compression_program</b>,
+<b>archive_write_set_compressor_options</b>,
+<b>archive_write_set_format_options</b>,
+<b>archive_write_set_options</b>, <b>archive_write_open</b>,
+<b>archive_write_open_fd</b>,
+<b>archive_write_open_FILE</b>,
+<b>archive_write_open_filename</b>,
+<b>archive_write_open_memory</b>,
+<b>archive_write_header</b>, <b>archive_write_data</b>,
+<b>archive_write_finish_entry</b>,
+<b>archive_write_close</b>, <b>archive_write_finish</b>
+&mdash; functions for creating archives</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_new</b>(<i>void</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_get_bytes_per_block</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_bytes_per_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;bytes_per_block</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_bytes_in_last_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compression_bzip2</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compression_compress</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compression_gzip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compression_none</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compression_program</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*&nbsp;cmd</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_cpio</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_pax</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_pax_restricted</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_shar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_shar_binary</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_ustar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_format_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_compressor_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_set_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_write_open</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>archive_open_callback&nbsp;*</i>,
+<i>archive_write_callback&nbsp;*</i>,
+<i>archive_close_callback&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_open_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;fd</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_open_FILE</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>FILE&nbsp;*file</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_open_filename</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;char&nbsp;*filename</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_write_open_memory</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*buffer</i>, <i>size_t&nbsp;bufferSize</i>,
+<i>size_t&nbsp;*outUsed</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_header</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>ssize_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;void&nbsp;*</i>, <i>size_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_finish_entry</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions provide a
+complete API for creating streaming archive files. The
+general process is to first create the struct archive
+object, set any desired options, initialize the archive,
+append entries, then close the archive and release all
+resources. The following summary describes the functions in
+approximately the order they are ordinarily used:</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_new</b>()</p>
+
+<p style="margin-left:20%;">Allocates and initializes a
+struct archive object suitable for writing a tar
+archive.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_bytes_per_block</b>()</p>
+
+<p style="margin-left:20%;">Sets the block size used for
+writing the archive data. Every call to the write callback
+function, except possibly the last one, will use this value
+for the length. The third parameter is a boolean that
+specifies whether or not the final block written will be
+padded to the full block size. If it is zero, the last block
+will not be padded. If it is non-zero, padding will be added
+both before and after compression. The default is to use a
+block size of 10240 bytes and to pad the last block. Note
+that a block size of zero will suppress internal blocking
+and cause writes to be sent directly to the write callback
+as they occur.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_get_bytes_per_block</b>()</p>
+
+<p style="margin-left:20%;">Retrieve the block size to be
+used for writing. A value of -1 here indicates that the
+library should use default values. A value of zero indicates
+that internal blocking is suppressed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_bytes_in_last_block</b>()</p>
+
+<p style="margin-left:20%;">Sets the block size used for
+writing the last block. If this value is zero, the last
+block will be padded to the same size as the other blocks.
+Otherwise, the final block will be padded to a multiple of
+this size. In particular, setting it to 1 will cause the
+final block to not be padded. For compressed output, any
+padding generated by this option is applied only after the
+compression. The uncompressed data is always unpadded. The
+default is to pad the last block to the full block size
+(note that <b>archive_write_open_filename</b>() will set
+this based on the file type). Unlike the other
+&lsquo;&lsquo;set&rsquo;&rsquo; functions, this function can
+be called after the archive is opened.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_get_bytes_in_last_block</b>()</p>
+
+<p style="margin-left:20%;">Retrieve the currently-set
+value for last block size. A value of -1 here indicates that
+the library should use default values.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_format_cpio</b>(),
+<b>archive_write_set_format_pax</b>(),
+<b>archive_write_set_format_pax_restricted</b>(),
+<b>archive_write_set_format_shar</b>(),
+<b>archive_write_set_format_shar_binary</b>(),
+<b>archive_write_set_format_ustar</b>()</p>
+
+<p style="margin-left:20%;">Sets the format that will be
+used for the archive. The library can write POSIX
+octet-oriented cpio format archives, POSIX-standard
+&lsquo;&lsquo;pax interchange&rsquo;&rsquo; format archives,
+traditional &lsquo;&lsquo;shar&rsquo;&rsquo; archives,
+enhanced &lsquo;&lsquo;binary&rsquo;&rsquo; shar archives
+that store a variety of file attributes and handle binary
+files, and POSIX-standard &lsquo;&lsquo;ustar&rsquo;&rsquo;
+archives. The pax interchange format is a
+backwards-compatible tar format that adds key/value
+attributes to each entry and supports arbitrary filenames,
+linknames, uids, sizes, etc. &lsquo;&lsquo;Restricted pax
+interchange format&rsquo;&rsquo; is the library default;
+this is the same as pax format, but suppresses the pax
+extended header for most normal files. In most cases, this
+will result in ordinary ustar archives.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_compression_bzip2</b>(),
+<b>archive_write_set_compression_compress</b>(),
+<b>archive_write_set_compression_gzip</b>(),
+<b>archive_write_set_compression_none</b>()</p>
+
+<p style="margin-left:20%;">The resulting archive will be
+compressed as specified. Note that the compressed output is
+always properly blocked.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_compression_program</b>()</p>
+
+<p style="margin-left:20%;">The archive will be fed into
+the specified compression program. The output of that
+program is blocked and written to the client write
+callbacks.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_set_compressor_options</b>(),
+<b>archive_write_set_format_options</b>(),
+<b>archive_write_set_options</b>()</p>
+
+<p style="margin-left:20%;">Specifies options that will be
+passed to the currently-enabled compressor and/or format
+writer. The argument is a comma-separated list of individual
+options. Individual options have one of the following
+forms:</p>
+
+<p valign="top"><i>option=value</i></p>
+
+<p style="margin-left:32%;">The option/value pair will be
+provided to every module. Modules that do not accept an
+option with this name will ignore it.</p>
+
+<p valign="top"><i>option</i></p>
+
+<p style="margin-left:32%; margin-top: 1em">The option will
+be provided to every module with a value of
+&lsquo;&lsquo;1&rsquo;&rsquo;.</p>
+
+<p valign="top"><i>!option</i></p>
+
+<p style="margin-left:32%;">The option will be provided to
+every module with a NULL value.</p>
+
+<p valign="top"><i>module:option=value</i>,
+<i>module:option</i>, <i>module:!option</i></p>
+
+<p style="margin-left:32%;">As above, but the corresponding
+option and value will be provided only to modules whose name
+matches <i>module</i>.</p>
+
+<p style="margin-left:20%;">The return value will be
+<b>ARCHIVE_OK</b> if any module accepts the option, or
+<b>ARCHIVE_WARN</b> if no module accepted the option, or
+<b>ARCHIVE_FATAL</b> if there was a fatal error while
+attempting to process the option.</p>
+
+<p style="margin-left:20%; margin-top: 1em">The currently
+supported options are:</p>
+
+<p valign="top">Compressor gzip <b><br>
+compression-level</b></p>
+
+<p style="margin-left:45%;">The value is interpreted as a
+decimal integer specifying the gzip compression level.</p>
+
+<p valign="top">Compressor xz <b><br>
+compression-level</b></p>
+
+<p style="margin-left:45%;">The value is interpreted as a
+decimal integer specifying the compression level.</p>
+
+<p valign="top">Format mtree <b><br>
+cksum</b>, <b>device</b>, <b>flags</b>, <b>gid</b>,
+<b>gname</b>, <b>indent</b>, <b>link</b>, <b>md5</b>,
+<b>mode</b>, <b>nlink</b>, <b>rmd160</b>, <b>sha1</b>,
+<b>sha256</b>, <b>sha384</b>, <b>sha512</b>, <b>size</b>,
+<b>time</b>, <b>uid</b>, <b>uname</b></p>
+
+<p style="margin-left:45%;">Enable a particular keyword in
+the mtree output. Prefix with an exclamation mark to disable
+the corresponding keyword. The default is equivalent to
+&lsquo;&lsquo;device, flags, gid, gname, link, mode, nlink,
+size, time, type, uid, uname&rsquo;&rsquo;.</p>
+
+<p valign="top"><b>all</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">Enables all of
+the above keywords.</p>
+
+<p valign="top"><b>use-set</b></p>
+
+<p style="margin-left:45%;">Enables generation of
+<b>/set</b> lines that specify default values for the
+following files and/or directories.</p>
+
+<p valign="top"><b>indent</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">XXX needs
+explanation XXX</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open</b>()</p>
+
+<p style="margin-left:20%;">Freeze the settings, open the
+archive, and prepare for writing entries. This is the most
+generic form of this function, which accepts pointers to
+three callback functions which will be invoked by the
+compression layer to write the constructed archive.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open_fd</b>()</p>
+
+<p style="margin-left:20%;">A convenience form of
+<b>archive_write_open</b>() that accepts a file descriptor.
+The <b>archive_write_open_fd</b>() function is safe for use
+with tape drives or other block-oriented devices.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open_FILE</b>()</p>
+
+<p style="margin-left:20%;">A convenience form of
+<b>archive_write_open</b>() that accepts a <i>FILE *</i>
+pointer. Note that <b>archive_write_open_FILE</b>() is not
+safe for writing to tape drives or other devices that
+require correct blocking.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open_file</b>()</p>
+
+<p style="margin-left:20%;">A deprecated synonym for
+<b>archive_write_open_filename</b>().</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open_filename</b>()</p>
+
+<p style="margin-left:20%;">A convenience form of
+<b>archive_write_open</b>() that accepts a filename. A NULL
+argument indicates that the output should be written to
+standard output; an argument of
+&lsquo;&lsquo;-&rsquo;&rsquo; will open a file with that
+name. If you have not invoked
+<b>archive_write_set_bytes_in_last_block</b>(), then
+<b>archive_write_open_filename</b>() will adjust the
+last-block padding depending on the file: it will enable
+padding when writing to standard output or to a character or
+block device node, it will disable padding otherwise. You
+can override this by manually invoking
+<b>archive_write_set_bytes_in_last_block</b>() before
+calling <b>archive_write_open</b>(). The
+<b>archive_write_open_filename</b>() function is safe for
+use with tape drives or other block-oriented devices.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_open_memory</b>()</p>
+
+<p style="margin-left:20%;">A convenience form of
+<b>archive_write_open</b>() that accepts a pointer to a
+block of memory that will receive the archive. The final
+<i>size_t *</i> argument points to a variable that will be
+updated after each write to reflect how much of the buffer
+is currently in use. You should be careful to ensure that
+this variable remains allocated until after the archive is
+closed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_header</b>()</p>
+
+<p style="margin-left:20%;">Build and write a header using
+the data in the provided struct archive_entry structure. See
+archive_entry(3) for information on creating and populating
+struct archive_entry objects.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_data</b>()</p>
+
+<p style="margin-left:20%;">Write data corresponding to the
+header just written. Returns number of bytes written or -1
+on error.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_finish_entry</b>()</p>
+
+<p style="margin-left:20%;">Close out the entry just
+written. In particular, this writes out the final padding
+required by some formats. Ordinarily, clients never need to
+call this, as it is called automatically by
+<b>archive_write_next_header</b>() and
+<b>archive_write_close</b>() as needed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_close</b>()</p>
+
+<p style="margin-left:20%;">Complete the archive and invoke
+the close callback.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_finish</b>()</p>
+
+<p style="margin-left:20%;">Invokes
+<b>archive_write_close</b>() if it was not invoked manually,
+then releases all resources. Note that this function was
+declared to return <i>void</i> in libarchive 1.x, which made
+it impossible to detect errors when
+<b>archive_write_close</b>() was invoked implicitly from
+this function. This is corrected beginning with libarchive
+2.0.</p>
+
+<p style="margin-left:8%;">More information about the
+<i>struct archive</i> object and the overall design of the
+library can be found in the libarchive(3) overview.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>IMPLEMENTATION</b></p>
+
+<p style="margin-left:8%;">Compression support is built-in
+to libarchive, which uses zlib and bzlib to handle gzip and
+bzip2 compression, respectively.</p>
+
+<p style="margin-top: 1em" valign="top"><b>CLIENT
+CALLBACKS</b></p>
+
+<p style="margin-left:8%;">To use this library, you will
+need to define and register callback functions that will be
+invoked to write data to the resulting archive. These
+functions are registered by calling
+<b>archive_write_open</b>():</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+int</i> <b>archive_open_callback</b>(<i>struct archive
+*</i>, <i>void *client_data</i>)</p>
+
+<p style="margin-left:8%; margin-top: 1em">The open
+callback is invoked by <b>archive_write_open</b>(). It
+should return <b>ARCHIVE_OK</b> if the underlying file or
+data source is successfully opened. If the open fails, it
+should call <b>archive_set_error</b>() to register an error
+code and message and return <b>ARCHIVE_FATAL</b>.</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+ssize_t</i></p>
+
+
+<p valign="top"><b>archive_write_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*client_data</i>,
+<i>const&nbsp;void&nbsp;*buffer</i>,
+<i>size_t&nbsp;length</i>)</p>
+
+<p style="margin-left:8%; margin-top: 1em">The write
+callback is invoked whenever the library needs to write raw
+bytes to the archive. For correct blocking, each call to the
+write callback function should translate into a single
+write(2) system call. This is especially critical when
+writing archives to tape drives. On success, the write
+callback should return the number of bytes actually written.
+On error, the callback should invoke
+<b>archive_set_error</b>() to register an error code and
+message and return -1.</p>
+
+<p style="margin-left:17%; margin-top: 1em"><i>typedef
+int</i> <b>archive_close_callback</b>(<i>struct archive
+*</i>, <i>void *client_data</i>)</p>
+
+<p style="margin-left:8%; margin-top: 1em">The close
+callback is invoked by archive_close when the archive
+processing is complete. The callback should return
+<b>ARCHIVE_OK</b> on success. On failure, the callback
+should invoke <b>archive_set_error</b>() to register an
+error code and message and return <b>ARCHIVE_FATAL.</b></p>
+
+<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p>
+
+<p style="margin-left:8%;">The following sketch illustrates
+basic usage of the library. In this example, the callback
+functions are simply wrappers around the standard open(2),
+write(2), and close(2) system calls.</p>
+
+<p style="margin-left:17%; margin-top: 1em">#ifdef
+__linux__</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="17%"></td>
+<td width="12%">
+
+
+<p valign="top">#define</p></td>
+<td width="13%">
+
+
+<p valign="top">_FILE_OFFSET_BITS 64</p></td>
+<td width="58%">
+</td>
+</table>
+
+<p style="margin-left:17%;">#endif <br>
+#include &lt;sys/stat.h&gt; <br>
+#include &lt;archive.h&gt; <br>
+#include &lt;archive_entry.h&gt; <br>
+#include &lt;fcntl.h&gt; <br>
+#include &lt;stdlib.h&gt; <br>
+#include &lt;unistd.h&gt;</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct mydata
+{</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">const char *name;</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">int fd;</p></td>
+</table>
+
+<p style="margin-left:17%;">};</p>
+
+<p style="margin-left:17%; margin-top: 1em">int <br>
+myopen(struct archive *a, void *client_data) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
+open(mydata-&gt;name, O_WRONLY | O_CREAT, 0644); <br>
+if (mydata-&gt;fd &gt;= 0) <br>
+return (ARCHIVE_OK); <br>
+else <br>
+return (ARCHIVE_FATAL); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">ssize_t <br>
+mywrite(struct archive *a, void *client_data, const void
+*buff, size_t n) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">return
+(write(mydata-&gt;fd, buff, n)); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">int <br>
+myclose(struct archive *a, void *client_data) <br>
+{ <br>
+struct mydata *mydata = client_data;</p>
+
+<p style="margin-left:17%; margin-top: 1em">if
+(mydata-&gt;fd &gt; 0) <br>
+close(mydata-&gt;fd); <br>
+return (0); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">void <br>
+write_archive(const char *outname, const char **filename)
+<br>
+{ <br>
+struct mydata *mydata = malloc(sizeof(struct mydata)); <br>
+struct archive *a; <br>
+struct archive_entry *entry; <br>
+struct stat st; <br>
+char buff[8192]; <br>
+int len; <br>
+int fd;</p>
+
+<p style="margin-left:17%; margin-top: 1em">a =
+archive_write_new(); <br>
+mydata-&gt;name = outname; <br>
+archive_write_set_compression_gzip(a); <br>
+archive_write_set_format_ustar(a); <br>
+archive_write_open(a, mydata, myopen, mywrite, myclose);
+<br>
+while (*filename) { <br>
+stat(*filename, &amp;st); <br>
+entry = archive_entry_new(); <br>
+archive_entry_copy_stat(entry, &amp;st); <br>
+archive_entry_set_pathname(entry, *filename); <br>
+archive_write_header(a, entry); <br>
+fd = open(*filename, O_RDONLY); <br>
+len = read(fd, buff, sizeof(buff)); <br>
+while ( len &gt; 0 ) {</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">archive_write_data(a, buff, len);</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">len = read(fd, buff, sizeof(buff));</p></td>
+</table>
+
+<p style="margin-left:17%;">} <br>
+archive_entry_free(entry); <br>
+filename++; <br>
+} <br>
+archive_write_finish(a); <br>
+}</p>
+
+<p style="margin-left:17%; margin-top: 1em">int main(int
+argc, const char **argv) <br>
+{</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">const char *outname;</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">argv++;</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">outname = argv++;</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">write_archive(outname, argv);</p></td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">return 0;</p></td>
+</table>
+
+<p style="margin-left:17%;">}</p>
+
+<p style="margin-top: 1em" valign="top"><b>RETURN
+VALUES</b></p>
+
+<p style="margin-left:8%;">Most functions return
+<b>ARCHIVE_OK</b> (zero) on success, or one of several
+non-zero error codes for errors. Specific error codes
+include: <b>ARCHIVE_RETRY</b> for operations that might
+succeed if retried, <b>ARCHIVE_WARN</b> for unusual
+conditions that do not prevent further operations, and
+<b>ARCHIVE_FATAL</b> for serious errors that make remaining
+operations impossible. The <b>archive_errno</b>() and
+<b>archive_error_string</b>() functions can be used to
+retrieve an appropriate error code and a textual error
+message.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_write_new</b>()
+returns a pointer to a newly-allocated struct archive
+object.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_write_data</b>()
+returns a count of the number of bytes actually written. On
+error, -1 is returned and the <b>archive_errno</b>() and
+<b>archive_error_string</b>() functions will return
+appropriate values. Note that if the client-provided write
+callback function returns a non-zero value, that error will
+be propagated back to the caller through whatever API
+function resulted in that call, which may include
+<b>archive_write_header</b>(), <b>archive_write_data</b>(),
+<b>archive_write_close</b>(), or
+<b>archive_write_finish</b>(). The client callback can call
+<b>archive_set_error</b>() to provide values that can then
+be retrieved by <b>archive_errno</b>() and
+<b>archive_error_string</b>().</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">tar(1), libarchive(3),
+tar(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">There are many peculiar bugs in
+historic tar implementations that may cause certain programs
+to reject archives written by this library. For example,
+several historic implementations calculated header checksums
+incorrectly and will thus reject valid archives; GNU tar
+does not fully support pax interchange format; some old tar
+implementations required specific field terminations.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The default pax
+interchange format eliminates most of the historic tar
+limitations and provides a generic key/value attribute
+facility for vendor-defined extensions. One oversight in
+POSIX is the failure to provide a standard attribute for
+large device numbers. This library uses
+&lsquo;&lsquo;SCHILY.devminor&rsquo;&rsquo; and
+&lsquo;&lsquo;SCHILY.devmajor&rsquo;&rsquo; for device
+numbers that exceed the range supported by the
+backwards-compatible ustar header. These keys are compatible
+with Joerg Schilling&rsquo;s <b>star</b> archiver. Other
+implementations may not recognize these keys and will thus
+be unable to correctly restore device nodes with large
+device numbers from archives created by this library.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+May&nbsp;11, 2008 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/archive_write_disk.3.html b/archivers/libarchive/files/doc/html/archive_write_disk.3.html
new file mode 100644
index 00000000000..3d7ef6367ed
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/archive_write_disk.3.html
@@ -0,0 +1,421 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:34 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">archive_write_disk(3) FreeBSD Library
+Functions Manual archive_write_disk(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>archive_write_disk_new</b>,
+<b>archive_write_disk_set_options</b>,
+<b>archive_write_disk_set_skip_file</b>,
+<b>archive_write_disk_set_group_lookup</b>,
+<b>archive_write_disk_set_standard_lookup</b>,
+<b>archive_write_disk_set_user_lookup</b>,
+<b>archive_write_header</b>, <b>archive_write_data</b>,
+<b>archive_write_finish_entry</b>,
+<b>archive_write_close</b>, <b>archive_write_finish</b>
+&mdash; functions for creating objects on disk</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:8%;"><b>#include
+&lt;archive.h&gt;</b></p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>struct
+archive *</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_disk_new</b>(<i>void</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_disk_set_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>int&nbsp;flags</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_disk_set_skip_file</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>dev_t</i>, <i>ino_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_write_disk_set_group_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*</i>,
+<i>gid_t&nbsp;(*)(void&nbsp;*,&nbsp;const&nbsp;char&nbsp;*gname,&nbsp;gid_t&nbsp;gid)</i>,
+<i>void&nbsp;(*cleanup)(void&nbsp;*)</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_disk_set_standard_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p valign="top"><b>archive_write_disk_set_user_lookup</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>void&nbsp;*</i>,
+<i>uid_t&nbsp;(*)(void&nbsp;*,&nbsp;const&nbsp;char&nbsp;*uname,&nbsp;uid_t&nbsp;uid)</i>,
+<i>void&nbsp;(*cleanup)(void&nbsp;*)</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_header</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><i>ssize_t</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
+<i>const&nbsp;void&nbsp;*</i>, <i>size_t</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_finish_entry</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:14%;"><b>archive_write_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">These functions provide a
+complete API for creating objects on disk from struct
+archive_entry descriptions. They are most naturally used
+when extracting objects from an archive using the
+<b>archive_read</b>() interface. The general process is to
+read struct archive_entry objects from an archive, then
+write those objects to a struct archive object created using
+the <b>archive_write_disk</b>() family functions. This
+interface is deliberately very similar to the
+<b>archive_write</b>() interface used to write objects to a
+streaming archive.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_disk_new</b>()</p>
+
+<p style="margin-left:20%;">Allocates and initializes a
+struct archive object suitable for writing objects to
+disk.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_disk_set_skip_file</b>()</p>
+
+<p style="margin-left:20%;">Records the device and inode
+numbers of a file that should not be overwritten. This is
+typically used to ensure that an extraction process does not
+overwrite the archive from which objects are being read.
+This capability is technically unnecessary but can be a
+significant performance optimization in practice.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_disk_set_options</b>()</p>
+
+<p style="margin-left:20%;">The options field consists of a
+bitwise OR of one or more of the following values:</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_OWNER</b></p>
+
+<p style="margin-left:32%;">The user and group IDs should
+be set on the restored file. By default, the user and group
+IDs are not restored.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_PERM</b></p>
+
+<p style="margin-left:32%;">Full permissions (including
+SGID, SUID, and sticky bits) should be restored exactly as
+specified, without obeying the current umask. Note that SUID
+and SGID bits can only be restored if the user and group ID
+of the object on disk are correct. If
+<b>ARCHIVE_EXTRACT_OWNER</b> is not specified, then SUID and
+SGID bits will only be restored if the default user and
+group IDs of newly-created objects on disk happen to match
+those specified in the archive entry. By default, only basic
+permissions are restored, and umask is obeyed.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_TIME</b></p>
+
+<p style="margin-left:32%;">The timestamps (mtime, ctime,
+and atime) should be restored. By default, they are ignored.
+Note that restoring of atime is not currently supported.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_NO_OVERWRITE</b></p>
+
+<p style="margin-left:32%;">Existing files on disk will not
+be overwritten. By default, existing regular files are
+truncated and overwritten; existing directories will have
+their permissions updated; other pre-existing objects are
+unlinked and recreated from scratch.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_UNLINK</b></p>
+
+<p style="margin-left:32%;">Existing files on disk will be
+unlinked before any attempt to create them. In some cases,
+this can prove to be a significant performance improvement.
+By default, existing files are truncated and rewritten, but
+the file is not recreated. In particular, the default
+behavior does not break existing hard links.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_ACL</b></p>
+
+<p style="margin-left:32%;">Attempt to restore ACLs. By
+default, extended ACLs are ignored.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_FFLAGS</b></p>
+
+<p style="margin-left:32%;">Attempt to restore extended
+file flags. By default, file flags are ignored.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_XATTR</b></p>
+
+<p style="margin-left:32%;">Attempt to restore POSIX.1e
+extended attributes. By default, they are ignored.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_SECURE_SYMLINKS</b></p>
+
+<p style="margin-left:32%;">Refuse to extract any object
+whose final location would be altered by a symlink on disk.
+This is intended to help guard against a variety of mischief
+caused by archives that (deliberately or otherwise) extract
+files outside of the current directory. The default is not
+to perform this check. If <b>ARCHIVE_EXTRACT_UNLINK</b> is
+specified together with this option, the library will remove
+any intermediate symlinks it finds and return an error only
+if such symlink could not be removed.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_SECURE_NODOTDOT</b></p>
+
+<p style="margin-left:32%;">Refuse to extract a path that
+contains a <i>..</i> element anywhere within it. The default
+is to not refuse such paths. Note that paths ending in
+<i>..</i> always cause an error, regardless of this
+flag.</p>
+
+<p valign="top"><b>ARCHIVE_EXTRACT_SPARSE</b></p>
+
+<p style="margin-left:32%;">Scan data for blocks of NUL
+bytes and try to recreate them with holes. This results in
+sparse files, independent of whether the archive format
+supports or uses them.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_disk_set_group_lookup</b>(),
+<b>archive_write_disk_set_user_lookup</b>()</p>
+
+<p style="margin-left:20%;">The struct archive_entry
+objects contain both names and ids that can be used to
+identify users and groups. These names and ids describe the
+ownership of the file itself and also appear in ACL lists.
+By default, the library uses the ids and ignores the names,
+but this can be overridden by registering user and group
+lookup functions. To register, you must provide a lookup
+function which accepts both a name and id and returns a
+suitable id. You may also provide a void * pointer to a
+private data structure and a cleanup function for that data.
+The cleanup function will be invoked when the struct archive
+object is destroyed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_disk_set_standard_lookup</b>()</p>
+
+<p style="margin-left:20%;">This convenience function
+installs a standard set of user and group lookup functions.
+These functions use getpwnam(3) and getgrnam(3) to convert
+names to ids, defaulting to the ids if the names cannot be
+looked up. These functions also implement a simple memory
+cache to reduce the number of calls to getpwnam(3) and
+getgrnam(3).</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_header</b>()</p>
+
+<p style="margin-left:20%;">Build and write a header using
+the data in the provided struct archive_entry structure. See
+archive_entry(3) for information on creating and populating
+struct archive_entry objects.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_data</b>()</p>
+
+<p style="margin-left:20%;">Write data corresponding to the
+header just written. Returns number of bytes written or -1
+on error.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_finish_entry</b>()</p>
+
+<p style="margin-left:20%;">Close out the entry just
+written. Ordinarily, clients never need to call this, as it
+is called automatically by
+<b>archive_write_next_header</b>() and
+<b>archive_write_close</b>() as needed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_close</b>()</p>
+
+<p style="margin-left:20%;">Set any attributes that could
+not be set during the initial restore. For example,
+directory timestamps are not restored initially because
+restoring a subsequent file would alter that timestamp.
+Similarly, non-writable directories are initially created
+with write permissions (so that their contents can be
+restored). The <b>archive_write_disk_new</b> library
+maintains a list of all such deferred attributes and sets
+them when this function is invoked.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>archive_write_finish</b>()</p>
+
+<p style="margin-left:20%;">Invokes
+<b>archive_write_close</b>() if it was not invoked manually,
+then releases all resources.</p>
+
+<p style="margin-left:8%;">More information about the
+<i>struct archive</i> object and the overall design of the
+library can be found in the libarchive(3) overview. Many of
+these functions are also documented under
+archive_write(3).</p>
+
+<p style="margin-top: 1em" valign="top"><b>RETURN
+VALUES</b></p>
+
+<p style="margin-left:8%;">Most functions return
+<b>ARCHIVE_OK</b> (zero) on success, or one of several
+non-zero error codes for errors. Specific error codes
+include: <b>ARCHIVE_RETRY</b> for operations that might
+succeed if retried, <b>ARCHIVE_WARN</b> for unusual
+conditions that do not prevent further operations, and
+<b>ARCHIVE_FATAL</b> for serious errors that make remaining
+operations impossible. The <b>archive_errno</b>() and
+<b>archive_error_string</b>() functions can be used to
+retrieve an appropriate error code and a textual error
+message.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_write_disk_new</b>()
+returns a pointer to a newly-allocated struct archive
+object.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_write_data</b>()
+returns a count of the number of bytes actually written. On
+error, -1 is returned and the <b>archive_errno</b>() and
+<b>archive_error_string</b>() functions will return
+appropriate values.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">archive_read(3),
+archive_write(3), tar(1), libarchive(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3. The
+<b>archive_write_disk</b> interface was added to
+<b>libarchive 2.0</b> and first appeared in
+FreeBSD&nbsp;6.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">Directories are actually
+extracted in two distinct phases. Directories are created
+during <b>archive_write_header</b>(), but final permissions
+are not set until <b>archive_write_close</b>(). This
+separation is necessary to correctly handle borderline cases
+such as a non-writable directory containing files, but can
+cause unexpected results. In particular, directory
+permissions are not fully restored until the archive is
+closed. If you use chdir(2) to change the current directory
+between calls to <b>archive_read_extract</b>() or before
+calling <b>archive_read_close</b>(), you may confuse the
+permission-setting logic with the result that directory
+permissions are restored incorrectly.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The library
+attempts to create objects with filenames longer than
+<b>PATH_MAX</b> by creating prefixes of the full path and
+changing the current directory. Currently, this logic is
+limited in scope; the fixup pass does not work correctly for
+such objects and the symlink security check option disables
+the support for very long pathnames.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Restoring the
+path <i>aa/../bb</i> does create each intermediate
+directory. In particular, the directory <i>aa</i> is created
+as well as the final object <i>bb</i>. In theory, this can
+be exploited to create an entire directory heirarchy with a
+single request. Of course, this does not work if the
+<b>ARCHIVE_EXTRACT_NODOTDOT</b> option is specified.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Implicit
+directories are always created obeying the current umask.
+Explicit objects are created obeying the current umask
+unless <b>ARCHIVE_EXTRACT_PERM</b> is specified, in which
+case they current umask is ignored.</p>
+
+<p style="margin-left:8%; margin-top: 1em">SGID and SUID
+bits are restored only if the correct user and group could
+be set. If <b>ARCHIVE_EXTRACT_OWNER</b> is not specified,
+then no attempt is made to set the ownership. In this case,
+SGID and SUID bits are restored only if the user and group
+of the final object happen to match those specified in the
+entry.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+&lsquo;&lsquo;standard&rsquo;&rsquo; user-id and group-id
+lookup functions are not the defaults because getgrnam(3)
+and getpwnam(3) are sometimes too large for particular
+applications. The current design allows the application
+author to use a more compact implementation when
+appropriate.</p>
+
+<p style="margin-left:8%; margin-top: 1em">There should be
+a corresponding <b>archive_read_disk</b> interface that
+walks a directory heirarchy and returns archive entry
+objects.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+August&nbsp;5, 2008 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/bsdcpio.1.html b/archivers/libarchive/files/doc/html/bsdcpio.1.html
new file mode 100644
index 00000000000..951f0e285b8
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/bsdcpio.1.html
@@ -0,0 +1,519 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:41 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">BSDCPIO(1) FreeBSD General Commands Manual
+BSDCPIO(1)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>cpio</b> &mdash; copy files
+to and from archives</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:15%;"><b>cpio</b> {<b>&minus;i</b>}
+[<i>options</i>] [<i>pattern&nbsp;...</i>]
+[<i>&lt;&nbsp;archive</i>] <b><br>
+cpio</b> {<b>&minus;o</b>} [<i>options</i>] <i>&lt;
+name-list</i> [<i>&gt;&nbsp;archive</i>] <b><br>
+cpio</b> {<b>&minus;p</b>} [<i>options</i>] <i>dest-dir &lt;
+name-list</i></p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;"><b>cpio</b> copies files between
+archives and directories. This implementation can extract
+from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
+and can create tar, pax, cpio, ar, and shar archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The first option
+to <b>cpio</b> is a mode indicator from the following
+list:</p>
+
+<p valign="top"><b>&minus;i</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Input. Read an
+archive from standard input (unless overriden) and extract
+the contents to disk or (if the <b>&minus;t</b> option is
+specified) list the contents to standard output. If one or
+more file patterns are specified, only files matching one of
+the patterns will be extracted.</p>
+
+<p valign="top"><b>&minus;o</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Output. Read a
+list of filenames from standard input and produce a new
+archive on standard output (unless overriden) containing the
+specified items.</p>
+
+<p valign="top"><b>&minus;p</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Pass-through.
+Read a list of filenames from standard input and copy the
+files to the specified directory.</p>
+
+<p style="margin-top: 1em" valign="top"><b>OPTIONS</b></p>
+
+<p style="margin-left:8%;">Unless specifically stated
+otherwise, options are applicable in all operating
+modes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;0</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Read filenames
+separated by NUL characters instead of newlines. This is
+necessary if any of the filenames being read might contain
+newlines.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;A</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Append to the specified archive. (Not yet implemented.)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;a</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o and p modes)
+Reset access times on files after they are read.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;B</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Block output to records of 5120 bytes.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;C</b>
+<i>size</i></p>
+
+<p style="margin-left:20%;">(o mode only) Block output to
+records of <i>size</i> bytes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;c</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Use the old POSIX portable character format. Equivalent to
+<b>&minus;-format</b> <i>odc</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;d</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(i and p modes)
+Create directories as necessary.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;E</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">(i mode only) Read list of file
+name patterns from <i>file</i> to list and extract.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;F</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">Read archive from or write
+archive to <i>file</i>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;f</b>
+<i>pattern</i></p>
+
+<p style="margin-left:20%;">(i mode only) Ignore files that
+match <i>pattern</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-format</b>
+<i>format</i></p>
+
+<p style="margin-left:20%;">(o mode only) Produce the
+output archive in the specified format. Supported formats
+include:</p>
+
+<p style="margin-top: 1em" valign="top"><i>cpio</i></p>
+
+<p style="margin-left:34%; margin-top: 1em">Synonym for
+<i>odc</i>.</p>
+
+<p valign="top"><i>newc</i></p>
+
+<p style="margin-left:34%; margin-top: 1em">The SVR4
+portable cpio format.</p>
+
+<p valign="top"><i>odc</i></p>
+
+<p style="margin-left:34%; margin-top: 1em">The old POSIX.1
+portable octet-oriented cpio format.</p>
+
+<p valign="top"><i>pax</i></p>
+
+<p style="margin-left:34%; margin-top: 1em">The POSIX.1 pax
+format, an extension of the ustar format.</p>
+
+<p valign="top"><i>ustar</i></p>
+
+<p style="margin-left:34%; margin-top: 1em">The POSIX.1 tar
+format.</p>
+
+<p style="margin-left:20%; margin-top: 1em">The default
+format is <i>odc</i>. See libarchive_formats(5) for more
+complete information about the formats currently supported
+by the underlying libarchive(3) library.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;H</b>
+<i>format</i></p>
+
+<p style="margin-left:20%;">Synonym for
+<b>&minus;-format</b>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;h</b>,
+<b>&minus;-help</b></p>
+
+<p style="margin-left:20%;">Print usage information.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;I</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">Read archive from
+<i>file</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;i</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Input mode. See
+above for description.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-insecure</b></p>
+
+<p style="margin-left:20%;">(i and p mode only) Disable
+security checks during extraction or copying. This allows
+extraction via symbolic links and path names containing
+&lsquo;..&rsquo; in the name.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;J</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Compress the file with xz-compatible compression before
+writing it. In input mode, this option is ignored; xz
+compression is recognized automatically on input.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;j</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Synonym for
+<b>&minus;y</b>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;L</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o and p modes)
+All symbolic links will be followed. Normally, symbolic
+links are archived and copied as symbolic links. With this
+option, the target of the link will be archived or copied
+instead.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;l</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(p mode only)
+Create links from the target directory to the original
+files, instead of copying.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;lzma</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Compress the file with lzma-compatible compression before
+writing it. In input mode, this option is ignored; lzma
+compression is recognized automatically on input.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;m</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(i and p modes)
+Set file modification time on created files to match those
+in the source.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;n</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(i mode, only
+with <b>&minus;t</b>) Display numeric uid and gid. By
+default, <b>cpio</b> displays the user and group names when
+they are provided in the archive, or looks up the user and
+group names in the system password database.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;no-preserve-owner</b></p>
+
+<p style="margin-left:20%;">(i mode only) Do not attempt to
+restore file ownership. This is the default when run by
+non-root users.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;O</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">Write archive to
+<i>file</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;o</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Output mode.
+See above for description.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;p</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Pass-through
+mode. See above for description.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;preserve-owner</b></p>
+
+<p style="margin-left:20%;">(i mode only) Restore file
+ownership. This is the default when run by the root
+user.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-quiet</b></p>
+
+<p style="margin-left:20%;">Suppress unnecessary
+messages.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;R</b> [
+<br>
+user][ <br>
+:][ <br>
+group]</p>
+
+<p style="margin-left:20%;">Set the owner and/or group on
+files in the output. If group is specified with no user (for
+example, <b>&minus;R</b> <i>:wheel</i>) then the group will
+be set but not the user. If the user is specified with a
+trailing colon and no group (for example, <b>&minus;R</b>
+<i>root:</i>) then the group will be set to the user&rsquo;s
+default group. If the user is specified with no trailing
+colon, then the user will be set but not the group. In
+<b>&minus;i</b> and <b>&minus;p</b> modes, this option can
+only be used by the super-user. (For compatibility, a period
+can be used in place of the colon.)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;r</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(All modes.)
+Rename files interactively. For each file, a prompt is
+written to <i>/dev/tty</i> containing the name of the file
+and a line is read from <i>/dev/tty</i>. If the line read is
+blank, the file is skipped. If the line contains a single
+period, the file is processed normally. Otherwise, the line
+is taken to be the new name of the file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;t</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(i mode only)
+List the contents of the archive to stdout; do not restore
+the contents to disk.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;u</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(i and p modes)
+Unconditionally overwrite existing files. Ordinarily, an
+older file will not overwrite a newer file on disk.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;v</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Print the name
+of each file to stderr as it is processed. With
+<b>&minus;t</b>, provide a detailed listing of each
+file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-version</b></p>
+
+<p style="margin-left:20%;">Print the program version
+information and exit.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;y</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Compress the archive with bzip2-compatible compression
+before writing it. In input mode, this option is ignored;
+bzip2 compression is recognized automatically on input.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;Z</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Compress the archive with compress-compatible compression
+before writing it. In input mode, this option is ignored;
+compression is recognized automatically on input.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;z</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(o mode only)
+Compress the archive with gzip-compatible compression before
+writing it. In input mode, this option is ignored; gzip
+compression is recognized automatically on input.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>ENVIRONMENT</b></p>
+
+<p style="margin-left:8%;">The following environment
+variables affect the execution of <b>cpio</b>:</p>
+
+<p style="margin-top: 1em" valign="top">LANG</p>
+
+<p style="margin-left:25%; margin-top: 1em">The locale to
+use. See environ(7) for more information.</p>
+
+<p style="margin-top: 1em" valign="top">TZ</p>
+
+<p style="margin-left:25%; margin-top: 1em">The timezone to
+use when displaying dates. See environ(7) for more
+information.</p>
+
+<p style="margin-top: 1em" valign="top"><b>EXIT
+STATUS</b></p>
+
+<p style="margin-left:8%;">The <b>cpio</b> utility
+exits&nbsp;0 on success, and&nbsp;&gt;0 if an error
+occurs.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>EXAMPLES</b></p>
+
+<p style="margin-left:8%;">The <b>cpio</b> command is
+traditionally used to copy file heirarchies in conjunction
+with the find(1) command. The first example here simply
+copies all files from <i>src</i> to <i>dest</i>:</p>
+
+<p style="margin-left:17%;"><b>find</b> <i>src</i> |
+<b>cpio &minus;pmud</b> <i>dest</i></p>
+
+<p style="margin-left:8%; margin-top: 1em">By carefully
+selecting options to the find(1) command and combining it
+with other standard utilities, it is possible to exercise
+very fine control over which files are copied. This next
+example copies files from <i>src</i> to <i>dest</i> that are
+more than 2 days old and whose names match a particular
+pattern:</p>
+
+<p style="margin-left:17%;"><b>find</b> <i>src</i>
+<b>&minus;mtime</b> <i>+2</i> | <b>grep foo[bar]</b> |
+<b>cpio &minus;pdmu</b> <i>dest</i></p>
+
+<p style="margin-left:8%; margin-top: 1em">This example
+copies files from <i>src</i> to <i>dest</i> that are more
+than 2 days old and which contain the word
+&lsquo;&lsquo;</p>
+
+<p valign="top">foobar &rsquo;&rsquo;:</p>
+
+<p style="margin-left:17%;"><b>find</b> <i>src</i>
+<b>&minus;mtime</b> <i>+2</i> | <b>xargs grep -l foobar</b>
+| <b>cpio &minus;pdmu</b> <i>dest</i></p>
+
+
+<p style="margin-top: 1em" valign="top"><b>COMPATIBILITY</b></p>
+
+<p style="margin-left:8%;">The mode options i, o, and p and
+the options a, B, c, d, f, l, m, r, t, u, and v comply with
+SUSv2.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The old POSIX.1
+standard specified that only <b>&minus;i</b>,
+<b>&minus;o</b>, and <b>&minus;p</b> were interpreted as
+command-line options. Each took a single argument of a list
+of modifier characters. For example, the standard syntax
+allows <b>&minus;imu</b> but does not support
+<b>&minus;miu</b> or <b>&minus;i &minus;m &minus;u</b>,
+since <i>m</i> and <i>u</i> are only modifiers to
+<b>&minus;i</b>, they are not command-line options in their
+own right. The syntax supported by this implementation is
+backwards-compatible with the standard. For best
+compatibility, scripts should limit themselves to the
+standard syntax.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">bzip2(1), tar(1), gzip(1),
+mt(1), pax(1), libarchive(3), cpio(5),
+libarchive-formats(5), tar(5)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>
+
+<p style="margin-left:8%;">There is no current POSIX
+standard for the cpio command; it appeared in ISO/IEC
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) but was
+dropped from IEEE Std 1003.1-2001
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;).</p>
+
+<p style="margin-left:8%; margin-top: 1em">The cpio, ustar,
+and pax interchange file formats are defined by IEEE Std
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
+pax command.</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The original <b>cpio</b> and
+<b>find</b> utilities were written by Dick Haight while
+working in AT&amp;T&rsquo;s Unix Support Group. They first
+appeared in 1977 in PWB/UNIX 1.0, the
+&lsquo;&lsquo;Programmer&rsquo;s Work Bench&rsquo;&rsquo;
+system developed for use within AT&amp;T. They were first
+released outside of AT&amp;T as part of System III Unix in
+1981. As a result, <b>cpio</b> actually predates <b>tar</b>,
+even though it was not well-known outside of AT&amp;T until
+some time later.</p>
+
+<p style="margin-left:8%; margin-top: 1em">This is a
+complete re-implementation based on the libarchive(3)
+library.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">The cpio archive format has
+several basic limitations: It does not store user and group
+names, only numbers. As a result, it cannot be reliably used
+to transfer files between systems with dissimilar user and
+group numbering. Older cpio formats limit the user and group
+numbers to 16 or 18 bits, which is insufficient for modern
+systems. The cpio archive formats cannot support files over
+4 gigabytes, except for the &lsquo;&lsquo;odc&rsquo;&rsquo;
+variant, which can support files up to 8 gigabytes.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+December&nbsp;21, 2007 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/bsdtar.1.html b/archivers/libarchive/files/doc/html/bsdtar.1.html
new file mode 100644
index 00000000000..3b84d219dea
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/bsdtar.1.html
@@ -0,0 +1,1014 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:40 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">BSDTAR(1) FreeBSD General Commands Manual
+BSDTAR(1)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>tar</b> &mdash; manipulate
+tape archives</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
+
+<p style="margin-left:14%;"><b>tar</b>
+[<i>bundled-flags&nbsp;</i>&lang;</p>
+
+<p valign="top">args &rang;] [&lang; <i><br>
+file</i> &rang;&nbsp;|&nbsp;&lang; <i><br>
+pattern</i> &rang;&nbsp;...]</p>
+
+<p style="margin-left:14%;"><b>tar</b> {<b>&minus;c</b>}
+[<i>options</i>]
+[<i>files&nbsp;</i>|&nbsp;<i>directories</i>] <b><br>
+tar</b> {<b>&minus;r&nbsp;</b>|&nbsp;<b>&minus;u</b>}
+<b>&minus;f</b> <i>archive-file</i> [<i>options</i>]
+[<i>files&nbsp;</i>|&nbsp;<i>directories</i>] <b><br>
+tar</b> {<b>&minus;t&nbsp;</b>|&nbsp;<b>&minus;x</b>}
+[<i>options</i>] [<i>patterns</i>]</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;"><b>tar</b> creates and
+manipulates streaming archive files. This implementation can
+extract from tar, pax, cpio, zip, jar, ar, and ISO 9660
+cdrom images and can create tar, pax, cpio, ar, and shar
+archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The first
+synopsis form shows a &lsquo;&lsquo;bundled&rsquo;&rsquo;
+option word. This usage is provided for compatibility with
+historical implementations. See COMPATIBILITY below for
+details.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The other
+synopsis forms show the preferred usage. The first option to
+<b>tar</b> is a mode indicator from the following list:</p>
+
+<p valign="top"><b>&minus;c</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Create a new
+archive containing the specified items.</p>
+
+<p valign="top"><b>&minus;r</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Like
+<b>&minus;c</b>, but new entries are appended to the
+archive. Note that this only works on uncompressed archives
+stored in regular files. The <b>&minus;f</b> option is
+required.</p>
+
+<p valign="top"><b>&minus;t</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">List archive
+contents to stdout.</p>
+
+<p valign="top"><b>&minus;u</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Like
+<b>&minus;r</b>, but new entries are added only if they have
+a modification date newer than the corresponding entry in
+the archive. Note that this only works on uncompressed
+archives stored in regular files. The <b>&minus;f</b> option
+is required.</p>
+
+<p valign="top"><b>&minus;x</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Extract to disk
+from the archive. If a file with the same name appears more
+than once in the archive, each copy will be extracted, with
+later copies overwriting (replacing) earlier copies.</p>
+
+<p style="margin-left:8%; margin-top: 1em">In
+<b>&minus;c</b>, <b>&minus;r</b>, or <b>&minus;u</b> mode,
+each specified file or directory is added to the archive in
+the order specified on the command line. By default, the
+contents of each directory are also archived.</p>
+
+<p style="margin-left:8%; margin-top: 1em">In extract or
+list mode, the entire command line is read and parsed before
+the archive is opened. The pathnames or patterns on the
+command line indicate which items in the archive should be
+processed. Patterns are shell-style globbing patterns as
+documented in tcsh(1).</p>
+
+<p style="margin-top: 1em" valign="top"><b>OPTIONS</b></p>
+
+<p style="margin-left:8%;">Unless specifically stated
+otherwise, options are applicable in all operating
+modes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>@</b><i>archive</i></p>
+
+<p style="margin-left:20%;">(c and r mode only) The
+specified archive is opened and the entries in it will be
+appended to the current archive. As a simple example,</p>
+
+<p style="margin-left:29%;"><b>tar &minus;c &minus;f</b>
+<i>- newfile</i> <b>@</b><i>original.tar</i></p>
+
+<p style="margin-left:20%;">writes a new archive to
+standard output containing a file <i>newfile</i> and all of
+the entries from <i>original.tar</i>. In contrast,</p>
+
+<p style="margin-left:29%;"><b>tar &minus;c &minus;f</b>
+<i>- newfile original.tar</i></p>
+
+<p style="margin-left:20%;">creates a new archive with only
+two entries. Similarly,</p>
+
+<p style="margin-left:29%;"><b>tar &minus;czf</b> <i>-</i>
+<b>&minus;-format pax @</b><i>-</i></p>
+
+<p style="margin-left:20%;">reads an archive from standard
+input (whose format will be determined automatically) and
+converts it into a gzip-compressed pax-format archive on
+stdout. In this way, <b>tar</b> can be used to convert
+archives from one format to another.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;b</b>
+<i>blocksize</i></p>
+
+<p style="margin-left:20%;">Specify the block size, in
+512-byte records, for tape drive I/O. As a rule, this
+argument is only needed when reading from or writing to tape
+drives, and usually not even then as the default block size
+of 20 records (10240 bytes) is very common.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;C</b>
+<i>directory</i></p>
+
+<p style="margin-left:20%;">In c and r mode, this changes
+the directory before adding the following files. In x mode,
+change directories after opening the archive but before
+extracting entries from the archive.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-check-links</b></p>
+
+<p style="margin-left:20%;">(c and r modes only) Issue a
+warning message unless all links to each file are
+archived.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-chroot</b></p>
+
+<p style="margin-left:20%;">(x mode only) <b>chroot</b>()
+to the current directory after processing any
+<b>&minus;C</b> options and before extracting any files.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-exclude</b>
+<i>pattern</i></p>
+
+<p style="margin-left:20%;">Do not process files or
+directories that match the specified pattern. Note that
+exclusions take precedence over patterns or filenames
+specified on the command line.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-format</b>
+<i>format</i></p>
+
+<p style="margin-left:20%;">(c, r, u mode only) Use the
+specified format for the created archive. Supported formats
+include &lsquo;&lsquo;cpio&rsquo;&rsquo;,
+&lsquo;&lsquo;pax&rsquo;&rsquo;,
+&lsquo;&lsquo;shar&rsquo;&rsquo;, and
+&lsquo;&lsquo;ustar&rsquo;&rsquo;. Other formats may also be
+supported; see libarchive-formats(5) for more information
+about currently-supported formats. In r and u modes, when
+extending an existing archive, the format specified here
+must be compatible with the format of the existing archive
+on disk.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;f</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">Read the archive from or write
+the archive to the specified file. The filename can be
+<i>-</i> for standard input or standard output. If not
+specified, the default tape device will be used. (On
+FreeBSD, the default tape device is <i>/dev/sa0</i>.)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;H</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c and r mode
+only) Symbolic links named on the command line will be
+followed; the target of the link will be archived, not the
+link itself.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;h</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c and r mode
+only) Synonym for <b>&minus;L</b>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;I</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Synonym for
+<b>&minus;T</b>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-include</b>
+<i>pattern</i></p>
+
+<p style="margin-left:20%;">Process only files or
+directories that match the specified pattern. Note that
+exclusions specified with <b>&minus;-exclude</b> take
+precedence over inclusions. If no inclusions are explicitly
+specified, all entries are processed by default. The
+<b>&minus;-include</b> option is especially useful when
+filtering archives. For example, the command</p>
+
+<p style="margin-left:29%;"><b>tar &minus;c &minus;f</b>
+<i>new.tar</i> <b>&minus;-include=&rsquo;*foo*&rsquo;
+@</b><i>old.tgz</i></p>
+
+<p style="margin-left:20%;">creates a new archive
+<i>new.tar</i> containing only the entries from
+<i>old.tgz</i> containing the string &lsquo;foo&rsquo;.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;j</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c mode only)
+Compress the resulting archive with bzip2(1). In extract or
+list modes, this option is ignored. Note that, unlike other
+<b>tar</b> implementations, this implementation recognizes
+bzip2 compression automatically when reading archives.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;k</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode only)
+Do not overwrite existing files. In particular, if a file
+appears more than once in an archive, later copies will not
+overwrite earlier copies.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-keep-newer-files</b></p>
+
+<p style="margin-left:20%;">(x mode only) Do not overwrite
+existing files that are newer than the versions appearing in
+the archive being extracted.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;L</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c and r mode
+only) All symbolic links will be followed. Normally,
+symbolic links are archived as such. With this option, the
+target of the link will be archived instead.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;l</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">This is a
+synonym for the <b>&minus;-check-links</b> option.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;m</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode only)
+Do not extract modification time. By default, the
+modification time is set to the time stored in the
+archive.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;n</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c, r, u modes
+only) Do not recursively archive the contents of
+directories.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-newer</b>
+<i>date</i></p>
+
+<p style="margin-left:20%;">(c, r, u modes only) Only
+include files and directories newer than the specified date.
+This compares ctime entries.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-newer-mtime</b>
+<i>date</i></p>
+
+<p style="margin-left:20%;">(c, r, u modes only) Like
+<b>&minus;-newer</b>, except it compares mtime entries
+instead of ctime entries.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-newer-than</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">(c, r, u modes only) Only
+include files and directories newer than the specified file.
+This compares ctime entries.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-newer-mtime-than</b>
+<i>file</i></p>
+
+<p style="margin-left:20%;">(c, r, u modes only) Like
+<b>&minus;-newer-than</b>, except it compares mtime entries
+instead of ctime entries.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-nodump</b></p>
+
+<p style="margin-left:20%;">(c and r modes only) Honor the
+nodump file flag by skipping this file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-null</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(use with
+<b>&minus;I</b>, <b>&minus;T</b>, or <b>&minus;X</b>)
+Filenames or patterns are separated by null characters, not
+by newlines. This is often used to read filenames output by
+the <b>&minus;print0</b> option to find(1).</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-numeric-owner</b></p>
+
+<p style="margin-left:20%;">(x mode only) Ignore symbolic
+user and group names when restoring archives to disk, only
+numeric uid and gid values will be obeyed.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;O</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x, t modes
+only) In extract (-x) mode, files will be written to
+standard out rather than being extracted to disk. In list
+(-t) mode, the file listing will be written to stderr rather
+than the usual stdout.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;o</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode) Use
+the user and group of the user running the program rather
+than those specified in the archive. Note that this has no
+significance unless <b>&minus;p</b> is specified, and the
+program is being run by the root user. In this case, the
+file modes and flags from the archive will be restored, but
+ACLs or owner information in the archive will be
+discarded.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;o</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c, r, u mode)
+A synonym for <b>&minus;-format</b> <i>ustar</i></p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-one-file-system</b></p>
+
+<p style="margin-left:20%;">(c, r, and u modes) Do not
+cross mount points.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-options</b>
+<i>options</i></p>
+
+<p style="margin-left:20%;">Select optional behaviors for
+particular modules. The argument is a text string containing
+comma-separated keywords and values. These are passed to the
+modules that handle particular formats to control how those
+formats will behave. Each option has one of the following
+forms:</p>
+
+<p valign="top"><i>key=value</i></p>
+
+<p style="margin-left:32%;">The key will be set to the
+specified value in every module that supports it. Modules
+that do not support this key will ignore it.</p>
+
+<p valign="top"><i>key</i></p>
+
+<p style="margin-left:32%; margin-top: 1em">The key will be
+enabled in every module that supports it. This is equivalent
+to <i>key</i><b>=1</b>.</p>
+
+<p valign="top"><i>!key</i></p>
+
+<p style="margin-left:32%; margin-top: 1em">The key will be
+disabled in every module that supports it.</p>
+
+<p valign="top"><i>module:key=value</i>, <i>module:key</i>,
+<i>module:!key</i></p>
+
+<p style="margin-left:32%;">As above, but the corresponding
+key and value will be provided only to modules whose name
+matches <i>module</i>.</p>
+
+<p style="margin-left:20%;">The currently supported modules
+and keys are:</p>
+
+<p valign="top"><b>iso9660:joliet</b></p>
+
+<p style="margin-left:32%;">Support Joliet extensions. This
+is enabled by default, use <b>!joliet</b> or
+<b>iso9660:!joliet</b> to disable.</p>
+
+<p valign="top"><b>iso9660:rockridge</b></p>
+
+<p style="margin-left:32%;">Support Rock Ridge extensions.
+This is enabled by default, use <b>!rockridge</b> or
+<b>iso9660:!rockridge</b> to disable.</p>
+
+<p valign="top"><b>gzip:compression-level</b></p>
+
+<p style="margin-left:32%;">A decimal integer from 0 to 9
+specifying the gzip compression level.</p>
+
+<p valign="top"><b>xz:compression-level</b></p>
+
+<p style="margin-left:32%;">A decimal integer from 0 to 9
+specifying the xz compression level.</p>
+
+<p valign="top"><b>mtree:</b><i>keyword</i></p>
+
+<p style="margin-left:32%;">The mtree writer module allows
+you to specify which mtree keywords will be included in the
+output. Supported keywords include: <b>cksum</b>,
+<b>device</b>, <b>flags</b>, <b>gid</b>, <b>gname</b>,
+<b>indent</b>, <b>link</b>, <b>md5</b>, <b>mode</b>,
+<b>nlink</b>, <b>rmd160</b>, <b>sha1</b>, <b>sha256</b>,
+<b>sha384</b>, <b>sha512</b>, <b>size</b>, <b>time</b>,
+<b>uid</b>, <b>uname</b>. The default is equivalent to:
+&lsquo;&lsquo;device, flags, gid, gname, link, mode, nlink,
+size, time, type, uid, uname&rsquo;&rsquo;.</p>
+
+<p valign="top"><b>mtree:all</b></p>
+
+<p style="margin-left:32%;">Enables all of the above
+keywords. You can also use <b>mtree:!all</b> to disable all
+keywords.</p>
+
+<p valign="top"><b>mtree:use-set</b></p>
+
+<p style="margin-left:32%;">Enable generation of
+<b>/set</b> lines in the output.</p>
+
+<p valign="top"><b>mtree:indent</b></p>
+
+<p style="margin-left:32%;">Produce human-readable output
+by indenting options and splitting lines to fit into 80
+columns.</p>
+
+<p valign="top"><b>zip:compression</b>=<i>type</i></p>
+
+<p style="margin-left:32%;">Use <i>type</i> as compression
+method. Supported values are store (uncompressed) and
+deflate (gzip algorithm).</p>
+
+<p style="margin-left:20%;">If a provided option is not
+supported by any module, that is a fatal error.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;P</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Preserve
+pathnames. By default, absolute pathnames (those that begin
+with a / character) have the leading slash removed both when
+creating archives and extracting from them. Also, <b>tar</b>
+will refuse to extract archive entries whose pathnames
+contain <i>..</i> or whose target directory would be altered
+by a symlink. This option suppresses these behaviors.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;p</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode only)
+Preserve file permissions. Attempt to restore the full
+permissions, including owner, file modes, file flags and
+ACLs, if available, for each item extracted from the
+archive. By default, newly-created files are owned by the
+user running <b>tar</b>, the file mode is restored for
+newly-created regular files, and all other types of entries
+receive default permissions. If <b>tar</b> is being run by
+root, the default is to restore the owner unless the
+<b>&minus;o</b> option is also specified.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;q</b>
+(<b>&minus;-fast-read</b>)</p>
+
+<p style="margin-left:20%;">(x and t mode only) Extract or
+list only the first archive entry that matches each pattern
+or filename operand. Exit as soon as each specified pattern
+or filename has been matched. By default, the archive is
+always read to the very end, since there can be multiple
+entries with the same name and, by convention, later entries
+overwrite earlier entries. This option is provided as a
+performance optimization.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;S</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode only)
+Extract files as sparse files. For every block on disk,
+check first if it contains only NULL bytes and seek over it
+otherwise. This works similiar to the conv=sparse option of
+dd.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-strip-components</b>
+<i>count</i></p>
+
+<p style="margin-left:20%;">(x mode only) Remove the
+specified number of leading path elements. Pathnames with
+fewer elements will be silently skipped. Note that the
+pathname is edited after checking inclusion/exclusion
+patterns but before security checks.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;s</b>
+<i>pattern</i></p>
+
+<p style="margin-left:20%;">Modify file or archive member
+names according to <i>pattern</i>. The pattern has the
+format <i>/old/new/</i>[gps] where <i>old</i> is a basic
+regular expression, <i>new</i> is the replacement string of
+the matched part, and the optional trailing letters modify
+how the replacement is handled. If <i>old</i> is not
+matched, the pattern is skipped. Within <i>new</i>, ~ is
+substituted with the match, 1 to 9 with the content of the
+corresponding captured group. The optional trailing g
+specifies that matching should continue after the matched
+part and stopped on the first unmatched pattern. The
+optional trailing s specifies that the pattern applies to
+the value of symbolic links. The optional trailing p
+specifies that after a successful substitution the original
+path name and the new path name should be printed to
+standard error.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;T</b>
+<i>filename</i></p>
+
+<p style="margin-left:20%;">In x or t mode, <b>tar</b> will
+read the list of names to be extracted from <i>filename</i>.
+In c mode, <b>tar</b> will read names to be archived from
+<i>filename</i>. The special name
+&lsquo;&lsquo;-C&rsquo;&rsquo; on a line by itself will
+cause the current directory to be changed to the directory
+specified on the following line. Names are terminated by
+newlines unless <b>&minus;-null</b> is specified. Note that
+<b>&minus;-null</b> also disables the special handling of
+lines containing &lsquo;&lsquo;-C&rsquo;&rsquo;.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;U</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(x mode only)
+Unlink files before creating them. Without this option,
+<b>tar</b> overwrites existing files, which preserves
+existing hardlinks. With this option, existing hardlinks
+will be broken, as will any symlink that would affect the
+location of an extracted file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-use-compress-program</b>
+<i>program</i></p>
+
+<p style="margin-left:20%;">Pipe the input (in x or t mode)
+or the output (in c mode) through <i>program</i> instead of
+using the builtin compression support.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;v</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Produce verbose
+output. In create and extract modes, <b>tar</b> will list
+each file name as it is read from or written to the archive.
+In list mode, <b>tar</b> will produce output similar to that
+of ls(1). Additional <b>&minus;v</b> options will provide
+additional detail.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;-version</b></p>
+
+<p style="margin-left:20%;">Print version of <b>tar</b> and
+<b>libarchive</b>, and exit.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;w</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">Ask for
+confirmation for every action.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&minus;X</b>
+<i>filename</i></p>
+
+<p style="margin-left:20%;">Read a list of exclusion
+patterns from the specified file. See <b>&minus;-exclude</b>
+for more information about the handling of exclusions.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;y</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c mode only)
+Compress the resulting archive with bzip2(1). In extract or
+list modes, this option is ignored. Note that, unlike other
+<b>tar</b> implementations, this implementation recognizes
+bzip2 compression automatically when reading archives.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;z</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c mode only)
+Compress the resulting archive with gzip(1). In extract or
+list modes, this option is ignored. Note that, unlike other
+<b>tar</b> implementations, this implementation recognizes
+gzip compression automatically when reading archives.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;Z</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">(c mode only)
+Compress the resulting archive with compress(1). In extract
+or list modes, this option is ignored. Note that, unlike
+other <b>tar</b> implementations, this implementation
+recognizes compress compression automatically when reading
+archives.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>ENVIRONMENT</b></p>
+
+<p style="margin-left:8%;">The following environment
+variables affect the execution of <b>tar</b>:</p>
+
+<p style="margin-top: 1em" valign="top">LANG</p>
+
+<p style="margin-left:25%; margin-top: 1em">The locale to
+use. See environ(7) for more information.</p>
+
+<p style="margin-top: 1em" valign="top">TAPE</p>
+
+<p style="margin-left:25%; margin-top: 1em">The default
+tape device. The <b>&minus;f</b> option overrides this.</p>
+
+<p style="margin-top: 1em" valign="top">TZ</p>
+
+<p style="margin-left:25%; margin-top: 1em">The timezone to
+use when displaying dates. See environ(7) for more
+information.</p>
+
+<p style="margin-top: 1em" valign="top"><b>FILES</b> <br>
+/dev/sa0</p>
+
+<p style="margin-left:25%; margin-top: 1em">The default
+tape device, if not overridden by the TAPE environment
+variable or the <b>&minus;f</b> option.</p>
+
+<p style="margin-top: 1em" valign="top"><b>EXIT
+STATUS</b></p>
+
+<p style="margin-left:8%;">The <b>tar</b> utility
+exits&nbsp;0 on success, and&nbsp;&gt;0 if an error
+occurs.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>EXAMPLES</b></p>
+
+<p style="margin-left:8%;">The following creates a new
+archive called <i>file.tar.gz</i> that contains two files
+<i>source.c</i> and <i>source.h</i>:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;czf</b>
+<i>file.tar.gz source.c source.h</i></p>
+
+<p style="margin-left:8%; margin-top: 1em">To view a
+detailed table of contents for this archive:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;tvf</b>
+<i>file.tar.gz</i></p>
+
+<p style="margin-left:8%; margin-top: 1em">To extract all
+entries from the archive on the default tape drive:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;x</b></p>
+
+<p style="margin-left:8%; margin-top: 1em">To examine the
+contents of an ISO 9660 cdrom image:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;tf</b>
+<i>image.iso</i></p>
+
+<p style="margin-left:8%; margin-top: 1em">To move file
+hierarchies, invoke <b>tar</b> as</p>
+
+<p style="margin-left:17%;"><b>tar &minus;cf</b> <i>-</i>
+<b>&minus;C</b> <i>srcdir&nbsp;.</i> | <b>tar &minus;xpf</b>
+<i>-</i> <b>&minus;C</b> <i>destdir</i></p>
+
+<p style="margin-left:8%;">or more traditionally</p>
+
+<p style="margin-left:17%;">cd srcdir ; <b>tar
+&minus;cf</b> <i>-&nbsp;.</i> | (<i>cd destdir ;</i> <b>tar
+&minus;xpf</b> <i>-</i>)</p>
+
+<p style="margin-left:8%; margin-top: 1em">In create mode,
+the list of files and directories to be archived can also
+include directory change instructions of the form
+<b>-C</b><i>foo/baz</i> and archive inclusions of the form
+<b>@</b><i>archive-file</i>. For example, the command
+line</p>
+
+<p style="margin-left:17%;"><b>tar &minus;c &minus;f</b>
+<i>new.tar foo1</i> <b>@</b><i>old.tgz</i> <b>-C</b><i>/tmp
+foo2</i></p>
+
+<p style="margin-left:8%;">will create a new archive
+<i>new.tar</i>. <b>tar</b> will read the file <i>foo1</i>
+from the current directory and add it to the output archive.
+It will then read each entry from <i>old.tgz</i> and add
+those entries to the output archive. Finally, it will switch
+to the <i>/tmp</i> directory and add <i>foo2</i> to the
+output archive.</p>
+
+<p style="margin-left:8%; margin-top: 1em">An input file in
+mtree(5) format can be used to create an output archive with
+arbitrary ownership, permissions, or names that differ from
+existing data on disk:</p>
+
+<p style="margin-left:17%; margin-top: 1em">$ cat
+input.mtree <br>
+#mtree <br>
+usr/bin uid=0 gid=0 mode=0755 type=dir <br>
+usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls <br>
+$ tar -cvf output.tar @input.mtree</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+<b>&minus;-newer</b> and <b>&minus;-newer-mtime</b> switches
+accept a variety of common date and time specifications,
+including &lsquo;&lsquo;12 Mar 2005 7:14:29pm&rsquo;&rsquo;,
+&lsquo;&lsquo;2005-03-12 19:14&rsquo;&rsquo;,
+&lsquo;&lsquo;5 minutes ago&rsquo;&rsquo;, and
+&lsquo;&lsquo;19:14 PST May 1&rsquo;&rsquo;.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+<b>&minus;-options</b> argument can be used to control
+various details of archive generation or reading. For
+example, you can generate mtree output which only contains
+<b>type</b>, <b>time</b>, and <b>uid</b> keywords:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;cf</b>
+<i>file.tar</i> <b>&minus;-format=mtree
+&minus;-options=&rsquo;!all,type,time,uid&rsquo;</b>
+<i>dir</i></p>
+
+<p style="margin-left:8%;">or you can set the compression
+level used by gzip or xz compression:</p>
+
+<p style="margin-left:17%;"><b>tar &minus;czf</b>
+<i>file.tar</i>
+<b>&minus;-options=&rsquo;compression-level=9&rsquo;</b>.</p>
+
+<p style="margin-left:8%;">For more details, see the
+explanation of the <b>archive_read_set_options</b>() and
+<b>archive_write_set_options</b>() API calls that are
+described in archive_read(3) and archive_write(3).</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>COMPATIBILITY</b></p>
+
+<p style="margin-left:8%;">The bundled-arguments format is
+supported for compatibility with historic implementations.
+It consists of an initial word (with no leading - character)
+in which each character indicates an option. Arguments
+follow as separate words. The order of the arguments must
+match the order of the corresponding characters in the
+bundled command word. For example,</p>
+
+<p style="margin-left:17%;"><b>tar tbf 32</b>
+<i>file.tar</i></p>
+
+<p style="margin-left:8%;">specifies three flags <b>t</b>,
+<b>b</b>, and <b>f</b>. The <b>b</b> and <b>f</b> flags both
+require arguments, so there must be two additional items on
+the command line. The <i>32</i> is the argument to the
+<b>b</b> flag, and <i>file.tar</i> is the argument to the
+<b>f</b> flag.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The mode options
+c, r, t, u, and x and the options b, f, l, m, o, v, and w
+comply with SUSv2.</p>
+
+<p style="margin-left:8%; margin-top: 1em">For maximum
+portability, scripts that invoke <b>tar</b> should use the
+bundled-argument format above, should limit themselves to
+the <b>c</b>, <b>t</b>, and <b>x</b> modes, and the
+<b>b</b>, <b>f</b>, <b>m</b>, <b>v</b>, and <b>w</b>
+options.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Additional long
+options are provided to improve compatibility with other tar
+implementations.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SECURITY</b></p>
+
+<p style="margin-left:8%;">Certain security issues are
+common to many archiving programs, including <b>tar</b>. In
+particular, carefully-crafted archives can request that
+<b>tar</b> extract files to locations outside of the target
+directory. This can potentially be used to cause unwitting
+users to overwrite files they did not intend to overwrite.
+If the archive is being extracted by the superuser, any file
+on the system can potentially be overwritten. There are
+three ways this can happen. Although <b>tar</b> has
+mechanisms to protect against each one, savvy users should
+be aware of the implications:</p>
+
+<p style="margin-top: 1em" valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">Archive entries can have
+absolute pathnames. By default, <b>tar</b> removes the
+leading <i>/</i> character from filenames before restoring
+them to guard against this problem.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">Archive entries can have
+pathnames that include <i>..</i> components. By default,
+<b>tar</b> will not extract files containing <i>..</i>
+components in their pathname.</p>
+
+<p style="margin-top: 1em" valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">Archive entries can exploit
+symbolic links to restore files to other directories. An
+archive can restore a symbolic link to another directory,
+then use that link to restore a file into that directory. To
+guard against this, <b>tar</b> checks each extracted path
+for symlinks. If the final path element is a symlink, it
+will be removed and replaced with the archive entry. If
+<b>&minus;U</b> is specified, any intermediate symlink will
+also be unconditionally removed. If neither <b>&minus;U</b>
+nor <b>&minus;P</b> is specified, <b>tar</b> will refuse to
+extract the entry.</p>
+
+<p style="margin-left:8%;">To protect yourself, you should
+be wary of any archives that come from untrusted sources.
+You should examine the contents of an archive with</p>
+
+<p style="margin-left:17%;"><b>tar &minus;tf</b>
+<i>filename</i></p>
+
+<p style="margin-left:8%;">before extraction. You should
+use the <b>&minus;k</b> option to ensure that <b>tar</b>
+will not overwrite any existing files or the <b>&minus;U</b>
+option to remove any pre-existing files. You should
+generally not extract archives while running with super-user
+privileges. Note that the <b>&minus;P</b> option to
+<b>tar</b> disables the security checks above and allows you
+to extract an archive while preserving any absolute
+pathnames, <i>..</i> components, or symlinks to other
+directories.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">bzip2(1), compress(1), cpio(1),
+gzip(1), mt(1), pax(1), shar(1), libarchive(3),
+libarchive-formats(5), tar(5)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>
+
+<p style="margin-left:8%;">There is no current POSIX
+standard for the tar command; it appeared in ISO/IEC
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) but was
+dropped from IEEE Std 1003.1-2001
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). The options used by
+this implementation were developed by surveying a number of
+existing tar implementations as well as the old POSIX
+specification for tar and the current POSIX specification
+for pax.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The ustar and
+pax interchange file formats are defined by IEEE Std
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
+pax command.</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">A <b>tar</b> command appeared in
+Seventh Edition Unix, which was released in January, 1979.
+There have been numerous other implementations, many of
+which extended the file format. John Gilmore&rsquo;s
+<b>pdtar</b> public-domain implementation (circa November,
+1987) was quite influential, and formed the basis of GNU
+tar. GNU tar was included as the standard system tar in
+FreeBSD beginning with FreeBSD&nbsp;1.0.</p>
+
+<p style="margin-left:8%; margin-top: 1em">This is a
+complete re-implementation based on the libarchive(3)
+library.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">This program follows ISO/IEC
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
+definition of the <b>&minus;l</b> option. Note that GNU tar
+prior to version 1.15 treated <b>&minus;l</b> as a synonym
+for the <b>&minus;-one-file-system</b> option.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+<b>&minus;C</b> <i>dir</i> option may differ from historic
+implementations.</p>
+
+<p style="margin-left:8%; margin-top: 1em">All archive
+output is written in correctly-sized blocks, even if the
+output is being compressed. Whether or not the last output
+block is padded to a full block size varies depending on the
+format and the output device. For tar and cpio formats, the
+last block of output is padded to a full block size if the
+output is being written to standard output or to a character
+or block device such as a tape drive. If the output is being
+written to a regular file, the last block will not be
+padded. Many compressors, including gzip(1) and bzip2(1),
+complain about the null padding when decompressing an
+archive created by <b>tar</b>, although they still extract
+it correctly.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The compression
+and decompression is implemented internally, so there may be
+insignificant differences between the compressed output
+generated by</p>
+
+<p style="margin-left:17%;"><b>tar &minus;czf</b> <i>-
+file</i></p>
+
+<p style="margin-left:8%;">and that generated by</p>
+
+<p style="margin-left:17%;"><b>tar &minus;cf</b> <i>-
+file</i> | <b>gzip</b></p>
+
+<p style="margin-left:8%; margin-top: 1em">The default
+should be to read and write archives to the standard I/O
+paths, but tradition (and POSIX) dictates otherwise.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The <b>r</b> and
+<b>u</b> modes require that the archive be uncompressed and
+located in a regular file on disk. Other archives can be
+modified using <b>c</b> mode with the <i>@archive-file</i>
+extension.</p>
+
+<p style="margin-left:8%; margin-top: 1em">To archive a
+file called <i>@foo</i> or <i>-foo</i> you must specify it
+as <i>./@foo</i> or <i>./-foo</i>, respectively.</p>
+
+<p style="margin-left:8%; margin-top: 1em">In create mode,
+a leading <i>./</i> is always removed. A leading <i>/</i> is
+stripped unless the <b>&minus;P</b> option is specified.</p>
+
+<p style="margin-left:8%; margin-top: 1em">There needs to
+be better support for file selection on both create and
+extract.</p>
+
+<p style="margin-left:8%; margin-top: 1em">There is not yet
+any support for multi-volume archives or for archiving
+sparse files.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Converting
+between dissimilar archive formats (such as tar and cpio)
+using the <b>@</b><i>-</i> convention can cause hard link
+information to be lost. (This is a consequence of the
+incompatible ways that different archive formats store
+hardlink information.)</p>
+
+<p style="margin-left:8%; margin-top: 1em">There are
+alternative long options for many of the short options that
+are deliberately not documented.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+Oct&nbsp;12, 2009 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/cpio.5.html b/archivers/libarchive/files/doc/html/cpio.5.html
new file mode 100644
index 00000000000..8d4768d66d7
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/cpio.5.html
@@ -0,0 +1,422 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:34 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">CPIO(5) FreeBSD File Formats Manual
+CPIO(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>cpio</b> &mdash; format of
+cpio archive files</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">The <b>cpio</b> archive format
+collects any number of files, directories, and other file
+system objects (symbolic links, device nodes, etc.) into a
+single stream of bytes.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>General
+Format</b> <br>
+Each file system object in a <b>cpio</b> archive comprises a
+header record with basic numeric metadata followed by the
+full pathname of the entry and the file data. The header
+record stores a series of integer values that generally
+follow the fields in <i>struct stat</i>. (See stat(2) for
+details.) The variants differ primarily in how they store
+those integers (binary, octal, or hexadecimal). The header
+is followed by the pathname of the entry (the length of the
+pathname is stored in the header) and any file data. The end
+of the archive is indicated by a special record with the
+pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>PWB
+format</b> <br>
+XXX Any documentation of the original PWB/UNIX 1.0 format?
+XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Old Binary
+Format</b> <br>
+The old binary <b>cpio</b> format stores numbers as 2-byte
+and 4-byte binary values. Each entry begins with a header in
+the following format:</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+header_old_cpio { <br>
+unsigned short c_magic; <br>
+unsigned short c_dev; <br>
+unsigned short c_ino; <br>
+unsigned short c_mode; <br>
+unsigned short c_uid; <br>
+unsigned short c_gid; <br>
+unsigned short c_nlink; <br>
+unsigned short c_rdev;</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">unsigned short c_mtime[2];</p></td>
+<td width="58%">
+</td>
+</table>
+
+<p style="margin-left:17%;">unsigned short c_namesize;</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="71%">
+
+
+<p valign="top">unsigned short c_filesize[2];</p></td>
+</table>
+
+<p style="margin-left:17%;">};</p>
+
+<p style="margin-left:8%; margin-top: 1em">The <i>unsigned
+short</i> fields here are 16-bit integer values; the
+<i>unsigned int</i> fields are 32-bit integer values. The
+fields are as follows</p>
+
+<p style="margin-top: 1em" valign="top"><i>magic</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">The integer
+value octal 070707. This value can be used to determine
+whether this archive is written with little-endian or
+big-endian integers.</p>
+
+<p style="margin-top: 1em" valign="top"><i>dev</i>,
+<i>ino</i></p>
+
+<p style="margin-left:20%;">The device and inode numbers
+from the disk. These are used by programs that read
+<b>cpio</b> archives to determine when two entries refer to
+the same file. Programs that synthesize <b>cpio</b> archives
+should be careful to set these to distinct values for each
+entry.</p>
+
+<p style="margin-top: 1em" valign="top"><i>mode</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">The mode
+specifies both the regular permissions and the file type. It
+consists of several bit fields as follows:</p>
+
+<p valign="top">0170000</p>
+
+<p style="margin-left:34%; margin-top: 1em">This masks the
+file type bits.</p>
+
+<p valign="top">0140000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for sockets.</p>
+
+<p valign="top">0120000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for symbolic links. For symbolic links, the link body is
+stored as file data.</p>
+
+<p valign="top">0100000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for regular files.</p>
+
+<p valign="top">0060000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for block special devices.</p>
+
+<p valign="top">0040000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for directories.</p>
+
+<p valign="top">0020000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for character special devices.</p>
+
+<p valign="top">0010000</p>
+
+<p style="margin-left:34%; margin-top: 1em">File type value
+for named pipes or FIFOs.</p>
+
+<p valign="top">0004000</p>
+
+<p style="margin-left:34%; margin-top: 1em">SUID bit.</p>
+
+<p valign="top">0002000</p>
+
+<p style="margin-left:34%; margin-top: 1em">SGID bit.</p>
+
+<p valign="top">0001000</p>
+
+<p style="margin-left:34%; margin-top: 1em">Sticky bit. On
+some systems, this modifies the behavior of executables
+and/or directories.</p>
+
+<p valign="top">0000777</p>
+
+<p style="margin-left:34%; margin-top: 1em">The lower 9
+bits specify read/write/execute permissions for world,
+group, and user following standard POSIX conventions.</p>
+
+<p style="margin-top: 1em" valign="top"><i>uid</i>,
+<i>gid</i></p>
+
+<p style="margin-left:20%;">The numeric user id and group
+id of the owner.</p>
+
+<p style="margin-top: 1em" valign="top"><i>nlink</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">The number of
+links to this file. Directories always have a value of at
+least two here. Note that hardlinked files include file data
+with every copy in the archive.</p>
+
+<p style="margin-top: 1em" valign="top"><i>rdev</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">For block
+special and character special entries, this field contains
+the associated device number. For all other entry types, it
+should be set to zero by writers and ignored by readers.</p>
+
+<p style="margin-top: 1em" valign="top"><i>mtime</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">Modification
+time of the file, indicated as the number of seconds since
+the start of the epoch, 00:00:00 UTC January 1, 1970. The
+four-byte integer is stored with the most-significant 16
+bits first followed by the least-significant 16 bits. Each
+of the two 16 bit values are stored in machine-native byte
+order.</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>namesize</i></p>
+
+<p style="margin-left:20%;">The number of bytes in the
+pathname that follows the header. This count includes the
+trailing NUL byte.</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>filesize</i></p>
+
+<p style="margin-left:20%;">The size of the file. Note that
+this archive format is limited to four gigabyte file sizes.
+See <i>mtime</i> above for a description of the storage of
+four-byte integers.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The pathname
+immediately follows the fixed header. If the <b>namesize</b>
+is odd, an additional NUL byte is added after the pathname.
+The file data is then appended, padded with NUL bytes to an
+even length.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Hardlinked files
+are not given special treatment; the full file contents are
+included with each copy of the file.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Portable
+ASCII Format</b> <br>
+Version&nbsp;2 of the Single UNIX Specification
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
+variant that is portable across all platforms. It is
+commonly known as the &lsquo;&lsquo;old
+character&rsquo;&rsquo; format or as the
+&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
+numeric fields as the old binary format, but represents them
+as 6-character or 11-character octal values.</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+cpio_odc_header { <br>
+char c_magic[6]; <br>
+char c_dev[6]; <br>
+char c_ino[6]; <br>
+char c_mode[6]; <br>
+char c_uid[6]; <br>
+char c_gid[6]; <br>
+char c_nlink[6]; <br>
+char c_rdev[6]; <br>
+char c_mtime[11]; <br>
+char c_namesize[6]; <br>
+char c_filesize[11]; <br>
+};</p>
+
+<p style="margin-left:8%; margin-top: 1em">The fields are
+identical to those in the old binary format. The name and
+file body follow the fixed header. Unlike the old binary
+format, there is no additional padding after the pathname or
+file contents. If the files being archived are themselves
+entirely ASCII, then the resulting archive will be entirely
+ASCII, except for the NUL byte that terminates the name
+field.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>New ASCII
+Format</b> <br>
+The &quot;new&quot; ASCII format uses 8-byte hexadecimal
+fields for all numbers and separates device numbers into
+separate fields for major and minor numbers.</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+cpio_newc_header { <br>
+char c_magic[6]; <br>
+char c_ino[8]; <br>
+char c_mode[8]; <br>
+char c_uid[8]; <br>
+char c_gid[8]; <br>
+char c_nlink[8]; <br>
+char c_mtime[8]; <br>
+char c_filesize[8]; <br>
+char c_devmajor[8]; <br>
+char c_devminor[8]; <br>
+char c_rdevmajor[8]; <br>
+char c_rdevminor[8]; <br>
+char c_namesize[8]; <br>
+char c_check[8]; <br>
+};</p>
+
+<p style="margin-left:8%; margin-top: 1em">Except as
+specified below, the fields here match those specified for
+the old binary format above.</p>
+
+<p style="margin-top: 1em" valign="top"><i>magic</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">The string
+&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>
+
+<p style="margin-top: 1em" valign="top"><i>check</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">This field is
+always set to zero by writers and ignored by readers. See
+the next section for more details.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The pathname is
+followed by NUL bytes so that the total size of the fixed
+header plus pathname is a multiple of four. Likewise, the
+file data is padded to a multiple of four bytes. Note that
+this format supports only 4 gigabyte files (unlike the older
+ASCII format, which supports 8 gigabyte files).</p>
+
+<p style="margin-left:8%; margin-top: 1em">In this format,
+hardlinked files are handled by setting the filesize to zero
+for each entry except the last one that appears in the
+archive.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>New CRC
+Format</b> <br>
+The CRC format is identical to the new ASCII format
+described in the previous section except that the magic
+field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
+<i>check</i> field is set to the sum of all bytes in the
+file data. This sum is computed treating all bytes as
+unsigned values and using unsigned arithmetic. Only the
+least-significant 32 bits of the sum are stored.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>HP
+variants</b> <br>
+The <b>cpio</b> implementation distributed with HPUX used
+XXXX but stored device numbers differently XXX.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Other
+Extensions and Variants</b> <br>
+Sun Solaris uses additional file types to store extended
+file data, including ACLs and extended attributes, as
+special entries in cpio archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em">XXX Others?
+XXX</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">The
+&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
+uses a simple checksum and not a cyclic redundancy
+check.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The old binary
+format is limited to 16 bits for user id, group id, device,
+and inode numbers. It is limited to 4 gigabyte file
+sizes.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The old ASCII
+format is limited to 18 bits for the user id, group id,
+device, and inode numbers. It is limited to 8 gigabyte file
+sizes.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The new ASCII
+format is limited to 4 gigabyte file sizes.</p>
+
+<p style="margin-left:8%; margin-top: 1em">None of the cpio
+formats store user or group names, which are essential when
+moving files between systems with dissimilar user or group
+numbering.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Especially when
+writing older cpio variants, it may be necessary to map
+actual device/inode values to synthesized values that fit
+the available fields. With very large filesystems, this may
+be necessary even for the newer formats.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">cpio(1), tar(5)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>
+
+<p style="margin-left:8%;">The <b>cpio</b> utility is no
+longer a part of POSIX or the Single Unix Standard. It last
+appeared in Version&nbsp;2 of the Single UNIX Specification
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
+in subsequent standards by pax(1). The portable ASCII format
+is currently part of the specification for the pax(1)
+utility.</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The original cpio utility was
+written by Dick Haight while working in AT&amp;T&rsquo;s
+Unix Support Group. It appeared in 1977 as part of PWB/UNIX
+1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
+Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
+UNIX that was used internally at AT&amp;T. Both the old
+binary and old character formats were in use by 1980,
+according to the System III source released by SCO under
+their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
+character format was adopted as part of IEEE Std 1003.1-1988
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
+&quot;newc&quot; appear? Who invented it? When did HP come
+out with their variant? When did Sun introduce ACLs and
+extended attributes? XXX</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+October&nbsp;5, 2007 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/libarchive-formats.5.html b/archivers/libarchive/files/doc/html/libarchive-formats.5.html
new file mode 100644
index 00000000000..db26b1e195b
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/libarchive-formats.5.html
@@ -0,0 +1,375 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:35 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">libarchive-formats(5) FreeBSD File Formats
+Manual libarchive-formats(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>libarchive-formats</b>
+&mdash; archive formats supported by the libarchive
+library</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">The libarchive(3) library reads
+and writes a variety of streaming archive formats. Generally
+speaking, all of these archive formats consist of a series
+of &lsquo;&lsquo;entries&rsquo;&rsquo;. Each entry stores a
+single file system object, such as a file, directory, or
+symbolic link.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The following
+provides a brief description of each format supported by
+libarchive, with some information about recognized
+extensions or limitations of the current library support.
+Note that just because a format is supported by libarchive
+does not imply that a program that uses libarchive will
+support that format. Applications that use libarchive
+specify which formats they wish to support, though many
+programs do use libarchive convenience functions to enable
+all supported formats.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Tar
+Formats</b> <br>
+The libarchive(3) library can read most tar archives.
+However, it only writes POSIX-standard
+&lsquo;&lsquo;ustar&rsquo;&rsquo; and &lsquo;&lsquo;pax
+interchange&rsquo;&rsquo; formats.</p>
+
+<p style="margin-left:8%; margin-top: 1em">All tar formats
+store each entry in one or more 512-byte records. The first
+record is used for file metadata, including filename,
+timestamp, and mode information, and the file data is stored
+in subsequent records. Later variants have extended this by
+either appropriating undefined areas of the header record,
+extending the header to multiple records, or by storing
+special entries that modify the interpretation of subsequent
+entries.</p>
+
+<p style="margin-top: 1em" valign="top"><b>gnutar</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The
+libarchive(3) library can read GNU-format tar archives. It
+currently supports the most popular GNU extensions,
+including modern long filename and linkname support, as well
+as atime and ctime data. The libarchive library does not
+support multi-volume archives, nor the old GNU long filename
+format. It can read GNU sparse file entries, including the
+new POSIX-based formats, but cannot write GNU sparse file
+entries.</p>
+
+<p style="margin-top: 1em" valign="top"><b>pax</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The
+libarchive(3) library can read and write POSIX-compliant pax
+interchange format archives. Pax interchange format archives
+are an extension of the older ustar format that adds a
+separate entry with additional attributes stored as
+key/value pairs immediately before each regular entry. The
+presence of these additional entries is the only difference
+between pax interchange format and the older ustar format.
+The extended attributes are of unlimited length and are
+stored as UTF-8 Unicode strings. Keywords defined in the
+standard are in all lowercase; vendors are allowed to define
+custom keys by preceding them with the vendor name in all
+uppercase. When writing pax archives, libarchive uses many
+of the SCHILY keys defined by Joerg Schilling&rsquo;s
+&lsquo;&lsquo;star&rsquo;&rsquo; archiver and a few
+LIBARCHIVE keys. The libarchive library can read most of the
+SCHILY keys and most of the GNU keys introduced by GNU tar.
+It silently ignores any keywords that it does not
+understand.</p>
+
+<p style="margin-top: 1em" valign="top"><b>restricted
+pax</b></p>
+
+<p style="margin-left:20%;">The libarchive library can also
+write pax archives in which it attempts to suppress the
+extended attributes entry whenever possible. The result will
+be identical to a ustar archive unless the extended
+attributes entry is required to store a long file name, long
+linkname, extended ACL, file flags, or if any of the
+standard ustar data (user name, group name, UID, GID, etc)
+cannot be fully represented in the ustar header. In all
+cases, the result can be dearchived by any program that can
+read POSIX-compliant pax interchange format archives.
+Programs that correctly read ustar format (see below) will
+also be able to read this format; any extended attributes
+will be extracted as separate files stored in
+<i>PaxHeader</i> directories.</p>
+
+<p style="margin-top: 1em" valign="top"><b>ustar</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The libarchive
+library can both read and write this format. This format has
+the following limitations:</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:26%;">Device major and minor numbers
+are limited to 21 bits. Nodes with larger numbers will not
+be added to the archive.</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:26%;">Path names in the archive are
+limited to 255 bytes. (Shorter if there is no / character in
+exactly the right place.)</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:26%;">Symbolic links and hard links
+are stored in the archive with the name of the referenced
+file. This name is limited to 100 bytes.</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:26%;">Extended attributes, file
+flags, and other extended security information cannot be
+stored.</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:26%;">Archive entries are limited to
+8 gigabytes in size.</p>
+
+<p style="margin-left:20%;">Note that the pax interchange
+format has none of these restrictions.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The libarchive
+library also reads a variety of commonly-used extensions to
+the basic tar format. These extensions are recognized
+automatically whenever they appear.</p>
+
+<p style="margin-top: 1em" valign="top">Numeric
+extensions.</p>
+
+<p style="margin-left:20%;">The POSIX standards require
+fixed-length numeric fields to be written with some
+character position reserved for terminators. Libarchive
+allows these fields to be written without terminator
+characters. This extends the allowable range; in particular,
+ustar archives with this extension can support entries up to
+64 gigabytes in size. Libarchive also recognizes base-256
+values in most numeric fields. This essentially removes all
+limitations on file size, modification time, and device
+numbers.</p>
+
+<p style="margin-top: 1em" valign="top">Solaris
+extensions</p>
+
+<p style="margin-left:20%;">Libarchive recognizes ACL and
+extended attribute records written by Solaris tar.
+Currently, libarchive only has support for old-style ACLs;
+the newer NFSv4 ACLs are recognized but discarded.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The first tar
+program appeared in Seventh Edition Unix in 1979. The first
+official standard for the tar file format was the
+&lsquo;&lsquo;ustar&rsquo;&rsquo; (Unix Standard Tar) format
+defined by POSIX in 1988. POSIX.1-2001 extended the ustar
+format to create the &lsquo;&lsquo;pax
+interchange&rsquo;&rsquo; format.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Cpio
+Formats</b> <br>
+The libarchive library can read a number of common cpio
+variants and can write &lsquo;&lsquo;odc&rsquo;&rsquo; and
+&lsquo;&lsquo;newc&rsquo;&rsquo; format archives. A cpio
+archive stores each entry as a fixed-size header followed by
+a variable-length filename and variable-length data. Unlike
+the tar format, the cpio format does only minimal padding of
+the header or file data. There are several cpio variants,
+which differ primarily in how they store the initial header:
+some store the values as octal or hexadecimal numbers in
+ASCII, others as binary values of varying byte order and
+length.</p>
+
+<p style="margin-top: 1em" valign="top"><b>binary</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The libarchive
+library transparently reads both big-endian and
+little-endian variants of the original binary cpio format.
+This format used 32-bit binary values for file size and
+mtime, and 16-bit binary values for the other fields.</p>
+
+<p style="margin-top: 1em" valign="top"><b>odc</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The libarchive
+library can both read and write this POSIX-standard format,
+which is officially known as the &lsquo;&lsquo;cpio
+interchange format&rsquo;&rsquo; or the
+&lsquo;&lsquo;octet-oriented cpio archive
+format&rsquo;&rsquo; and sometimes unofficially referred to
+as the &lsquo;&lsquo;old character format&rsquo;&rsquo;.
+This format stores the header contents as octal values in
+ASCII. It is standard, portable, and immune from byte-order
+confusion. File sizes and mtime are limited to 33 bits (8GB
+file size), other fields are limited to 18 bits.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SVR4</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The libarchive
+library can read both CRC and non-CRC variants of this
+format. The SVR4 format uses eight-digit hexadecimal values
+for all header fields. This limits file size to 4GB, and
+also limits the mtime and other fields to 32 bits. The SVR4
+format can optionally include a CRC of the file contents,
+although libarchive does not currently verify this CRC.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Cpio first
+appeared in PWB/UNIX 1.0, which was released within AT&amp;T
+in 1977. PWB/UNIX 1.0 formed the basis of System III Unix,
+released outside of AT&amp;T in 1981. This makes cpio older
+than tar, although cpio was not included in Version 7
+AT&amp;T Unix. As a result, the tar command became much
+better known in universities and research groups that used
+Version 7. The combination of the <b>find</b> and
+<b>cpio</b> utilities provided very precise control over
+file selection. Unfortunately, the format has many
+limitations that make it unsuitable for widespread use. Only
+the POSIX format permits files over 4GB, and its 18-bit
+limit for most other fields makes it unsuitable for modern
+systems. In addition, cpio formats only store numeric
+UID/GID values (not usernames and group names), which can
+make it very difficult to correctly transfer archives across
+systems with dissimilar user numbering.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Shar
+Formats</b> <br>
+A &lsquo;&lsquo;shell archive&rsquo;&rsquo; is a shell
+script that, when executed on a POSIX-compliant system, will
+recreate a collection of file system objects. The libarchive
+library can write two different kinds of shar archives:</p>
+
+<p style="margin-top: 1em" valign="top"><b>shar</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The traditional
+shar format uses a limited set of POSIX commands, including
+echo(1), mkdir(1), and sed(1). It is suitable for portably
+archiving small collections of plain text files. However, it
+is not generally well-suited for large archives (many
+implementations of sh(1) have limits on the size of a
+script) nor should it be used with non-text files.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>shardump</b></p>
+
+<p style="margin-left:20%;">This format is similar to shar
+but encodes files using uuencode(1) so that the result will
+be a plain text file regardless of the file contents. It
+also includes additional shell commands that attempt to
+reproduce as many file attributes as possible, including
+owner, mode, and flags. The additional commands used to
+restore file attributes make shardump archives less portable
+than plain shar archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>ISO9660
+format</b> <br>
+Libarchive can read and extract from files containing
+ISO9660-compliant CDROM images. In many cases, this can
+remove the need to burn a physical CDROM just in order to
+read the files contained in an ISO9660 image. It also avoids
+security and complexity issues that come with virtual mounts
+and loopback devices. Libarchive supports the most common
+Rockridge extensions and has partial support for Joliet
+extensions. If both extensions are present, the Joliet
+extensions will be used and the Rockridge extensions will be
+ignored. In particular, this can create problems with
+hardlinks and symlinks, which are supported by Rockridge but
+not by Joliet.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Zip
+format</b> <br>
+Libarchive can read and write zip format archives that have
+uncompressed entries and entries compressed with the
+&lsquo;&lsquo;deflate&rsquo;&rsquo; algorithm. Older zip
+compression algorithms are not supported. It can extract jar
+archives, archives that use Zip64 extensions and many
+self-extracting zip archives. Libarchive reads Zip archives
+as they are being streamed, which allows it to read archives
+of arbitrary size. It currently does not use the central
+directory; this limits libarchive&rsquo;s ability to support
+some self-extracting archives and ones that have been
+modified in certain ways.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Archive
+(library) file format</b> <br>
+The Unix archive format (commonly created by the ar(1)
+archiver) is a general-purpose format which is used almost
+exclusively for object files to be read by the link editor
+ld(1). The ar format has never been standardised. There are
+two common variants: the GNU format derived from SVR4, and
+the BSD format, which first appeared in 4.4BSD. The two
+differ primarily in their handling of filenames longer than
+15 characters: the GNU/SVR4 variant writes a filename table
+at the beginning of the archive; the BSD format stores each
+long filename in an extension area adjacent to the entry.
+Libarchive can read both extensions, including archives that
+may include both types of long filenames. Programs using
+libarchive can write GNU/SVR4 format if they provide a
+filename table to be written into the archive before any of
+the entries. Any entries whose names are not in the filename
+table will be written using BSD-style long filenames. This
+can cause problems for programs such as GNU ld that do not
+support the BSD-style long filenames.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>mtree</b>
+<br>
+Libarchive can read and write files in mtree(5) format. This
+format is not a true archive format, but rather a textual
+description of a file hierarchy in which each line specifies
+the name of a file and provides specific metadata about that
+file. Libarchive can read all of the keywords supported by
+both the NetBSD and FreeBSD versions of mtree(1), although
+many of the keywords cannot currently be stored in an
+archive_entry object. When writing, libarchive supports use
+of the archive_write_set_options(3) interface to specify
+which keywords should be included in the output. If
+libarchive was compiled with access to suitable
+cryptographic libraries (such as the OpenSSL libraries), it
+can compute hash entries such as <b>sha512</b> or <b>md5</b>
+from file data being written to the mtree writer.</p>
+
+<p style="margin-left:8%; margin-top: 1em">When reading an
+mtree file, libarchive will locate the corresponding files
+on disk using the <b>contents</b> keyword if present or the
+regular filename. If it can locate and open the file on
+disk, it will use that to fill in any metadata that is
+missing from the mtree file and will read the file contents
+and return those to the program using libarchive. If it
+cannot locate and open the file on disk, libarchive will
+return an error for any attempt to read the entry body.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">ar(1), cpio(1), mkisofs(1),
+shar(1), tar(1), zip(1), zlib(3), cpio(5), mtree(5),
+tar(5)</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+December&nbsp;27, 2009 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/libarchive.3.html b/archivers/libarchive/files/doc/html/libarchive.3.html
new file mode 100644
index 00000000000..f02d7cb8cb7
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/libarchive.3.html
@@ -0,0 +1,329 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:35 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">LIBARCHIVE(3) FreeBSD Library Functions
+Manual LIBARCHIVE(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>libarchive</b> &mdash;
+functions for reading and writing streaming archives</p>
+
+<p style="margin-top: 1em" valign="top"><b>LIBRARY</b></p>
+
+<p style="margin-left:8%;">Streaming Archive Library
+(libarchive, &minus;larchive)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>OVERVIEW</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+provides a flexible interface for reading and writing
+streaming archive files such as tar and cpio. The library is
+inherently stream-oriented; readers serially iterate through
+the archive, writers serially add things to the archive. In
+particular, note that there is no built-in support for
+random access nor for in-place modification.</p>
+
+<p style="margin-left:8%; margin-top: 1em">When reading an
+archive, the library automatically detects the format and
+the compression. The library currently has read support
+for:</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">old-style tar archives,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">most variants of the POSIX
+&lsquo;&lsquo;ustar&rsquo;&rsquo; format,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">the POSIX &lsquo;&lsquo;pax
+interchange&rsquo;&rsquo; format,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">GNU-format tar archives,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">most common cpio archive
+formats,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">ISO9660 CD images (with or
+without RockRidge extensions),</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">Zip archives.</p>
+
+<p style="margin-left:8%;">The library automatically
+detects archives compressed with gzip(1), bzip2(1), or
+compress(1) and decompresses them transparently.</p>
+
+<p style="margin-left:8%; margin-top: 1em">When writing an
+archive, you can specify the compression to be used and the
+format to use. The library can write</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">POSIX-standard
+&lsquo;&lsquo;ustar&rsquo;&rsquo; archives,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">POSIX &lsquo;&lsquo;pax
+interchange format&rsquo;&rsquo; archives,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">POSIX octet-oriented cpio
+archives,</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:14%;">two different variants of shar
+archives.</p>
+
+<p style="margin-left:8%;">Pax interchange format is an
+extension of the tar archive format that eliminates
+essentially all of the limitations of historic tar formats
+in a standard fashion that is supported by POSIX-compliant
+pax(1) implementations on many systems as well as several
+newer implementations of tar(1). Note that the default write
+format will suppress the pax extended attributes for most
+entries; explicitly requesting pax format will enable those
+attributes for all entries.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The read and
+write APIs are accessed through the
+<b>archive_read_XXX</b>() functions and the
+<b>archive_write_XXX</b>() functions, respectively, and
+either can be used independently of the other.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The rest of this
+manual page provides an overview of the library operation.
+More detailed information can be found in the individual
+manual pages for each API or utility function.</p>
+
+<p style="margin-top: 1em" valign="top"><b>READING AN
+ARCHIVE</b></p>
+
+<p style="margin-left:8%;">To read an archive, you must
+first obtain an initialized struct archive object from
+<b>archive_read_new</b>(). You can then modify this object
+for the desired operations with the various
+<b>archive_read_set_XXX</b>() and
+<b>archive_read_support_XXX</b>() functions. In particular,
+you will need to invoke appropriate
+<b>archive_read_support_XXX</b>() functions to enable the
+corresponding compression and format support. Note that
+these latter functions perform two distinct operations: they
+cause the corresponding support code to be linked into your
+program, and they enable the corresponding auto-detect code.
+Unless you have specific constraints, you will generally
+want to invoke <b>archive_read_support_compression_all</b>()
+and <b>archive_read_support_format_all</b>() to enable
+auto-detect for all formats and compression types currently
+supported by the library.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Once you have
+prepared the struct archive object, you call
+<b>archive_read_open</b>() to actually open the archive and
+prepare it for reading. There are several variants of this
+function; the most basic expects you to provide pointers to
+several functions that can provide blocks of bytes from the
+archive. There are convenience forms that allow you to
+specify a filename, file descriptor, <i>FILE *</i> object,
+or a block of memory from which to read the archive data.
+Note that the core library makes no assumptions about the
+size of the blocks read; callback functions are free to read
+whatever block size is most appropriate for the medium.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Each archive
+entry consists of a header followed by a certain amount of
+data. You can obtain the next header with
+<b>archive_read_next_header</b>(), which returns a pointer
+to an struct archive_entry structure with information about
+the current archive element. If the entry is a regular file,
+then the header will be followed by the file data. You can
+use <b>archive_read_data</b>() (which works much like the
+read(2) system call) to read this data from the archive. You
+may prefer to use the higher-level
+<b>archive_read_data_skip</b>(), which reads and discards
+the data for this entry,
+<b>archive_read_data_to_buffer</b>(), which reads the data
+into an in-memory buffer,
+<b>archive_read_data_to_file</b>(), which copies the data to
+the provided file descriptor, or
+<b>archive_read_extract</b>(), which recreates the specified
+entry on disk and copies data from the archive. In
+particular, note that <b>archive_read_extract</b>() uses the
+struct archive_entry structure that you provide it, which
+may differ from the entry just read from the archive. In
+particular, many applications will want to override the
+pathname, file permissions, or ownership.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Once you have
+finished reading data from the archive, you should call
+<b>archive_read_close</b>() to close the archive, then call
+<b>archive_read_finish</b>() to release all resources,
+including all memory allocated by the library.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+archive_read(3) manual page provides more detailed calling
+information for this API.</p>
+
+<p style="margin-top: 1em" valign="top"><b>WRITING AN
+ARCHIVE</b></p>
+
+<p style="margin-left:8%;">You use a similar process to
+write an archive. The <b>archive_write_new</b>() function
+creates an archive object useful for writing, the various
+<b>archive_write_set_XXX</b>() functions are used to set
+parameters for writing the archive, and
+<b>archive_write_open</b>() completes the setup and opens
+the archive for writing.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Individual
+archive entries are written in a three-step process: You
+first initialize a struct archive_entry structure with
+information about the new entry. At a minimum, you should
+set the pathname of the entry and provide a <i>struct
+stat</i> with a valid <i>st_mode</i> field, which specifies
+the type of object and <i>st_size</i> field, which specifies
+the size of the data portion of the object. The
+<b>archive_write_header</b>() function actually writes the
+header data to the archive. You can then use
+<b>archive_write_data</b>() to write the actual data.</p>
+
+<p style="margin-left:8%; margin-top: 1em">After all
+entries have been written, use the
+<b>archive_write_finish</b>() function to release all
+resources.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The
+archive_write(3) manual page provides more detailed calling
+information for this API.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">Detailed descriptions of each
+function are provided by the corresponding manual pages.</p>
+
+<p style="margin-left:8%; margin-top: 1em">All of the
+functions utilize an opaque struct archive datatype that
+provides access to the archive contents.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The struct
+archive_entry structure contains a complete description of a
+single archive entry. It uses an opaque interface that is
+fully documented in archive_entry(3).</p>
+
+<p style="margin-left:8%; margin-top: 1em">Users familiar
+with historic formats should be aware that the newer
+variants have eliminated most restrictions on the length of
+textual fields. Clients should not assume that filenames,
+link names, user names, or group names are limited in
+length. In particular, pax interchange format can easily
+accommodate pathnames in arbitrary character sets that
+exceed <i>PATH_MAX</i>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>RETURN
+VALUES</b></p>
+
+<p style="margin-left:8%;">Most functions return zero on
+success, non-zero on error. The return value indicates the
+general severity of the error, ranging from
+<b>ARCHIVE_WARN</b>, which indicates a minor problem that
+should probably be reported to the user, to
+<b>ARCHIVE_FATAL</b>, which indicates a serious problem that
+will prevent any further operations on this archive. On
+error, the <b>archive_errno</b>() function can be used to
+retrieve a numeric error code (see errno(2)). The
+<b>archive_error_string</b>() returns a textual error
+message suitable for display.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_new</b>()
+and <b>archive_write_new</b>() return pointers to an
+allocated and initialized struct archive object.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>archive_read_data</b>()
+and <b>archive_write_data</b>() return a count of the number
+of bytes actually read or written. A value of zero indicates
+the end of the data for this entry. A negative value
+indicates an error, in which case the <b>archive_errno</b>()
+and <b>archive_error_string</b>() functions can be used to
+obtain more information.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>ENVIRONMENT</b></p>
+
+<p style="margin-left:8%;">There are character set
+conversions within the archive_entry(3) functions that are
+impacted by the currently-selected locale.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">tar(1), archive_entry(3),
+archive_read(3), archive_util(3), archive_write(3),
+tar(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">Some archive formats support
+information that is not supported by struct archive_entry.
+Such information cannot be fully archived or restored using
+this library. This includes, for example, comments,
+character sets, or the arbitrary key/value pairs that can
+appear in pax interchange format archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Conversely, of
+course, not all of the information that can be stored in an
+struct archive_entry is supported by all formats. For
+example, cpio formats do not support nanosecond timestamps;
+old tar formats do not support large device numbers.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+August&nbsp;19, 2006 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/libarchive_internals.3.html b/archivers/libarchive/files/doc/html/libarchive_internals.3.html
new file mode 100644
index 00000000000..31c716a0f74
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/libarchive_internals.3.html
@@ -0,0 +1,381 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:36 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">LIBARCHIVE(3) FreeBSD Library Functions
+Manual LIBARCHIVE(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>libarchive_internals</b>
+&mdash; description of libarchive internal interfaces</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>OVERVIEW</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+provides a flexible interface for reading and writing
+streaming archive files such as tar and cpio. Internally, it
+follows a modular layered design that should make it easy to
+add new archive and compression formats.</p>
+
+<p style="margin-top: 1em" valign="top"><b>GENERAL
+ARCHITECTURE</b></p>
+
+<p style="margin-left:8%;">Externally, libarchive exposes
+most operations through an opaque, object-style interface.
+The archive_entry(1) objects store information about a
+single filesystem object. The rest of the library provides
+facilities to write archive_entry(1) objects to archive
+files, read them from archive files, and write them to disk.
+(There are plans to add a facility to read archive_entry(1)
+objects from disk as well.)</p>
+
+<p style="margin-left:8%; margin-top: 1em">The read and
+write APIs each have four layers: a public API layer, a
+format layer that understands the archive file format, a
+compression layer, and an I/O layer. The I/O layer is
+completely exposed to clients who can replace it entirely
+with their own functions.</p>
+
+<p style="margin-left:8%; margin-top: 1em">In order to
+provide as much consistency as possible for clients, some
+public functions are virtualized. Eventually, it should be
+possible for clients to open an archive or disk writer, and
+then use a single set of code to select and write entries,
+regardless of the target.</p>
+
+<p style="margin-top: 1em" valign="top"><b>READ
+ARCHITECTURE</b></p>
+
+<p style="margin-left:8%;">From the outside, clients use
+the archive_read(3) API to manipulate an <b>archive</b>
+object to read entries and bodies from an archive stream.
+Internally, the <b>archive</b> object is cast to an
+<b>archive_read</b> object, which holds all read-specific
+data. The API has four layers: The lowest layer is the I/O
+layer. This layer can be overridden by clients, but most
+clients use the packaged I/O callbacks provided, for
+example, by archive_read_open_memory(3), and
+archive_read_open_fd(3). The compression layer calls the I/O
+layer to read bytes and decompresses them for the format
+layer. The format layer unpacks a stream of uncompressed
+bytes and creates <b>archive_entry</b> objects from the
+incoming data. The API layer tracks overall state (for
+example, it prevents clients from reading data before
+reading a header) and invokes the format and compression
+layer operations through registered function pointers. In
+particular, the API layer drives the format-detection
+process: When opening the archive, it reads an initial block
+of data and offers it to each registered compression
+handler. The one with the highest bid is initialized with
+the first block. Similarly, the format handlers are polled
+to see which handler is the best for each archive. (Prior to
+2.4.0, the format bidders were invoked for each entry, but
+this design hindered error recovery.)</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>I/O Layer and
+Client Callbacks</b> <br>
+The read API goes to some lengths to be nice to clients. As
+a result, there are few restrictions on the behavior of the
+client callbacks.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The client read
+callback is expected to provide a block of data on each
+call. A zero-length return does indicate end of file, but
+otherwise blocks may be as small as one byte or as large as
+the entire file. In particular, blocks may be of different
+sizes.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The client skip
+callback returns the number of bytes actually skipped, which
+may be much smaller than the skip requested. The only
+requirement is that the skip not be larger. In particular,
+clients are allowed to return zero for any skip that they
+don&rsquo;t want to handle. The skip callback must never be
+invoked with a negative value.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Keep in mind
+that not all clients are reading from disk: clients reading
+from networks may provide different-sized blocks on every
+request and cannot skip at all; advanced clients may use
+mmap(2) to read the entire file into memory at once and
+return the entire file to libarchive as a single block;
+other clients may begin asynchronous I/O operations for the
+next block on each request.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em"><b>Decompresssion
+Layer</b> <br>
+The decompression layer not only handles decompression, it
+also buffers data so that the format handlers see a much
+nicer I/O model. The decompression API is a two stage
+peek/consume model. A read_ahead request specifies a minimum
+read amount; the decompression layer must provide a pointer
+to at least that much data. If more data is immediately
+available, it should return more: the format layer handles
+bulk data reads by asking for a minimum of one byte and then
+copying as much data as is available.</p>
+
+<p style="margin-left:8%; margin-top: 1em">A subsequent
+call to the <b>consume</b>() function advances the read
+pointer. Note that data returned from a <b>read_ahead</b>()
+call is guaranteed to remain in place until the next call to
+<b>read_ahead</b>(). Intervening calls to <b>consume</b>()
+should not cause the data to move.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Skip requests
+must always be handled exactly. Decompression handlers that
+cannot seek forward should not register a skip handler; the
+API layer fills in a generic skip handler that reads and
+discards data.</p>
+
+<p style="margin-left:8%; margin-top: 1em">A decompression
+handler has a specific lifecycle:</p>
+
+<p valign="top">Registration/Configuration</p>
+
+<p style="margin-left:20%;">When the client invokes the
+public support function, the decompression handler invokes
+the internal <b>__archive_read_register_compression</b>()
+function to provide bid and initialization functions. This
+function returns <b>NULL</b> on error or else a pointer to a
+<b>struct decompressor_t</b>. This structure contains a
+<i>void * config</i> slot that can be used for storing any
+customization information.</p>
+
+<p valign="top">Bid</p>
+
+<p style="margin-left:20%; margin-top: 1em">The bid
+function is invoked with a pointer and size of a block of
+data. The decompressor can access its config data through
+the <i>decompressor</i> element of the <b>archive_read</b>
+object. The bid function is otherwise stateless. In
+particular, it must not perform any I/O operations.</p>
+
+<p style="margin-left:20%; margin-top: 1em">The value
+returned by the bid function indicates its suitability for
+handling this data stream. A bid of zero will ensure that
+this decompressor is never invoked. Return zero if magic
+number checks fail. Otherwise, your initial implementation
+should return the number of bits actually checked. For
+example, if you verify two full bytes and three bits of
+another byte, bid 19. Note that the initial block may be
+very short; be careful to only inspect the data you are
+given. (The current decompressors require two bytes for
+correct bidding.)</p>
+
+<p valign="top">Initialize</p>
+
+<p style="margin-left:20%;">The winning bidder will have
+its init function called. This function should initialize
+the remaining slots of the <i>struct decompressor_t</i>
+object pointed to by the <i>decompressor</i> element of the
+<i>archive_read</i> object. In particular, it should
+allocate any working data it needs in the <i>data</i> slot
+of that structure. The init function is called with the
+block of data that was used for tasting. At this point, the
+decompressor is responsible for all I/O requests to the
+client callbacks. The decompressor is free to read more data
+as and when necessary.</p>
+
+<p valign="top">Satisfy I/O requests</p>
+
+<p style="margin-left:20%;">The format handler will invoke
+the <i>read_ahead</i>, <i>consume</i>, and <i>skip</i>
+functions as needed.</p>
+
+<p valign="top">Finish</p>
+
+<p style="margin-left:20%; margin-top: 1em">The finish
+method is called only once when the archive is closed. It
+should release anything stored in the <i>data</i> and
+<i>config</i> slots of the <i>decompressor</i> object. It
+should not invoke the client close callback.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Format
+Layer</b> <br>
+The read formats have a similar lifecycle to the
+decompression handlers:</p>
+
+<p valign="top">Registration</p>
+
+<p style="margin-left:20%;">Allocate your private data and
+initialize your pointers.</p>
+
+<p valign="top">Bid</p>
+
+<p style="margin-left:20%; margin-top: 1em">Formats bid by
+invoking the <b>read_ahead</b>() decompression method but
+not calling the <b>consume</b>() method. This allows each
+bidder to look ahead in the input stream. Bidders should not
+look further ahead than necessary, as long look aheads put
+pressure on the decompression layer to buffer lots of data.
+Most formats only require a few hundred bytes of look ahead;
+look aheads of a few kilobytes are reasonable. (The ISO9660
+reader sometimes looks ahead by 48k, which should be
+considered an upper limit.)</p>
+
+<p valign="top">Read header</p>
+
+<p style="margin-left:20%;">The header read is usually the
+most complex part of any format. There are a few strategies
+worth mentioning: For formats such as tar or cpio, reading
+and parsing the header is straightforward since headers
+alternate with data. For formats that store all header data
+at the beginning of the file, the first header read request
+may have to read all headers into memory and store that
+data, sorted by the location of the file data. Subsequent
+header read requests will skip forward to the beginning of
+the file data and return the corresponding header.</p>
+
+<p valign="top">Read Data</p>
+
+<p style="margin-left:20%;">The read data interface
+supports sparse files; this requires that each call return a
+block of data specifying the file offset and size. This may
+require you to carefully track the location so that you can
+return accurate file offsets for each read. Remember that
+the decompressor will return as much data as it has.
+Generally, you will want to request one byte, examine the
+return value to see how much data is available, and possibly
+trim that to the amount you can use. You should invoke
+consume for each block just before you return it.</p>
+
+<p valign="top">Skip All Data</p>
+
+<p style="margin-left:20%;">The skip data call should skip
+over all file data and trailing padding. This is called
+automatically by the API layer just before each header read.
+It is also called in response to the client calling the
+public <b>data_skip</b>() function.</p>
+
+<p valign="top">Cleanup</p>
+
+<p style="margin-left:20%;">On cleanup, the format should
+release all of its allocated memory.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>API Layer</b>
+<br>
+XXX to do XXX</p>
+
+<p style="margin-top: 1em" valign="top"><b>WRITE
+ARCHITECTURE</b></p>
+
+<p style="margin-left:8%;">The write API has a similar set
+of four layers: an API layer, a format layer, a compression
+layer, and an I/O layer. The registration here is much
+simpler because only one format and one compression can be
+registered at a time.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>I/O Layer and
+Client Callbacks</b> <br>
+XXX To be written XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Compression
+Layer</b> <br>
+XXX To be written XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Format
+Layer</b> <br>
+XXX To be written XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>API Layer</b>
+<br>
+XXX To be written XXX</p>
+
+<p style="margin-top: 1em" valign="top"><b>WRITE_DISK
+ARCHITECTURE</b></p>
+
+<p style="margin-left:8%;">The write_disk API is intended
+to look just like the write API to clients. Since it does
+not handle multiple formats or compression, it is not
+layered internally.</p>
+
+<p style="margin-top: 1em" valign="top"><b>GENERAL
+SERVICES</b></p>
+
+<p style="margin-left:8%;">The <b>archive_read</b>,
+<b>archive_write</b>, and <b>archive_write_disk</b> objects
+all contain an initial <b>archive</b> object which provides
+common support for a set of standard services. (Recall that
+ANSI/ISO C90 guarantees that you can cast freely between a
+pointer to a structure and a pointer to the first element of
+that structure.) The <b>archive</b> object has a magic value
+that indicates which API this object is associated with,
+slots for storing error information, and function pointers
+for virtualized API functions.</p>
+
+<p style="margin-top: 1em" valign="top"><b>MISCELLANEOUS
+NOTES</b></p>
+
+<p style="margin-left:8%;">Connecting existing archiving
+libraries into libarchive is generally quite difficult. In
+particular, many existing libraries strongly assume that you
+are reading from a file; they seek forwards and backwards as
+necessary to locate various pieces of information. In
+contrast, libarchive never seeks backwards in its input,
+which sometimes requires very different approaches.</p>
+
+<p style="margin-left:8%; margin-top: 1em">For example,
+libarchive&rsquo;s ISO9660 support operates very differently
+from most ISO9660 readers. The libarchive support utilizes a
+work-queue design that keeps a list of known entries sorted
+by their location in the input. Whenever libarchive&rsquo;s
+ISO9660 implementation is asked for the next header, checks
+this list to find the next item on the disk. Directories are
+parsed when they are encountered and new items are added to
+the list. This design relies heavily on the ISO9660 image
+being optimized so that directories always occur earlier on
+the disk than the files they describe.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Depending on the
+specific format, such approaches may not be possible. The
+ZIP format specification, for example, allows archivers to
+store key information only at the end of the file. In
+theory, it is possible to create ZIP archives that cannot be
+read without seeking. Fortunately, such archives are very
+rare, and libarchive can read most ZIP archives, though it
+cannot always extract as much information as a dedicated ZIP
+program.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">archive(3), archive_entry(3),
+archive_read(3), archive_write(3), archive_write_disk(3)</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+first appeared in FreeBSD&nbsp;5.3.</p>
+
+<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
+
+<p style="margin-left:8%;">The <b>libarchive</b> library
+was written by Tim Kientzle
+&lang;kientzle@acm.org&rang;.</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">FreeBSD&nbsp;8.0 April&nbsp;16,
+2007 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/mtree.5.html b/archivers/libarchive/files/doc/html/mtree.5.html
new file mode 100644
index 00000000000..674edefe478
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/mtree.5.html
@@ -0,0 +1,339 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:37 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">MTREE(5) FreeBSD File Formats Manual
+MTREE(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>mtree</b> &mdash; format of
+mtree dir hierarchy files</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">The <b>mtree</b> format is a
+textual format that describes a collection of filesystem
+objects. Such files are typically used to create or verify
+directory hierarchies.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>General
+Format</b> <br>
+An <b>mtree</b> file consists of a series of lines, each
+providing information about a single filesystem object.
+Leading whitespace is always ignored.</p>
+
+<p style="margin-left:8%; margin-top: 1em">When encoding
+file or pathnames, any backslash character or character
+outside of the 95 printable ASCII characters must be encoded
+as a a backslash followed by three octal digits. When
+reading mtree files, any appearance of a backslash followed
+by three octal digits should be converted into the
+corresponding character.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Each line is
+interpreted independently as one of the following types:</p>
+
+<p style="margin-top: 1em" valign="top">Signature</p>
+
+<p style="margin-left:26%; margin-top: 1em">The first line
+of any mtree file must begin with
+&lsquo;&lsquo;#mtree&rsquo;&rsquo;. If a file contains any
+full path entries, the first line should begin with
+&lsquo;&lsquo;#mtree v2.0&rsquo;&rsquo;, otherwise, the
+first line should begin with &lsquo;&lsquo;#mtree
+v1.0&rsquo;&rsquo;.</p>
+
+<p style="margin-top: 1em" valign="top">Blank</p>
+
+<p style="margin-left:26%; margin-top: 1em">Blank lines are
+ignored.</p>
+
+<p style="margin-top: 1em" valign="top">Comment</p>
+
+<p style="margin-left:26%; margin-top: 1em">Lines beginning
+with <b>#</b> are ignored.</p>
+
+<p style="margin-top: 1em" valign="top">Special</p>
+
+<p style="margin-left:26%; margin-top: 1em">Lines beginning
+with <b>/</b> are special commands that influence the
+interpretation of later lines.</p>
+
+<p style="margin-top: 1em" valign="top">Relative</p>
+
+<p style="margin-left:26%; margin-top: 1em">If the first
+whitespace-delimited word has no <b>/</b> characters, it is
+the name of a file in the current directory. Any relative
+entry that describes a directory changes the current
+directory.</p>
+
+<p style="margin-top: 1em" valign="top">dot-dot</p>
+
+<p style="margin-left:26%; margin-top: 1em">As a special
+case, a relative entry with the filename <i>..</i> changes
+the current directory to the parent directory. Options on
+dot-dot entries are always ignored.</p>
+
+<p style="margin-top: 1em" valign="top">Full</p>
+
+<p style="margin-left:26%; margin-top: 1em">If the first
+whitespace-delimited word has a <b>/</b> character after the
+first character, it is the pathname of a file relative to
+the starting directory. There can be multiple full entries
+describing the same file.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Some tools that
+process <b>mtree</b> files may require that multiple lines
+describing the same file occur consecutively. It is not
+permitted for the same file to be mentioned using both a
+relative and a full file specification.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Special
+commands</b> <br>
+Two special commands are currently defined:</p>
+
+<p style="margin-top: 1em" valign="top"><b>/set</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">This command
+defines default values for one or more keywords. It is
+followed on the same line by one or more
+whitespace-separated keyword definitions. These definitions
+apply to all following files that do not specify a value for
+that keyword.</p>
+
+<p style="margin-top: 1em" valign="top"><b>/unset</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">This command
+removes any default value set by a previous <b>/set</b>
+command. It is followed on the same line by one or more
+keywords separated by whitespace.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Keywords</b>
+<br>
+After the filename, a full or relative entry consists of
+zero or more whitespace-separated keyword definitions. Each
+such definition consists of a key from the following list
+immediately followed by an &rsquo;=&rsquo; sign and a value.
+Software programs reading mtree files should warn about
+unrecognized keywords.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Currently
+supported keywords are as follows:</p>
+
+<p style="margin-top: 1em" valign="top"><b>cksum</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The checksum of
+the file using the default algorithm specified by the
+cksum(1) utility.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>contents</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The full
+pathname of a file that holds the contents of this file.</p>
+
+<p style="margin-top: 1em" valign="top"><b>flags</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The file flags
+as a symbolic name. See chflags(1) for information on these
+names. If no flags are to be set the string
+&lsquo;&lsquo;none&rsquo;&rsquo; may be used to override the
+current default.</p>
+
+<p style="margin-top: 1em" valign="top"><b>gid</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The file group
+as a numeric value.</p>
+
+<p style="margin-top: 1em" valign="top"><b>gname</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The file group
+as a symbolic name.</p>
+
+<p style="margin-top: 1em" valign="top"><b>ignore</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">Ignore any file
+hierarchy below this file.</p>
+
+<p style="margin-top: 1em" valign="top"><b>link</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The target of
+the symbolic link when type=link.</p>
+
+<p style="margin-top: 1em" valign="top"><b>md5</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The MD5 message
+digest of the file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>md5digest</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">A synonym for
+<b>md5</b>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>mode</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The current
+file&rsquo;s permissions as a numeric (octal) or symbolic
+value.</p>
+
+<p style="margin-top: 1em" valign="top"><b>nlink</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The number of
+hard links the file is expected to have.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>nochange</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">Make sure this
+file or directory exists but otherwise ignore all
+attributes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>ripemd160digest</b></p>
+
+<p style="margin-left:26%;">The RIPEMD160 message digest of
+the file.</p>
+
+<p style="margin-top: 1em" valign="top"><b>rmd160</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">A synonym for
+<b>ripemd160digest</b>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>rmd160digest</b></p>
+
+<p style="margin-left:26%;">A synonym for
+<b>ripemd160digest</b>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>sha1</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The FIPS 160-1
+(&lsquo;&lsquo;SHA-1&rsquo;&rsquo;) message digest of the
+file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>sha1digest</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">A synonym for
+<b>sha1</b>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>sha256</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The FIPS 180-2
+(&lsquo;&lsquo;SHA-256&rsquo;&rsquo;) message digest of the
+file.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>sha256digest</b></p>
+
+<p style="margin-left:26%;">A synonym for
+<b>sha256</b>.</p>
+
+<p style="margin-top: 1em" valign="top"><b>size</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The size, in
+bytes, of the file.</p>
+
+<p style="margin-top: 1em" valign="top"><b>time</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The last
+modification time of the file.</p>
+
+<p style="margin-top: 1em" valign="top"><b>type</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The type of the
+file; may be set to any one of the following:</p>
+
+<p style="margin-top: 1em" valign="top"><b>block</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">block special
+device</p>
+
+<p valign="top"><b>char</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">character
+special device</p>
+
+<p valign="top"><b>dir</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">directory</p>
+
+<p valign="top"><b>fifo</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">fifo</p>
+
+<p valign="top"><b>file</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">regular
+file</p>
+
+<p valign="top"><b>link</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">symbolic
+link</p>
+
+<p valign="top"><b>socket</b></p>
+
+<p style="margin-left:45%; margin-top: 1em">socket</p>
+
+<p style="margin-top: 1em" valign="top"><b>uid</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The file owner
+as a numeric value.</p>
+
+<p style="margin-top: 1em" valign="top"><b>uname</b></p>
+
+<p style="margin-left:26%; margin-top: 1em">The file owner
+as a symbolic name.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">cksum(1), find(1), mtree(8)</p>
+
+<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
+
+<p style="margin-left:8%;">The FreeBSD implementation of
+mtree does not currently support the <b>mtree</b> 2.0
+format. The requirement for a
+&lsquo;&lsquo;#mtree&rsquo;&rsquo; signature line is new and
+not yet widely implemented.</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">The <b>mtree</b> utility
+appeared in 4.3BSD&minus;Reno. The MD5 digest capability was
+added in FreeBSD&nbsp;2.1, in response to the widespread use
+of programs which can spoof cksum(1). The SHA-1 and
+RIPEMD160 digests were added in FreeBSD&nbsp;4.0, as new
+attacks have demonstrated weaknesses in MD5. The SHA-256
+digest was added in FreeBSD&nbsp;6.0. Support for file flags
+was added in FreeBSD&nbsp;4.0, and mostly comes from NetBSD.
+The &lsquo;&lsquo;full&rsquo;&rsquo; entry format was added
+by NetBSD.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+August&nbsp;20, 2007 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/html/tar.5.html b/archivers/libarchive/files/doc/html/tar.5.html
new file mode 100644
index 00000000000..1d873248421
--- /dev/null
+++ b/archivers/libarchive/files/doc/html/tar.5.html
@@ -0,0 +1,1400 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Thu Feb 4 20:36:38 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title></title>
+</head>
+<body>
+
+<hr>
+
+
+<p valign="top">tar(5) FreeBSD File Formats Manual
+tar(5)</p>
+
+<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
+
+<p style="margin-left:8%;"><b>tar</b> &mdash; format of
+tape archive files</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>
+
+<p style="margin-left:8%;">The <b>tar</b> archive format
+collects any number of files, directories, and other file
+system objects (symbolic links, device nodes, etc.) into a
+single stream of bytes. The format was originally designed
+to be used with tape drives that operate with fixed-size
+blocks, but is widely used as a general packaging
+mechanism.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>General
+Format</b> <br>
+A <b>tar</b> archive consists of a series of 512-byte
+records. Each file system object requires a header record
+which stores basic metadata (pathname, owner, permissions,
+etc.) and zero or more records containing any file data. The
+end of the archive is indicated by two records consisting
+entirely of zero bytes.</p>
+
+<p style="margin-left:8%; margin-top: 1em">For
+compatibility with tape drives that use fixed block sizes,
+programs that read or write tar files always read or write a
+fixed number of records with each I/O operation. These
+&lsquo;&lsquo;blocks&rsquo;&rsquo; are always a multiple of
+the record size. The maximum block size supported by early
+implementations was 10240 bytes or 20 records. This is still
+the default for most implementations although block sizes of
+1MiB (2048 records) or larger are commonly used with modern
+high-speed tape drives. (Note: the terms
+&lsquo;&lsquo;block&rsquo;&rsquo; and
+&lsquo;&lsquo;record&rsquo;&rsquo; here are not entirely
+standard; this document follows the convention established
+by John Gilmore in documenting <b>pdtar</b>.)</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Old-Style
+Archive Format</b> <br>
+The original tar archive format has been extended many times
+to include additional information that various implementors
+found necessary. This section describes the variant
+implemented by the tar command included in Version&nbsp;7
+AT&amp;T UNIX, which seems to be the earliest widely-used
+version of the tar program.</p>
+
+<p style="margin-left:8%; margin-top: 1em">The header
+record for an old-style <b>tar</b> archive consists of the
+following:</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+header_old_tar {</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char name[100];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mode[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char uid[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char gid[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char size[12];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mtime[12];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char checksum[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char linkflag[1];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char linkname[100];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char pad[255];</p></td>
+<td width="58%">
+</td>
+</table>
+
+<p style="margin-left:17%;">};</p>
+
+<p style="margin-left:8%;">All unused bytes in the header
+record are filled with nulls.</p>
+
+<p style="margin-top: 1em" valign="top"><i>name</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">Pathname,
+stored as a null-terminated string. Early tar
+implementations only stored regular files (including
+hardlinks to those files). One common early convention used
+a trailing &quot;/&quot; character to indicate a directory
+name, allowing directory permissions and owner information
+to be archived and restored.</p>
+
+<p style="margin-top: 1em" valign="top"><i>mode</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">File mode,
+stored as an octal number in ASCII.</p>
+
+<p style="margin-top: 1em" valign="top"><i>uid</i>,
+<i>gid</i></p>
+
+<p style="margin-left:20%;">User id and group id of owner,
+as octal numbers in ASCII.</p>
+
+<p style="margin-top: 1em" valign="top"><i>size</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">Size of file,
+as octal number in ASCII. For regular files only, this
+indicates the amount of data that follows the header. In
+particular, this field was ignored by early tar
+implementations when extracting hardlinks. Modern writers
+should always store a zero length for hardlink entries.</p>
+
+<p style="margin-top: 1em" valign="top"><i>mtime</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">Modification
+time of file, as an octal number in ASCII. This indicates
+the number of seconds since the start of the epoch, 00:00:00
+UTC January 1, 1970. Note that negative values should be
+avoided here, as they are handled inconsistently.</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>checksum</i></p>
+
+<p style="margin-left:20%;">Header checksum, stored as an
+octal number in ASCII. To compute the checksum, set the
+checksum field to all spaces, then sum all bytes in the
+header using unsigned arithmetic. This field should be
+stored as six octal digits followed by a null and a space
+character. Note that many early implementations of tar used
+signed arithmetic for the checksum field, which can cause
+interoperability problems when transferring archives between
+systems. Modern robust readers compute the checksum both
+ways and accept the header if either computation
+matches.</p>
+
+<p style="margin-top: 1em" valign="top"><i>linkflag</i>,
+<i>linkname</i></p>
+
+<p style="margin-left:20%;">In order to preserve hardlinks
+and conserve tape, a file with multiple links is only
+written to the archive the first time it is encountered. The
+next time it is encountered, the <i>linkflag</i> is set to
+an ASCII &lsquo;1&rsquo; and the <i>linkname</i> field holds
+the first name under which this file appears. (Note that
+regular files have a null value in the <i>linkflag</i>
+field.)</p>
+
+<p style="margin-left:8%; margin-top: 1em">Early tar
+implementations varied in how they terminated these fields.
+The tar command in Version&nbsp;7 AT&amp;T UNIX used the
+following conventions (this is also documented in early BSD
+manpages): the pathname must be null-terminated; the mode,
+uid, and gid fields must end in a space and a null byte; the
+size and mtime fields must end in a space; the checksum is
+terminated by a null and a space. Early implementations
+filled the numeric fields with leading spaces. This seems to
+have been common practice until the IEEE Std 1003.1-1988
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) standard was released.
+For best portability, modern implementations should fill the
+numeric fields with leading zeros.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Pre-POSIX
+Archives</b> <br>
+An early draft of IEEE Std 1003.1-1988
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) served as the basis
+for John Gilmore&rsquo;s <b>pdtar</b> program and many
+system implementations from the late 1980s and early 1990s.
+These archives generally follow the POSIX ustar format
+described below with the following variations:</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">The magic value is
+&lsquo;&lsquo;ustar&nbsp;&rsquo;&rsquo; (note the following
+space). The version field contains a space character
+followed by a null.</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">The numeric fields are
+generally filled with leading spaces (not leading zeros as
+recommended in the final standard).</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">The prefix field is often not
+used, limiting pathnames to the 100 characters of old-style
+archives.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>POSIX ustar
+Archives</b> <br>
+IEEE Std 1003.1-1988 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;)
+defined a standard tar file format to be read and written by
+compliant implementations of tar(1). This format is often
+called the &lsquo;&lsquo;ustar&rsquo;&rsquo; format, after
+the magic value used in the header. (The name is an acronym
+for &lsquo;&lsquo;Unix Standard TAR&rsquo;&rsquo;.) It
+extends the historic format with new fields:</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+header_posix_ustar {</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char name[100];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mode[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char uid[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char gid[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char size[12];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mtime[12];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char checksum[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char typeflag[1];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char linkname[100];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char magic[6];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char version[2];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char uname[32];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char gname[32];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char devmajor[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char devminor[8];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char prefix[155];</p></td>
+<td width="58%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char pad[12];</p></td>
+<td width="58%">
+</td>
+</table>
+
+<p style="margin-left:17%;">};</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>typeflag</i></p>
+
+<p style="margin-left:20%;">Type of entry. POSIX extended
+the earlier <i>linkflag</i> field with several new type
+values:</p>
+
+<p valign="top">&lsquo;&lsquo;0&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Regular file.
+NUL should be treated as a synonym, for compatibility
+purposes.</p>
+
+<p valign="top">&lsquo;&lsquo;1&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Hard link.</p>
+
+<p valign="top">&lsquo;&lsquo;2&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Symbolic
+link.</p>
+
+<p valign="top">&lsquo;&lsquo;3&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Character
+device node.</p>
+
+<p valign="top">&lsquo;&lsquo;4&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Block device
+node.</p>
+
+<p valign="top">&lsquo;&lsquo;5&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Directory.</p>
+
+<p valign="top">&lsquo;&lsquo;6&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">FIFO node.</p>
+
+<p valign="top">&lsquo;&lsquo;7&rsquo;&rsquo;</p>
+
+<p style="margin-left:32%; margin-top: 1em">Reserved.</p>
+
+<p valign="top">Other</p>
+
+<p style="margin-left:32%; margin-top: 1em">A
+POSIX-compliant implementation must treat any unrecognized
+typeflag value as a regular file. In particular, writers
+should ensure that all entries have a valid filename so that
+they can be restored by readers that do not support the
+corresponding extension. Uppercase letters &quot;A&quot;
+through &quot;Z&quot; are reserved for custom extensions.
+Note that sockets and whiteout entries are not
+archivable.</p>
+
+<p style="margin-left:20%;">It is worth noting that the
+<i>size</i> field, in particular, has different meanings
+depending on the type. For regular files, of course, it
+indicates the amount of data following the header. For
+directories, it may be used to indicate the total size of
+all files in the directory, for use by operating systems
+that pre-allocate directory space. For all other types, it
+should be set to zero by writers and ignored by readers.</p>
+
+<p style="margin-top: 1em" valign="top"><i>magic</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">Contains the
+magic value &lsquo;&lsquo;ustar&rsquo;&rsquo; followed by a
+NUL byte to indicate that this is a POSIX standard archive.
+Full compliance requires the uname and gname fields be
+properly set.</p>
+
+<p style="margin-top: 1em" valign="top"><i>version</i></p>
+
+<p style="margin-left:20%;">Version. This should be
+&lsquo;&lsquo;00&rsquo;&rsquo; (two copies of the ASCII
+digit zero) for POSIX standard archives.</p>
+
+<p style="margin-top: 1em" valign="top"><i>uname</i>,
+<i>gname</i></p>
+
+<p style="margin-left:20%;">User and group names, as
+null-terminated ASCII strings. These should be used in
+preference to the uid/gid values when they are set and the
+corresponding names exist on the system.</p>
+
+<p style="margin-top: 1em" valign="top"><i>devmajor</i>,
+<i>devminor</i></p>
+
+<p style="margin-left:20%;">Major and minor numbers for
+character device or block device entry.</p>
+
+<p style="margin-top: 1em" valign="top"><i>name</i>,
+<i>prefix</i></p>
+
+<p style="margin-left:20%;">If the pathname is too long to
+fit in the 100 bytes provided by the standard format, it can
+be split at any <i>/</i> character with the first portion
+going into the prefix field. If the prefix field is not
+empty, the reader will prepend the prefix value and a
+<i>/</i> character to the regular name field to obtain the
+full pathname. The standard does not require a trailing
+<i>/</i> character on directory names, though most
+implementations still include this for compatibility
+reasons.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Note that all
+unused bytes must be set to NUL.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Field
+termination is specified slightly differently by POSIX than
+by previous implementations. The <i>magic</i>, <i>uname</i>,
+and <i>gname</i> fields must have a trailing NUL. The
+<i>pathname</i>, <i>linkname</i>, and <i>prefix</i> fields
+must have a trailing NUL unless they fill the entire field.
+(In particular, it is possible to store a 256-character
+pathname if it happens to have a <i>/</i> as the 156th
+character.) POSIX requires numeric fields to be zero-padded
+in the front, and requires them to be terminated with either
+space or NUL characters.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Currently, most
+tar implementations comply with the ustar format,
+occasionally extending it by adding new fields to the blank
+area at the end of the header record.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Pax
+Interchange Format</b> <br>
+There are many attributes that cannot be portably stored in
+a POSIX ustar archive. IEEE Std 1003.1-2001
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) defined a
+&lsquo;&lsquo;pax interchange format&rsquo;&rsquo; that uses
+two new types of entries to hold text-formatted metadata
+that applies to following entries. Note that a pax
+interchange format archive is a ustar archive in every
+respect. The new data is stored in ustar-compatible archive
+entries that use the &lsquo;&lsquo;x&rsquo;&rsquo; or
+&lsquo;&lsquo;g&rsquo;&rsquo; typeflag. In particular, older
+implementations that do not fully support these extensions
+will extract the metadata into regular files, where the
+metadata can be examined as necessary.</p>
+
+<p style="margin-left:8%; margin-top: 1em">An entry in a
+pax interchange format archive consists of one or two
+standard ustar entries, each with its own header and data.
+The first optional entry stores the extended attributes for
+the following entry. This optional first entry has an
+&quot;x&quot; typeflag and a size field that indicates the
+total size of the extended attributes. The extended
+attributes themselves are stored as a series of text-format
+lines encoded in the portable UTF-8 encoding. Each line
+consists of a decimal number, a space, a key string, an
+equals sign, a value string, and a new line. The decimal
+number indicates the length of the entire line, including
+the initial length field and the trailing newline. An
+example of such a field is:</p>
+
+<p style="margin-left:17%;">25 ctime=1084839148.1212\n</p>
+
+<p style="margin-left:8%;">Keys in all lowercase are
+standard keys. Vendors can add their own keys by prefixing
+them with an all uppercase vendor name and a period. Note
+that, unlike the historic header, numeric values are stored
+using decimal, not octal. A description of some common keys
+follows:</p>
+
+<p style="margin-top: 1em" valign="top"><b>atime</b>,
+<b>ctime</b>, <b>mtime</b></p>
+
+<p style="margin-left:20%;">File access, inode change, and
+modification times. These fields can be negative or include
+a decimal point and a fractional value.</p>
+
+<p style="margin-top: 1em" valign="top"><b>uname</b>,
+<b>uid</b>, <b>gname</b>, <b>gid</b></p>
+
+<p style="margin-left:20%;">User name, group name, and
+numeric UID and GID values. The user name and group name
+stored here are encoded in UTF8 and can thus include
+non-ASCII characters. The UID and GID fields can be of
+arbitrary length.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>linkpath</b></p>
+
+<p style="margin-left:20%;">The full path of the linked-to
+file. Note that this is encoded in UTF8 and can thus include
+non-ASCII characters.</p>
+
+<p style="margin-top: 1em" valign="top"><b>path</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The full
+pathname of the entry. Note that this is encoded in UTF8 and
+can thus include non-ASCII characters.</p>
+
+<p style="margin-top: 1em" valign="top"><b>realtime.*</b>,
+<b>security.*</b></p>
+
+<p style="margin-left:20%;">These keys are reserved and may
+be used for future standardization.</p>
+
+<p style="margin-top: 1em" valign="top"><b>size</b></p>
+
+<p style="margin-left:20%; margin-top: 1em">The size of the
+file. Note that there is no length limit on this field,
+allowing conforming archives to store files much larger than
+the historic 8GB limit.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.*</b></p>
+
+<p style="margin-left:20%;">Vendor-specific attributes used
+by Joerg Schilling&rsquo;s <b>star</b> implementation.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.acl.access</b>,
+<b>SCHILY.acl.default</b></p>
+
+<p style="margin-left:20%;">Stores the access and default
+ACLs as textual strings in a format that is an extension of
+the format specified by POSIX.1e draft 17. In particular,
+each user or group access specification can include a fourth
+colon-separated field with the numeric UID or GID. This
+allows ACLs to be restored on systems that may not have
+complete user or group information available (such as when
+NIS/YP or LDAP services are temporarily unavailable).</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.devminor</b>,
+<b>SCHILY.devmajor</b></p>
+
+<p style="margin-left:20%;">The full minor and major
+numbers for device nodes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.fflags</b></p>
+
+<p style="margin-left:20%;">The file flags.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.realsize</b></p>
+
+<p style="margin-left:20%;">The full size of the file on
+disk. XXX explain? XXX</p>
+
+<p style="margin-top: 1em" valign="top"><b>SCHILY.dev,
+SCHILY.ino</b>, <b>SCHILY.nlinks</b></p>
+
+<p style="margin-left:20%;">The device number, inode
+number, and link count for the entry. In particular, note
+that a pax interchange format archive using Joerg
+Schilling&rsquo;s <b>SCHILY.*</b> extensions can store all
+of the data from <i>struct stat</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>LIBARCHIVE.xattr.</b><i>namespace</i>.<i>key</i></p>
+
+<p style="margin-left:20%;">Libarchive stores
+POSIX.1e-style extended attributes using keys of this form.
+The <i>key</i> value is URL-encoded: All non-ASCII
+characters and the two special characters
+&lsquo;&lsquo;=&rsquo;&rsquo; and
+&lsquo;&lsquo;%&rsquo;&rsquo; are encoded as
+&lsquo;&lsquo;%&rsquo;&rsquo; followed by two uppercase
+hexadecimal digits. The value of this key is the extended
+attribute value encoded in base 64. XXX Detail the base-64
+format here XXX</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>VENDOR.*</b></p>
+
+<p style="margin-left:20%;">XXX document other
+vendor-specific extensions XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em">Any values
+stored in an extended attribute override the corresponding
+values in the regular tar header. Note that compliant
+readers should ignore the regular fields when they are
+overridden. This is important, as existing archivers are
+known to store non-compliant values in the standard header
+fields in this situation. There are no limits on length for
+any of these fields. In particular, numeric fields can be
+arbitrarily large. All text fields are encoded in UTF8.
+Compliant writers should store only portable 7-bit ASCII
+characters in the standard ustar header and use extended
+attributes whenever a text value contains non-ASCII
+characters.</p>
+
+<p style="margin-left:8%; margin-top: 1em">In addition to
+the <b>x</b> entry described above, the pax interchange
+format also supports a <b>g</b> entry. The <b>g</b> entry is
+identical in format, but specifies attributes that serve as
+defaults for all subsequent archive entries. The <b>g</b>
+entry is not widely used.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Besides the new
+<b>x</b> and <b>g</b> entries, the pax interchange format
+has a few other minor variations from the earlier ustar
+format. The most troubling one is that hardlinks are
+permitted to have data following them. This allows readers
+to restore any hardlink to a file without having to rewind
+the archive to find an earlier entry. However, it creates
+complications for robust readers, as it is no longer clear
+whether or not they should ignore the size field for
+hardlink entries.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>GNU Tar
+Archives</b> <br>
+The GNU tar program started with a pre-POSIX format similar
+to that described earlier and has extended it using several
+different mechanisms: It added new fields to the empty space
+in the header (some of which was later used by POSIX for
+conflicting purposes); it allowed the header to be continued
+over multiple records; and it defined new entries that
+modify following entries (similar in principle to the
+<b>x</b> entry described above, but each GNU special entry
+is single-purpose, unlike the general-purpose <b>x</b>
+entry). As a result, GNU tar archives are not POSIX
+compatible, although more lenient POSIX-compliant readers
+can successfully extract most GNU tar archives.</p>
+
+<p style="margin-left:17%; margin-top: 1em">struct
+header_gnu_tar {</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char name[100];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mode[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char uid[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char gid[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char size[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char mtime[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char checksum[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char typeflag[1];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char linkname[100];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char magic[6];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char version[2];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char uname[32];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char gname[32];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char devmajor[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char devminor[8];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char atime[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char ctime[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char offset[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char longnames[4];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char unused[1];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">struct {</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+</td>
+<td width="12%">
+
+
+<p valign="top">char offset[12];</p></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+</td>
+<td width="12%">
+
+
+<p valign="top">char numbytes[12];</p></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">} sparse[4];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char isextended[1];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char realsize[12];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+<tr valign="top" align="left">
+<td width="29%"></td>
+<td width="13%">
+
+
+<p valign="top">char pad[17];</p></td>
+<td width="12%"></td>
+<td width="46%">
+</td>
+</table>
+
+<p style="margin-left:17%;">};</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>typeflag</i></p>
+
+<p style="margin-left:20%;">GNU tar uses the following
+special entry types, in addition to those defined by
+POSIX:</p>
+
+<p style="margin-top: 1em" valign="top">7</p>
+
+<p style="margin-left:32%; margin-top: 1em">GNU tar treats
+type &quot;7&quot; records identically to type &quot;0&quot;
+records, except on one obscure RTOS where they are used to
+indicate the pre-allocation of a contiguous file on
+disk.</p>
+
+<p style="margin-top: 1em" valign="top">D</p>
+
+<p style="margin-left:32%; margin-top: 1em">This indicates
+a directory entry. Unlike the POSIX-standard &quot;5&quot;
+typeflag, the header is followed by data records listing the
+names of files in this directory. Each name is preceded by
+an ASCII &quot;Y&quot; if the file is stored in this archive
+or &quot;N&quot; if the file is not stored in this archive.
+Each name is terminated with a null, and an extra null marks
+the end of the name list. The purpose of this entry is to
+support incremental backups; a program restoring from such
+an archive may wish to delete files on disk that did not
+exist in the directory when the archive was made.</p>
+
+<p style="margin-left:32%; margin-top: 1em">Note that the
+&quot;D&quot; typeflag specifically violates POSIX, which
+requires that unrecognized typeflags be restored as normal
+files. In this case, restoring the &quot;D&quot; entry as a
+file could interfere with subsequent creation of the
+like-named directory.</p>
+
+<p style="margin-top: 1em" valign="top">K</p>
+
+<p style="margin-left:32%; margin-top: 1em">The data for
+this entry is a long linkname for the following regular
+entry.</p>
+
+<p style="margin-top: 1em" valign="top">L</p>
+
+<p style="margin-left:32%; margin-top: 1em">The data for
+this entry is a long pathname for the following regular
+entry.</p>
+
+<p style="margin-top: 1em" valign="top">M</p>
+
+<p style="margin-left:32%; margin-top: 1em">This is a
+continuation of the last file on the previous volume. GNU
+multi-volume archives guarantee that each volume begins with
+a valid entry header. To ensure this, a file may be split,
+with part stored at the end of one volume, and part stored
+at the beginning of the next volume. The &quot;M&quot;
+typeflag indicates that this entry continues an existing
+file. Such entries can only occur as the first or second
+entry in an archive (the latter only if the first entry is a
+volume label). The <i>size</i> field specifies the size of
+this entry. The <i>offset</i> field at bytes 369-380
+specifies the offset where this file fragment begins. The
+<i>realsize</i> field specifies the total size of the file
+(which must equal <i>size</i> plus <i>offset</i>). When
+extracting, GNU tar checks that the header file name is the
+one it is expecting, that the header offset is in the
+correct sequence, and that the sum of offset and size is
+equal to realsize.</p>
+
+<p style="margin-top: 1em" valign="top">N</p>
+
+<p style="margin-left:32%; margin-top: 1em">Type
+&quot;N&quot; records are no longer generated by GNU tar.
+They contained a list of files to be renamed or symlinked
+after extraction; this was originally used to support long
+names. The contents of this record are a text description of
+the operations to be done, in the form &lsquo;&lsquo;Rename
+%s to %s\n&rsquo;&rsquo; or &lsquo;&lsquo;Symlink %s to
+%s\n&rsquo;&rsquo;; in either case, both filenames are
+escaped using K&amp;R C syntax. Due to security concerns,
+&quot;N&quot; records are now generally ignored when reading
+archives.</p>
+
+<p style="margin-top: 1em" valign="top">S</p>
+
+<p style="margin-left:32%; margin-top: 1em">This is a
+&lsquo;&lsquo;sparse&rsquo;&rsquo; regular file. Sparse
+files are stored as a series of fragments. The header
+contains a list of fragment offset/length pairs. If more
+than four such entries are required, the header is extended
+as necessary with &lsquo;&lsquo;extra&rsquo;&rsquo; header
+extensions (an older format that is no longer used), or
+&lsquo;&lsquo;sparse&rsquo;&rsquo; extensions.</p>
+
+<p style="margin-top: 1em" valign="top">V</p>
+
+<p style="margin-left:32%; margin-top: 1em">The <i>name</i>
+field should be interpreted as a tape/volume header name.
+This entry should generally be ignored on extraction.</p>
+
+<p style="margin-top: 1em" valign="top"><i>magic</i></p>
+
+<p style="margin-left:20%; margin-top: 1em">The magic field
+holds the five characters &lsquo;&lsquo;ustar&rsquo;&rsquo;
+followed by a space. Note that POSIX ustar archives have a
+trailing null.</p>
+
+<p style="margin-top: 1em" valign="top"><i>version</i></p>
+
+<p style="margin-left:20%;">The version field holds a space
+character followed by a null. Note that POSIX ustar archives
+use two copies of the ASCII digit
+&lsquo;&lsquo;0&rsquo;&rsquo;.</p>
+
+<p style="margin-top: 1em" valign="top"><i>atime</i>,
+<i>ctime</i></p>
+
+<p style="margin-left:20%;">The time the file was last
+accessed and the time of last change of file information,
+stored in octal as with <i>mtime</i>.</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>longnames</i></p>
+
+<p style="margin-left:20%;">This field is apparently no
+longer used.</p>
+
+<p style="margin-top: 1em" valign="top">Sparse <i>offset /
+numbytes</i></p>
+
+<p style="margin-left:20%;">Each such structure specifies a
+single fragment of a sparse file. The two fields store
+values as octal numbers. The fragments are each padded to a
+multiple of 512 bytes in the archive. On extraction, the
+list of fragments is collected from the header (including
+any extension headers), and the data is then read and
+written to the file at appropriate offsets.</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>isextended</i></p>
+
+<p style="margin-left:20%;">If this is set to non-zero, the
+header will be followed by additional &lsquo;&lsquo;sparse
+header&rsquo;&rsquo; records. Each such record contains
+information about as many as 21 additional sparse blocks as
+shown here:</p>
+
+<p style="margin-left:29%; margin-top: 1em">struct
+gnu_sparse_header {</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+
+
+<p valign="top">struct {</p></td>
+<td width="12%"></td>
+<td width="34%">
+</td>
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+</td>
+<td width="12%">
+
+
+<p valign="top">char offset[12];</p></td>
+<td width="34%">
+</td>
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+</td>
+<td width="12%">
+
+
+<p valign="top">char numbytes[12];</p></td>
+<td width="34%">
+</td>
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+
+
+<p valign="top">} sparse[21];</p></td>
+<td width="12%"></td>
+<td width="34%">
+</td>
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+
+
+<p valign="top">char isextended[1];</p></td>
+<td width="12%"></td>
+<td width="34%">
+</td>
+<tr valign="top" align="left">
+<td width="42%"></td>
+<td width="12%">
+
+
+<p valign="top">char padding[7];</p></td>
+<td width="12%"></td>
+<td width="34%">
+</td>
+</table>
+
+<p style="margin-left:29%;">};</p>
+
+
+<p style="margin-top: 1em" valign="top"><i>realsize</i></p>
+
+<p style="margin-left:20%;">A binary representation of the
+file&rsquo;s complete size, with a much larger range than
+the POSIX file size. In particular, with <b>M</b> type
+files, the current entry is only a portion of the file. In
+that case, the POSIX size field will indicate the size of
+this entry; the <i>realsize</i> field will indicate the
+total size of the file.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>GNU tar pax
+archives</b> <br>
+GNU tar 1.14 (XXX check this XXX) and later will write pax
+interchange format archives when you specify the
+<b>&minus;-posix</b> flag. This format uses custom keywords
+to store sparse file information. There have been three
+iterations of this support, referred to as
+&lsquo;&lsquo;0.0&rsquo;&rsquo;,
+&lsquo;&lsquo;0.1&rsquo;&rsquo;, and
+&lsquo;&lsquo;1.0&rsquo;&rsquo;.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>GNU.sparse.numblocks</b>,
+<b>GNU.sparse.offset</b>, <b>GNU.sparse.numbytes</b>,
+<b>GNU.sparse.size</b></p>
+
+<p style="margin-left:20%;">The
+&lsquo;&lsquo;0.0&rsquo;&rsquo; format used an initial
+<b>GNU.sparse.numblocks</b> attribute to indicate the number
+of blocks in the file, a pair of <b>GNU.sparse.offset</b>
+and <b>GNU.sparse.numbytes</b> to indicate the offset and
+size of each block, and a single <b>GNU.sparse.size</b> to
+indicate the full size of the file. This is not the same as
+the size in the tar header because the latter value does not
+include the size of any holes. This format required that the
+order of attributes be preserved and relied on readers
+accepting multiple appearances of the same attribute names,
+which is not officially permitted by the standards.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>GNU.sparse.map</b></p>
+
+<p style="margin-left:20%;">The
+&lsquo;&lsquo;0.1&rsquo;&rsquo; format used a single
+attribute that stored a comma-separated list of decimal
+numbers. Each pair of numbers indicated the offset and size,
+respectively, of a block of data. This does not work well if
+the archive is extracted by an archiver that does not
+recognize this extension, since many pax implementations
+simply discard unrecognized attributes.</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>GNU.sparse.major</b>,
+<b>GNU.sparse.minor</b>, <b>GNU.sparse.name</b>,
+<b>GNU.sparse.realsize</b></p>
+
+<p style="margin-left:20%;">The
+&lsquo;&lsquo;1.0&rsquo;&rsquo; format stores the sparse
+block map in one or more 512-byte blocks prepended to the
+file data in the entry body. The pax attributes indicate the
+existence of this map (via the <b>GNU.sparse.major</b> and
+<b>GNU.sparse.minor</b> fields) and the full size of the
+file. The <b>GNU.sparse.name</b> holds the true name of the
+file. To avoid confusion, the name stored in the regular tar
+header is a modified name so that extraction errors will be
+apparent to users.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Solaris
+Tar</b> <br>
+XXX More Details Needed XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em">Solaris tar
+(beginning with SunOS XXX 5.7 ?? XXX) supports an
+&lsquo;&lsquo;extended&rsquo;&rsquo; format that is
+fundamentally similar to pax interchange format, with the
+following differences:</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">Extended attributes are stored
+in an entry whose type is <b>X</b>, not <b>x</b>, as used by
+pax interchange format. The detailed format of this entry
+appears to be the same as detailed above for the <b>x</b>
+entry.</p>
+
+<p valign="top"><b>&bull;</b></p>
+
+<p style="margin-left:20%;">An additional <b>A</b> entry is
+used to store an ACL for the following regular entry. The
+body of this entry contains a seven-digit octal number
+followed by a zero byte, followed by the textual ACL
+description. The octal value is the number of ACL entries
+plus a constant that indicates the ACL type: 01000000 for
+POSIX.1e ACLs and 03000000 for NFSv4 ACLs.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>AIX Tar</b>
+<br>
+XXX More details needed XXX</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Mac OS X
+Tar</b> <br>
+The tar distributed with Apple&rsquo;s Mac OS X stores most
+regular files as two separate entries in the tar archive.
+The two entries have the same name except that the first one
+has &lsquo;&lsquo;._&rsquo;&rsquo; added to the beginning of
+the name. This first entry stores the &lsquo;&lsquo;resource
+fork&rsquo;&rsquo; with additional attributes for the file.
+The Mac OS X <b>CopyFile</b>() API is used to separate a
+file on disk into separate resource and data streams and to
+reassemble those separate streams when the file is restored
+to disk.</p>
+
+<p style="margin-left:8%; margin-top: 1em"><b>Other
+Extensions</b> <br>
+One obvious extension to increase the size of files is to
+eliminate the terminating characters from the various
+numeric fields. For example, the standard only allows the
+size field to contain 11 octal digits, reserving the twelfth
+byte for a trailing NUL character. Allowing 12 octal digits
+allows file sizes up to 64 GB.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Another
+extension, utilized by GNU tar, star, and other newer
+<b>tar</b> implementations, permits binary numbers in the
+standard numeric fields. This is flagged by setting the high
+bit of the first byte. This permits 95-bit values for the
+length and time fields and 63-bit values for the uid, gid,
+and device numbers. GNU tar supports this extension for the
+length, mtime, ctime, and atime fields. Joerg
+Schilling&rsquo;s star program supports this extension for
+all numeric fields. Note that this extension is largely
+obsoleted by the extended attribute record provided by the
+pax interchange format.</p>
+
+<p style="margin-left:8%; margin-top: 1em">Another early
+GNU extension allowed base-64 values rather than octal. This
+extension was short-lived and is no longer supported by any
+implementation.</p>
+
+<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>
+
+<p style="margin-left:8%;">ar(1), pax(1), tar(1)</p>
+
+
+<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>
+
+<p style="margin-left:8%;">The <b>tar</b> utility is no
+longer a part of POSIX or the Single Unix Standard. It last
+appeared in Version&nbsp;2 of the Single UNIX Specification
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
+in subsequent standards by pax(1). The ustar format is
+currently part of the specification for the pax(1) utility.
+The pax interchange file format is new with IEEE Std
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;).</p>
+
+<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
+
+<p style="margin-left:8%;">A <b>tar</b> command appeared in
+Seventh Edition Unix, which was released in January, 1979.
+It replaced the <b>tp</b> program from Fourth Edition Unix
+which in turn replaced the <b>tap</b> program from First
+Edition Unix. John Gilmore&rsquo;s <b>pdtar</b>
+public-domain implementation (circa 1987) was highly
+influential and formed the basis of <b>GNU tar</b> (circa
+1988). Joerg Shilling&rsquo;s <b>star</b> archiver is
+another open-source (GPL) archiver (originally developed
+circa 1985) which features complete support for pax
+interchange format.</p>
+
+<p style="margin-left:8%; margin-top: 1em">This
+documentation was written as part of the <b>libarchive</b>
+and <b>bsdtar</b> project by Tim Kientzle
+&lang;kientzle@FreeBSD.org&rang;.</p>
+
+
+<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
+December&nbsp;27, 2009 FreeBSD&nbsp;8.0</p>
+<hr>
+</body>
+</html>
diff --git a/archivers/libarchive/files/doc/man/Makefile b/archivers/libarchive/files/doc/man/Makefile
index c33aac4c647..d3a90196331 100644
--- a/archivers/libarchive/files/doc/man/Makefile
+++ b/archivers/libarchive/files/doc/man/Makefile
@@ -8,6 +8,9 @@ archive_entry.3: ../mdoc2man.awk ../../libarchive/archive_entry.3
archive_read.3: ../mdoc2man.awk ../../libarchive/archive_read.3
awk -f ../mdoc2man.awk < ../../libarchive/archive_read.3 > archive_read.3
+archive_read_disk.3: ../mdoc2man.awk ../../libarchive/archive_read_disk.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_read_disk.3 > archive_read_disk.3
+
archive_util.3: ../mdoc2man.awk ../../libarchive/archive_util.3
awk -f ../mdoc2man.awk < ../../libarchive/archive_util.3 > archive_util.3
@@ -40,4 +43,4 @@ bsdtar.1: ../mdoc2man.awk ../../tar/bsdtar.1
bsdcpio.1: ../mdoc2man.awk ../../cpio/bsdcpio.1
awk -f ../mdoc2man.awk < ../../cpio/bsdcpio.1 > bsdcpio.1
-all: archive_entry.3 archive_read.3 archive_util.3 archive_write.3 archive_write_disk.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
+all: archive_entry.3 archive_read.3 archive_read_disk.3 archive_util.3 archive_write.3 archive_write_disk.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
diff --git a/archivers/libarchive/files/doc/man/archive_entry.3 b/archivers/libarchive/files/doc/man/archive_entry.3
index 994b4743c33..d459f00af99 100644
--- a/archivers/libarchive/files/doc/man/archive_entry.3
+++ b/archivers/libarchive/files/doc/man/archive_entry.3
@@ -1,530 +1,370 @@
.TH archive_entry 3 "May 12, 2008" ""
.SH NAME
-\fBarchive_entry_acl_add_entry\fP,
-\fBarchive_entry_acl_add_entry_w\fP,
-\fBarchive_entry_acl_clear\fP,
-\fBarchive_entry_acl_count\fP,
-\fBarchive_entry_acl_next\fP,
-\fBarchive_entry_acl_next_w\fP,
-\fBarchive_entry_acl_reset\fP,
-\fBarchive_entry_acl_text_w\fP,
-\fBarchive_entry_atime\fP,
-\fBarchive_entry_atime_nsec\fP,
-\fBarchive_entry_clear\fP,
-\fBarchive_entry_clone\fP,
-\fBarchive_entry_copy_fflags_text\fP,
-\fBarchive_entry_copy_fflags_text_w\fP,
-\fBarchive_entry_copy_gname\fP,
-\fBarchive_entry_copy_gname_w\fP,
-\fBarchive_entry_copy_hardlink\fP,
-\fBarchive_entry_copy_hardlink_w\fP,
-\fBarchive_entry_copy_link\fP,
-\fBarchive_entry_copy_link_w\fP,
-\fBarchive_entry_copy_pathname_w\fP,
-\fBarchive_entry_copy_sourcepath\fP,
-\fBarchive_entry_copy_stat\fP,
-\fBarchive_entry_copy_symlink\fP,
-\fBarchive_entry_copy_symlink_w\fP,
-\fBarchive_entry_copy_uname\fP,
-\fBarchive_entry_copy_uname_w\fP,
-\fBarchive_entry_dev\fP,
-\fBarchive_entry_devmajor\fP,
-\fBarchive_entry_devminor\fP,
-\fBarchive_entry_filetype\fP,
-\fBarchive_entry_fflags\fP,
-\fBarchive_entry_fflags_text\fP,
-\fBarchive_entry_free\fP,
-\fBarchive_entry_gid\fP,
-\fBarchive_entry_gname\fP,
-\fBarchive_entry_hardlink\fP,
-\fBarchive_entry_ino\fP,
-\fBarchive_entry_mode\fP,
-\fBarchive_entry_mtime\fP,
-\fBarchive_entry_mtime_nsec\fP,
-\fBarchive_entry_nlink\fP,
-\fBarchive_entry_new\fP,
-\fBarchive_entry_pathname\fP,
-\fBarchive_entry_pathname_w\fP,
-\fBarchive_entry_rdev\fP,
-\fBarchive_entry_rdevmajor\fP,
-\fBarchive_entry_rdevminor\fP,
-\fBarchive_entry_set_atime\fP,
-\fBarchive_entry_set_ctime\fP,
-\fBarchive_entry_set_dev\fP,
-\fBarchive_entry_set_devmajor\fP,
-\fBarchive_entry_set_devminor\fP,
-\fBarchive_entry_set_filetype\fP,
-\fBarchive_entry_set_fflags\fP,
-\fBarchive_entry_set_gid\fP,
-\fBarchive_entry_set_gname\fP,
-\fBarchive_entry_set_hardlink\fP,
-\fBarchive_entry_set_link\fP,
-\fBarchive_entry_set_mode\fP,
-\fBarchive_entry_set_mtime\fP,
-\fBarchive_entry_set_pathname\fP,
-\fBarchive_entry_set_rdevmajor\fP,
-\fBarchive_entry_set_rdevminor\fP,
-\fBarchive_entry_set_size\fP,
-\fBarchive_entry_set_symlink\fP,
-\fBarchive_entry_set_uid\fP,
-\fBarchive_entry_set_uname\fP,
-\fBarchive_entry_size\fP,
-\fBarchive_entry_sourcepath\fP,
-\fBarchive_entry_stat\fP,
-\fBarchive_entry_symlink\fP,
-\fBarchive_entry_uid\fP,
-\fBarchive_entry_uname\fP
+.ad l
+\fB\%archive_entry_acl_add_entry\fP,
+\fB\%archive_entry_acl_add_entry_w\fP,
+\fB\%archive_entry_acl_clear\fP,
+\fB\%archive_entry_acl_count\fP,
+\fB\%archive_entry_acl_next\fP,
+\fB\%archive_entry_acl_next_w\fP,
+\fB\%archive_entry_acl_reset\fP,
+\fB\%archive_entry_acl_text_w\fP,
+\fB\%archive_entry_atime\fP,
+\fB\%archive_entry_atime_nsec\fP,
+\fB\%archive_entry_clear\fP,
+\fB\%archive_entry_clone\fP,
+\fB\%archive_entry_copy_fflags_text\fP,
+\fB\%archive_entry_copy_fflags_text_w\fP,
+\fB\%archive_entry_copy_gname\fP,
+\fB\%archive_entry_copy_gname_w\fP,
+\fB\%archive_entry_copy_hardlink\fP,
+\fB\%archive_entry_copy_hardlink_w\fP,
+\fB\%archive_entry_copy_link\fP,
+\fB\%archive_entry_copy_link_w\fP,
+\fB\%archive_entry_copy_pathname_w\fP,
+\fB\%archive_entry_copy_sourcepath\fP,
+\fB\%archive_entry_copy_stat\fP,
+\fB\%archive_entry_copy_symlink\fP,
+\fB\%archive_entry_copy_symlink_w\fP,
+\fB\%archive_entry_copy_uname\fP,
+\fB\%archive_entry_copy_uname_w\fP,
+\fB\%archive_entry_dev\fP,
+\fB\%archive_entry_devmajor\fP,
+\fB\%archive_entry_devminor\fP,
+\fB\%archive_entry_filetype\fP,
+\fB\%archive_entry_fflags\fP,
+\fB\%archive_entry_fflags_text\fP,
+\fB\%archive_entry_free\fP,
+\fB\%archive_entry_gid\fP,
+\fB\%archive_entry_gname\fP,
+\fB\%archive_entry_hardlink\fP,
+\fB\%archive_entry_ino\fP,
+\fB\%archive_entry_mode\fP,
+\fB\%archive_entry_mtime\fP,
+\fB\%archive_entry_mtime_nsec\fP,
+\fB\%archive_entry_nlink\fP,
+\fB\%archive_entry_new\fP,
+\fB\%archive_entry_pathname\fP,
+\fB\%archive_entry_pathname_w\fP,
+\fB\%archive_entry_rdev\fP,
+\fB\%archive_entry_rdevmajor\fP,
+\fB\%archive_entry_rdevminor\fP,
+\fB\%archive_entry_set_atime\fP,
+\fB\%archive_entry_set_ctime\fP,
+\fB\%archive_entry_set_dev\fP,
+\fB\%archive_entry_set_devmajor\fP,
+\fB\%archive_entry_set_devminor\fP,
+\fB\%archive_entry_set_filetype\fP,
+\fB\%archive_entry_set_fflags\fP,
+\fB\%archive_entry_set_gid\fP,
+\fB\%archive_entry_set_gname\fP,
+\fB\%archive_entry_set_hardlink\fP,
+\fB\%archive_entry_set_link\fP,
+\fB\%archive_entry_set_mode\fP,
+\fB\%archive_entry_set_mtime\fP,
+\fB\%archive_entry_set_pathname\fP,
+\fB\%archive_entry_set_rdevmajor\fP,
+\fB\%archive_entry_set_rdevminor\fP,
+\fB\%archive_entry_set_size\fP,
+\fB\%archive_entry_set_symlink\fP,
+\fB\%archive_entry_set_uid\fP,
+\fB\%archive_entry_set_uname\fP,
+\fB\%archive_entry_size\fP,
+\fB\%archive_entry_sourcepath\fP,
+\fB\%archive_entry_stat\fP,
+\fB\%archive_entry_symlink\fP,
+\fB\%archive_entry_uid\fP,
+\fB\%archive_entry_uname\fP
\- functions for manipulating archive entry descriptions
.SH SYNOPSIS
+.ad l
\fB#include <archive_entry.h>\fP
.br
\fIvoid\fP
-.RE
-Fo archive_entry_acl_add_entry
-Fa "struct archive_entry *"
-Fa "int type"
-Fa "int permset"
-Fa "int tag"
-Fa "int qual"
-Fa "const char *name"
-Fc
+.br
+\fB\%archive_entry_acl_add_entry\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ type\fP, \fI\%int\ permset\fP, \fI\%int\ tag\fP, \fI\%int\ qual\fP, \fI\%const\ char\ *name\fP);
+.br
\fIvoid\fP
-.RE
-Fo archive_entry_acl_add_entry_w
-Fa "struct archive_entry *"
-Fa "int type"
-Fa "int permset"
-Fa "int tag"
-Fa "int qual"
-Fa "const wchar_t *name"
-Fc
+.br
+\fB\%archive_entry_acl_add_entry_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ type\fP, \fI\%int\ permset\fP, \fI\%int\ tag\fP, \fI\%int\ qual\fP, \fI\%const\ wchar_t\ *name\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_acl_clear\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_acl_clear\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_entry_acl_count\fP
-.hy
-("struct archive_entry *" "int type");
+.br
+\fB\%archive_entry_acl_count\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ type\fP);
+.br
\fIint\fP
-.RE
-Fo archive_entry_acl_next
-Fa "struct archive_entry *"
-Fa "int want_type"
-Fa "int *type"
-Fa "int *permset"
-Fa "int *tag"
-Fa "int *qual"
-Fa "const char **name"
-Fc
+.br
+\fB\%archive_entry_acl_next\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ want_type\fP, \fI\%int\ *type\fP, \fI\%int\ *permset\fP, \fI\%int\ *tag\fP, \fI\%int\ *qual\fP, \fI\%const\ char\ **name\fP);
+.br
\fIint\fP
-.RE
-Fo archive_entry_acl_next_w
-Fa "struct archive_entry *"
-Fa "int want_type"
-Fa "int *type"
-Fa "int *permset"
-Fa "int *tag"
-Fa "int *qual"
-Fa "const wchar_t **name"
-Fc
+.br
+\fB\%archive_entry_acl_next_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ want_type\fP, \fI\%int\ *type\fP, \fI\%int\ *permset\fP, \fI\%int\ *tag\fP, \fI\%int\ *qual\fP, \fI\%const\ wchar_t\ **name\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_entry_acl_reset\fP
-.hy
-("struct archive_entry *" "int want_type");
+.br
+\fB\%archive_entry_acl_reset\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ want_type\fP);
+.br
\fIconst wchar_t *\fP
-.RE
-.nh
-\fBarchive_entry_acl_text_w\fP
-.hy
-("struct archive_entry *" "int flags");
+.br
+\fB\%archive_entry_acl_text_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int\ flags\fP);
+.br
\fItime_t\fP
-.RE
-.nh
-\fBarchive_entry_atime\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_atime\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIlong\fP
-.RE
-.nh
-\fBarchive_entry_atime_nsec\fP
-.hy
-("struct archive_entry *");
-\fI"struct archive_entry *"\fP
-.RE
-.nh
-\fBarchive_entry_clear\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_atime_nsec\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIstruct archive_entry *\fP
-.RE
-.nh
-\fBarchive_entry_clone\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_clear\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
+\fIstruct archive_entry *\fP
+.br
+\fB\%archive_entry_clone\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char * *\fP
-.RE
-.nh
-\fBarchive_entry_copy_fflags_text_w\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_fflags_text_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIconst wchar_t *\fP
-.RE
-.nh
-\fBarchive_entry_copy_fflags_text_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_fflags_text_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_gname\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_gname\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_gname_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_gname_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_hardlink\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_hardlink\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_hardlink_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_hardlink_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_sourcepath\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_sourcepath\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_pathname_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_pathname_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_stat\fP
-.hy
-("struct archive_entry *" "const struct stat *");
+.br
+\fB\%archive_entry_copy_stat\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ struct\ stat\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_symlink\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_symlink\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_symlink_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_symlink_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_uname\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_copy_uname\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_copy_uname_w\fP
-.hy
-("struct archive_entry *" "const wchar_t *");
+.br
+\fB\%archive_entry_copy_uname_w\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ wchar_t\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_dev\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_dev\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_devmajor\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_devmajor\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_devminor\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_devminor\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fImode_t\fP
-.RE
-.nh
-\fBarchive_entry_filetype\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_filetype\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIvoid\fP
-.RE
-Fo archive_entry_fflags
-Fa "struct archive_entry *"
-Fa "unsigned long *set"
-Fa "unsigned long *clear"
-Fc
+.br
+\fB\%archive_entry_fflags\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%unsigned\ long\ *set\fP, \fI\%unsigned\ long\ *clear\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_fflags_text\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_fflags_text\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_free\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_free\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_gname\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_gname\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_hardlink\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_hardlink\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIino_t\fP
-.RE
-.nh
-\fBarchive_entry_ino\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_ino\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fImode_t\fP
-.RE
-.nh
-\fBarchive_entry_mode\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_mode\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fItime_t\fP
-.RE
-.nh
-\fBarchive_entry_mtime\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_mtime\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIlong\fP
-.RE
-.nh
-\fBarchive_entry_mtime_nsec\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_mtime_nsec\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIunsigned int\fP
-.RE
-.nh
-\fBarchive_entry_nlink\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_nlink\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIstruct archive_entry *\fP
-.RE
-.nh
-\fBarchive_entry_new\fP
-.hy
-("void");
+.br
+\fB\%archive_entry_new\fP(\fI\%void\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_pathname\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_pathname\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst wchar_t *\fP
-.RE
-.nh
-\fBarchive_entry_pathname_w\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_pathname_w\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_rdev\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_rdev\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_rdevmajor\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_rdevmajor\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIdev_t\fP
-.RE
-.nh
-\fBarchive_entry_rdevminor\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_rdevminor\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_dev\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_dev\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_devmajor\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_devmajor\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_devminor\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_devminor\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_filetype\fP
-.hy
-("struct archive_entry *" "unsigned int");
+.br
+\fB\%archive_entry_set_filetype\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%unsigned\ int\fP);
+.br
\fIvoid\fP
-.RE
-Fo archive_entry_set_fflags
-Fa "struct archive_entry *"
-Fa "unsigned long set"
-Fa "unsigned long clear"
-Fc
+.br
+\fB\%archive_entry_set_fflags\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%unsigned\ long\ set\fP, \fI\%unsigned\ long\ clear\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_gid\fP
-.hy
-("struct archive_entry *" "gid_t");
+.br
+\fB\%archive_entry_set_gid\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%gid_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_gname\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_gname\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_hardlink\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_hardlink\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_ino\fP
-.hy
-("struct archive_entry *" "unsigned long");
+.br
+\fB\%archive_entry_set_ino\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%unsigned\ long\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_link\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_link\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_mode\fP
-.hy
-("struct archive_entry *" "mode_t");
+.br
+\fB\%archive_entry_set_mode\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%mode_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_mtime\fP
-.hy
-("struct archive_entry *" "time_t" "long nanos");
+.br
+\fB\%archive_entry_set_mtime\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%time_t\fP, \fI\%long\ nanos\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_nlink\fP
-.hy
-("struct archive_entry *" "unsigned int");
+.br
+\fB\%archive_entry_set_nlink\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%unsigned\ int\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_pathname\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_pathname\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_rdev\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_rdev\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_rdevmajor\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_rdevmajor\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_rdevminor\fP
-.hy
-("struct archive_entry *" "dev_t");
+.br
+\fB\%archive_entry_set_rdevminor\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%dev_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_size\fP
-.hy
-("struct archive_entry *" "int64_t");
+.br
+\fB\%archive_entry_set_size\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%int64_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_symlink\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_symlink\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_uid\fP
-.hy
-("struct archive_entry *" "uid_t");
+.br
+\fB\%archive_entry_set_uid\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%uid_t\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_entry_set_uname\fP
-.hy
-("struct archive_entry *" "const char *");
+.br
+\fB\%archive_entry_set_uname\fP(\fI\%struct\ archive_entry\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIint64_t\fP
-.RE
-.nh
-\fBarchive_entry_size\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_size\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_sourcepath\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_sourcepath\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst struct stat *\fP
-.RE
-.nh
-\fBarchive_entry_stat\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_stat\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_symlink\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_symlink\fP(\fI\%struct\ archive_entry\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_entry_uname\fP
-.hy
-("struct archive_entry *");
+.br
+\fB\%archive_entry_uname\fP(\fI\%struct\ archive_entry\ *\fP);
.SH DESCRIPTION
+.ad l
These functions create and manipulate data objects that
represent entries within an archive.
You can think of a
@@ -542,63 +382,46 @@ entry in an archive.
There are functions to allocate, destroy, clear, and copy
\fIarchive_entry\fP
objects:
+.RS 5
.TP
-.nh
-\fBarchive_entry_clear\fP
-.hy
-();
+\fB\%archive_entry_clear\fP()
Erases the object, resetting all internal fields to the
same state as a newly-created object.
This is provided to allow you to quickly recycle objects
without thrashing the heap.
.TP
-.nh
-\fBarchive_entry_clone\fP
-.hy
-();
+\fB\%archive_entry_clone\fP()
A deep copy operation; all text fields are duplicated.
.TP
-.nh
-\fBarchive_entry_free\fP
-.hy
-();
+\fB\%archive_entry_free\fP()
Releases the
Tn struct archive_entry
object.
.TP
-.nh
-\fBarchive_entry_new\fP
-.hy
-();
+\fB\%archive_entry_new\fP()
Allocate and return a blank
Tn struct archive_entry
object.
+.RE
.SS Set and Get Functions
Most of the functions here set or read entries in an object.
Such functions have one of the following forms:
+.RS 5
.TP
-.nh
-\fBarchive_entry_set_XXXX\fP
-.hy
-();
+\fB\%archive_entry_set_XXXX\fP()
Stores the provided data in the object.
In particular, for strings, the pointer is stored,
not the referenced string.
.TP
-.nh
-\fBarchive_entry_copy_XXXX\fP
-.hy
-();
+\fB\%archive_entry_copy_XXXX\fP()
As above, except that the referenced data is copied
into the object.
.TP
-.nh
-\fBarchive_entry_XXXX\fP
-.hy
-();
+\fB\%archive_entry_XXXX\fP()
Returns the specified data.
In the case of strings, a const-qualified pointer to
the string is returned.
+.RE
String data can be set or accessed as wide character strings
or normal
\fIchar\fP
@@ -612,14 +435,14 @@ using the current locale.
Similarly, if you store a wide string and then store a
narrow string for the same data, the previously-set wide string will
be discarded in favor of the new data.
+.PP
There are a few set/get functions that merit additional description:
+.RS 5
.TP
-.nh
-\fBarchive_entry_set_link\fP
-.hy
-();
+\fB\%archive_entry_set_link\fP()
This function sets the symlink field if it is already set.
Otherwise, it sets the hardlink field.
+.RE
.SS File Flags
File flags are transparently converted between a bitmap
representation and a textual format.
@@ -631,6 +454,7 @@ If you need to canonicalize a textual flags string, you should first set the
text form, then request the bitmap form, then use that to set the bitmap form.
Setting the bitmap format will clear the internal text representation
and force it to be reconstructed when you next request the text form.
+.PP
The bitmap format consists of two integers, one containing bits
that should be set, the other specifying bits that should be
cleared.
@@ -645,17 +469,12 @@ which only includes names for set bits.)
Converting a bitmap to a textual string is a platform-specific
operation; bits that are not meaningful on the current platform
will be ignored.
+.PP
The canonical text format is a comma-separated list of flag names.
The
-.nh
-\fBarchive_entry_copy_fflags_text\fP
-.hy
-();
+\fB\%archive_entry_copy_fflags_text\fP()
and
-.nh
-\fBarchive_entry_copy_fflags_text_w\fP
-.hy
-();
+\fB\%archive_entry_copy_fflags_text_w\fP()
functions parse the provided text and sets the internal bitmap values.
This is a platform-specific operation; names that are not meaningful
on the current platform will be ignored.
@@ -670,6 +489,7 @@ which stops parsing at the first unrecognized name.)
.SS ACL Handling
XXX This needs serious help.
XXX
+.PP
An
``Access Control List''
(ACL) is a list of permissions that grant access to particular users or
@@ -679,17 +499,21 @@ specification.
In particular, POSIX.1e draft 17 specifies several different formats, but
none of those formats include both textual user/group names and numeric
UIDs/GIDs.
+.PP
XXX explain ACL stuff XXX
.SH SEE ALSO
+.ad l
\fBarchive\fP(3)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/man/archive_read.3 b/archivers/libarchive/files/doc/man/archive_read.3
index 91908e824ec..b1bd4f3dcca 100644
--- a/archivers/libarchive/files/doc/man/archive_read.3
+++ b/archivers/libarchive/files/doc/man/archive_read.3
@@ -1,233 +1,212 @@
-.TH archive_read 3 "August 19, 2006" ""
+.TH archive_read 3 "April 13, 2009" ""
.SH NAME
-\fBarchive_read_new\fP,
-\fBarchive_read_support_compression_all\fP,
-\fBarchive_read_support_compression_bzip2\fP,
-\fBarchive_read_support_compression_compress\fP,
-\fBarchive_read_support_compression_gzip\fP,
-\fBarchive_read_support_compression_none\fP,
-\fBarchive_read_support_compression_program\fP,
-\fBarchive_read_support_format_all\fP,
-\fBarchive_read_support_format_cpio\fP,
-\fBarchive_read_support_format_empty\fP,
-\fBarchive_read_support_format_iso9660\fP,
-\fBarchive_read_support_format_tar\fP,
-\fBarchive_read_support_format_zip\fP,
-\fBarchive_read_open\fP,
-\fBarchive_read_open2\fP,
-\fBarchive_read_open_fd\fP,
-\fBarchive_read_open_FILE\fP,
-\fBarchive_read_open_filename\fP,
-\fBarchive_read_open_memory\fP,
-\fBarchive_read_next_header\fP,
-\fBarchive_read_data\fP,
-\fBarchive_read_data_block\fP,
-\fBarchive_read_data_skip\fP,
-\fBarchive_read_data_into_buffer\fP,
-\fBarchive_read_data_into_fd\fP,
-\fBarchive_read_extract\fP,
-\fBarchive_read_extract2\fP,
-\fBarchive_read_extract_set_progress_callback\fP,
-\fBarchive_read_close\fP,
-\fBarchive_read_finish\fP
+.ad l
+\fB\%archive_read_new\fP,
+\fB\%archive_read_set_filter_options\fP,
+\fB\%archive_read_set_format_options\fP,
+\fB\%archive_read_set_options\fP,
+\fB\%archive_read_support_compression_all\fP,
+\fB\%archive_read_support_compression_bzip2\fP,
+\fB\%archive_read_support_compression_compress\fP,
+\fB\%archive_read_support_compression_gzip\fP,
+\fB\%archive_read_support_compression_lzma\fP,
+\fB\%archive_read_support_compression_none\fP,
+\fB\%archive_read_support_compression_xz\fP,
+\fB\%archive_read_support_compression_program\fP,
+\fB\%archive_read_support_compression_program_signature\fP,
+\fB\%archive_read_support_format_all\fP,
+\fB\%archive_read_support_format_ar\fP,
+\fB\%archive_read_support_format_cpio\fP,
+\fB\%archive_read_support_format_empty\fP,
+\fB\%archive_read_support_format_iso9660\fP,
+\fB\%archive_read_support_format_mtree,\fP
+\fB\%archive_read_support_format_raw,\fP
+\fB\%archive_read_support_format_tar\fP,
+\fB\%archive_read_support_format_zip\fP,
+\fB\%archive_read_open\fP,
+\fB\%archive_read_open2\fP,
+\fB\%archive_read_open_fd\fP,
+\fB\%archive_read_open_FILE\fP,
+\fB\%archive_read_open_filename\fP,
+\fB\%archive_read_open_memory\fP,
+\fB\%archive_read_next_header\fP,
+\fB\%archive_read_next_header2\fP,
+\fB\%archive_read_data\fP,
+\fB\%archive_read_data_block\fP,
+\fB\%archive_read_data_skip\fP,
+\fB\%archive_read_data_into_buffer\fP,
+\fB\%archive_read_data_into_fd\fP,
+\fB\%archive_read_extract\fP,
+\fB\%archive_read_extract2\fP,
+\fB\%archive_read_extract_set_progress_callback\fP,
+\fB\%archive_read_close\fP,
+\fB\%archive_read_finish\fP
\- functions for reading streaming archives
.SH SYNOPSIS
+.ad l
\fB#include <archive.h>\fP
.br
\fIstruct archive *\fP
-.RE
-.nh
-\fBarchive_read_new\fP
-.hy
-("void");
+.br
+\fB\%archive_read_new\fP(\fI\%void\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_compression_all\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_all\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_compression_bzip2\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_bzip2\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_compression_compress\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_compress\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_compression_gzip\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_gzip\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_compression_none\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_lzma\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_support_compression_program
-Fa "struct archive *"
-Fa "const char *cmd"
-Fc
+.br
+\fB\%archive_read_support_compression_none\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_all\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_xz\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_cpio\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_program\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *cmd\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_empty\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_compression_program_signature\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *cmd\fP, \fI\%const\ void\ *signature\fP, \fI\%size_t\ signature_length\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_iso9660\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_format_all\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_tar\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_format_ar\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_support_format_zip\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_support_format_cpio\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_open
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "archive_open_callback *"
-Fa "archive_read_callback *"
-Fa "archive_close_callback *"
-Fc
+.br
+\fB\%archive_read_support_format_empty\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_open2
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "archive_open_callback *"
-Fa "archive_read_callback *"
-Fa "archive_skip_callback *"
-Fa "archive_close_callback *"
-Fc
+.br
+\fB\%archive_read_support_format_iso9660\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_open_FILE\fP
-.hy
-("struct archive *" "FILE *file");
+.br
+\fB\%archive_read_support_format_mtree\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_open_fd\fP
-.hy
-("struct archive *" "int fd" "size_t block_size");
+.br
+\fB\%archive_read_support_format_raw\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_open_filename
-Fa "struct archive *"
-Fa "const char *filename"
-Fa "size_t block_size"
-Fc
+.br
+\fB\%archive_read_support_format_tar\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_open_memory\fP
-.hy
-("struct archive *" "void *buff" "size_t size");
+.br
+\fB\%archive_read_support_format_zip\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_next_header\fP
-.hy
-("struct archive *" "struct archive_entry **");
+.br
+\fB\%archive_read_set_filter_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_set_format_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_set_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%archive_open_callback\ *\fP, \fI\%archive_read_callback\ *\fP, \fI\%archive_close_callback\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open2\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%archive_open_callback\ *\fP, \fI\%archive_read_callback\ *\fP, \fI\%archive_skip_callback\ *\fP, \fI\%archive_close_callback\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open_FILE\fP(\fI\%struct\ archive\ *\fP, \fI\%FILE\ *file\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open_fd\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ fd\fP, \fI\%size_t\ block_size\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open_filename\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *filename\fP, \fI\%size_t\ block_size\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_open_memory\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *buff\fP, \fI\%size_t\ size\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_next_header\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ **\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_next_header2\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP);
+.br
\fIssize_t\fP
-.RE
-.nh
-\fBarchive_read_data\fP
-.hy
-("struct archive *" "void *buff" "size_t len");
+.br
+\fB\%archive_read_data\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *buff\fP, \fI\%size_t\ len\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_data_block
-Fa "struct archive *"
-Fa "const void **buff"
-Fa "size_t *len"
-Fa "off_t *offset"
-Fc
+.br
+\fB\%archive_read_data_block\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ **buff\fP, \fI\%size_t\ *len\fP, \fI\%off_t\ *offset\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_data_skip\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_data_skip\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_data_into_buffer\fP
-.hy
-("struct archive *" "void *" "ssize_t len");
+.br
+\fB\%archive_read_data_into_buffer\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%ssize_t\ len\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_data_into_fd\fP
-.hy
-("struct archive *" "int fd");
+.br
+\fB\%archive_read_data_into_fd\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ fd\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_extract
-Fa "struct archive *"
-Fa "struct archive_entry *"
-Fa "int flags"
-Fc
+.br
+\fB\%archive_read_extract\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP, \fI\%int\ flags\fP);
+.br
\fIint\fP
-.RE
-Fo archive_read_extract2
-Fa "struct archive *src"
-Fa "struct archive_entry *"
-Fa "struct archive *dest"
-Fc
+.br
+\fB\%archive_read_extract2\fP(\fI\%struct\ archive\ *src\fP, \fI\%struct\ archive_entry\ *\fP, \fI\%struct\ archive\ *dest\fP);
+.br
\fIvoid\fP
-.RE
-Fo archive_read_extract_set_progress_callback
-Fa "struct archive *"
-Fa "void (*func)(void *)"
-Fa "void *user_data"
-Fc
+.br
+\fB\%archive_read_extract_set_progress_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ (*func)(void\ *)\fP, \fI\%void\ *user_data\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_close\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_close\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_read_finish\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_read_finish\fP(\fI\%struct\ archive\ *\fP);
.SH DESCRIPTION
+.ad l
These functions provide a complete API for reading streaming archives.
The general process is to first create the
Tn struct archive
@@ -236,244 +215,206 @@ headers and associated data, then close the archive and release all
resources.
The following summary describes the functions in approximately the
order they would be used:
+.RS 5
.TP
-.nh
-\fBarchive_read_new\fP
-.hy
-();
+\fB\%archive_read_new\fP()
Allocates and initializes a
Tn struct archive
object suitable for reading from an archive.
.TP
-Xo
-.nh
-\fBarchive_read_support_compression_all\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_compression_bzip2\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_compression_compress\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_compression_gzip\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_compression_none\fP
-.hy
-();
-Xc
+\fB\%archive_read_support_compression_bzip2\fP(),
+\fB\%archive_read_support_compression_compress\fP(),
+\fB\%archive_read_support_compression_gzip\fP(),
+\fB\%archive_read_support_compression_lzma\fP(),
+\fB\%archive_read_support_compression_none\fP(),
+\fB\%archive_read_support_compression_xz\fP()
Enables auto-detection code and decompression support for the
specified compression.
+Returns
+\fBARCHIVE_OK\fP
+if the compression is fully supported, or
+\fBARCHIVE_WARN\fP
+if the compression is supported only through an external program.
+Note that decompression using an external program is usually slower than
+decompression through built-in libraries.
Note that
``none''
is always enabled by default.
-For convenience,
-.nh
-\fBarchive_read_support_compression_all\fP
-.hy
-();
-enables all available decompression code.
-.TP
-.nh
-\fBarchive_read_support_compression_program\fP
-.hy
-();
+.TP
+\fB\%archive_read_support_compression_all\fP()
+Enables all available decompression filters.
+.TP
+\fB\%archive_read_support_compression_program\fP()
Data is fed through the specified external program before being dearchived.
Note that this disables automatic detection of the compression format,
so it makes no sense to specify this in conjunction with any other
decompression option.
.TP
-Xo
-.nh
-\fBarchive_read_support_format_all\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_format_cpio\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_format_empty\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_format_iso9660\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_format_tar\fP
-.hy
-(,);
-.nh
-\fBarchive_read_support_format_zip\fP
-.hy
-();
-Xc
+\fB\%archive_read_support_compression_program_signature\fP()
+This feeds data through the specified external program
+but only if the initial bytes of the data match the specified
+signature value.
+.TP
+\fB\%archive_read_support_format_all\fP(),
+\fB\%archive_read_support_format_ar\fP(),
+\fB\%archive_read_support_format_cpio\fP(),
+\fB\%archive_read_support_format_empty\fP(),
+\fB\%archive_read_support_format_iso9660\fP(),
+\fB\%archive_read_support_format_mtree\fP(),
+\fB\%archive_read_support_format_tar\fP(),
+\fB\%archive_read_support_format_zip\fP()
Enables support---including auto-detection code---for the
specified archive format.
For example,
-.nh
-\fBarchive_read_support_format_tar\fP
-.hy
-();
+\fB\%archive_read_support_format_tar\fP()
enables support for a variety of standard tar formats, old-style tar,
ustar, pax interchange format, and many common variants.
For convenience,
-.nh
-\fBarchive_read_support_format_all\fP
-.hy
-();
+\fB\%archive_read_support_format_all\fP()
enables support for all available formats.
Only empty archives are supported by default.
.TP
-.nh
-\fBarchive_read_open\fP
-.hy
-();
+\fB\%archive_read_support_format_raw\fP()
+The
+``raw''
+format handler allows libarchive to be used to read arbitrary data.
+It treats any data stream as an archive with a single entry.
+The pathname of this entry is
+``data ;''
+all other entry fields are unset.
+This is not enabled by
+\fB\%archive_read_support_format_all\fP()
+in order to avoid erroneous handling of damaged archives.
+.TP
+\fB\%archive_read_set_filter_options\fP(),
+\fB\%archive_read_set_format_options\fP(),
+\fB\%archive_read_set_options\fP()
+Specifies options that will be passed to currently-registered
+filters (including decompression filters) and/or format readers.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.RS 5
+.TP
+\fIoption=value\fP
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.TP
+\fIoption\fP
+The option will be provided to every module with a value of
+``1''.
+.TP
+\fI!option\fP
+The option will be provided to every module with a NULL value.
+.TP
+\fImodule:option=value\fP, \fImodule:option\fP, \fImodule:!option\fP
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+\fImodule\fP.
+.RE
+The return value will be
+\fBARCHIVE_OK\fP
+if any module accepts the option, or
+\fBARCHIVE_WARN\fP
+if no module accepted the option, or
+\fBARCHIVE_FATAL\fP
+if there was a fatal error while attempting to process the option.
+.PP
+The currently supported options are:
+.RS 5
+.TP
+Format iso9660
+.RS 5
+.TP
+\fBjoliet\fP
+Support Joliet extensions.
+Defaults to enabled, use
+\fB!joliet\fP
+to disable.
+.RE
+.RE
+.TP
+\fB\%archive_read_open\fP()
The same as
-.nh
-\fBarchive_read_open2\fP
-.hy
-(,);
+\fB\%archive_read_open2\fP(),
except that the skip callback is assumed to be
.BR NULL.
.TP
-.nh
-\fBarchive_read_open2\fP
-.hy
-();
+\fB\%archive_read_open2\fP()
Freeze the settings, open the archive, and prepare for reading entries.
This is the most generic version of this call, which accepts
four callback functions.
Most clients will want to use
-.nh
-\fBarchive_read_open_filename\fP
-.hy
-(,);
-.nh
-\fBarchive_read_open_FILE\fP
-.hy
-(,);
-.nh
-\fBarchive_read_open_fd\fP
-.hy
-(,);
+\fB\%archive_read_open_filename\fP(),
+\fB\%archive_read_open_FILE\fP(),
+\fB\%archive_read_open_fd\fP(),
or
-.nh
-\fBarchive_read_open_memory\fP
-.hy
-();
+\fB\%archive_read_open_memory\fP()
instead.
The library invokes the client-provided functions to obtain
raw bytes from the archive.
.TP
-.nh
-\fBarchive_read_open_FILE\fP
-.hy
-();
+\fB\%archive_read_open_FILE\fP()
Like
-.nh
-\fBarchive_read_open\fP
-.hy
-(,);
+\fB\%archive_read_open\fP(),
except that it accepts a
-\fI"FILE *"\fP
-.RE
+\fIFILE *\fP
pointer.
This function should not be used with tape drives or other devices
that require strict I/O blocking.
.TP
-.nh
-\fBarchive_read_open_fd\fP
-.hy
-();
+\fB\%archive_read_open_fd\fP()
Like
-.nh
-\fBarchive_read_open\fP
-.hy
-(,);
+\fB\%archive_read_open\fP(),
except that it accepts a file descriptor and block size rather than
a set of function pointers.
Note that the file descriptor will not be automatically closed at
end-of-archive.
This function is safe for use with tape drives or other blocked devices.
.TP
-.nh
-\fBarchive_read_open_file\fP
-.hy
-();
+\fB\%archive_read_open_file\fP()
This is a deprecated synonym for
-.nh
-\fBarchive_read_open_filename\fP
-.hy
-(.);
-.TP
-.nh
-\fBarchive_read_open_filename\fP
-.hy
-();
+\fB\%archive_read_open_filename\fP().
+.TP
+\fB\%archive_read_open_filename\fP()
Like
-.nh
-\fBarchive_read_open\fP
-.hy
-(,);
+\fB\%archive_read_open\fP(),
except that it accepts a simple filename and a block size.
A NULL filename represents standard input.
This function is safe for use with tape drives or other blocked devices.
.TP
-.nh
-\fBarchive_read_open_memory\fP
-.hy
-();
+\fB\%archive_read_open_memory\fP()
Like
-.nh
-\fBarchive_read_open\fP
-.hy
-(,);
+\fB\%archive_read_open\fP(),
except that it accepts a pointer and size of a block of
memory containing the archive data.
.TP
-.nh
-\fBarchive_read_next_header\fP
-.hy
-();
+\fB\%archive_read_next_header\fP()
Read the header for the next entry and return a pointer to
a
Tn struct archive_entry.
+This is a convenience wrapper around
+\fB\%archive_read_next_header2\fP()
+that reuses an internal
+Tn struct archive_entry
+object for each request.
.TP
-.nh
-\fBarchive_read_data\fP
-.hy
-();
+\fB\%archive_read_next_header2\fP()
+Read the header for the next entry and populate the provided
+Tn struct archive_entry.
+.TP
+\fB\%archive_read_data\fP()
Read data associated with the header just read.
Internally, this is a convenience function that calls
-.nh
-\fBarchive_read_data_block\fP
-.hy
-();
+\fB\%archive_read_data_block\fP()
and fills any gaps with nulls so that callers see a single
continuous stream of data.
.TP
-.nh
-\fBarchive_read_data_block\fP
-.hy
-();
+\fB\%archive_read_data_block\fP()
Return the next available block of data for this entry.
Unlike
-.nh
-\fBarchive_read_data\fP
-.hy
-(,);
+\fB\%archive_read_data\fP(),
the
-.nh
-\fBarchive_read_data_block\fP
-.hy
-();
+\fB\%archive_read_data_block\fP()
function avoids copying data and allows you to correctly handle
sparse files, as supported by some archive formats.
The library guarantees that offsets will increase and that blocks
@@ -482,55 +423,28 @@ Note that the blocks returned from this function can be much larger
than the block size read from disk, due to compression
and internal buffer optimizations.
.TP
-.nh
-\fBarchive_read_data_skip\fP
-.hy
-();
+\fB\%archive_read_data_skip\fP()
A convenience function that repeatedly calls
-.nh
-\fBarchive_read_data_block\fP
-.hy
-();
+\fB\%archive_read_data_block\fP()
to skip all of the data for this archive entry.
.TP
-.nh
-\fBarchive_read_data_into_buffer\fP
-.hy
-();
+\fB\%archive_read_data_into_buffer\fP()
This function is deprecated and will be removed.
Use
-.nh
-\fBarchive_read_data\fP
-.hy
-();
+\fB\%archive_read_data\fP()
instead.
.TP
-.nh
-\fBarchive_read_data_into_fd\fP
-.hy
-();
+\fB\%archive_read_data_into_fd\fP()
A convenience function that repeatedly calls
-.nh
-\fBarchive_read_data_block\fP
-.hy
-();
+\fB\%archive_read_data_block\fP()
to copy the entire entry to the provided file descriptor.
.TP
-.nh
-\fBarchive_read_extract\fP
-.hy
-(, .nh);
-\fBarchive_read_extract_set_skip_file\fP
-.hy
-();
+\fB\%archive_read_extract\fP(), \fB\%archive_read_extract_set_skip_file\fP()
A convenience function that wraps the corresponding
\fBarchive_write_disk\fP(3)
interfaces.
The first call to
-.nh
-\fBarchive_read_extract\fP
-.hy
-();
+\fB\%archive_read_extract\fP()
creates a restore object using
\fBarchive_write_disk_new\fP(3)
and
@@ -547,15 +461,9 @@ The
argument is passed unmodified to
\fBarchive_write_disk_set_options\fP(3).
.TP
-.nh
-\fBarchive_read_extract2\fP
-.hy
-();
+\fB\%archive_read_extract2\fP()
This is another version of
-.nh
-\fBarchive_read_extract\fP
-.hy
-();
+\fB\%archive_read_extract\fP()
that allows you to provide your own restore object.
In particular, this allows you to override the standard lookup functions
using
@@ -563,23 +471,14 @@ using
and
\fBarchive_write_disk_set_user_lookup\fP(3).
Note that
-.nh
-\fBarchive_read_extract2\fP
-.hy
-();
+\fB\%archive_read_extract2\fP()
does not accept a
\fIflags\fP
argument; you should use
-.nh
-\fBarchive_write_disk_set_options\fP
-.hy
-();
+\fB\%archive_write_disk_set_options\fP()
to set the restore options yourself.
.TP
-.nh
-\fBarchive_read_extract_set_progress_callback\fP
-.hy
-();
+\fB\%archive_read_extract_set_progress_callback\fP()
Sets a pointer to a user-defined callback that can be used
for updating progress displays during extraction.
The progress function will be invoked during the extraction of large
@@ -589,32 +488,21 @@ Generally, the data pointed to should include a reference to the archive
object and the archive_entry object so that various statistics
can be retrieved for the progress display.
.TP
-.nh
-\fBarchive_read_close\fP
-.hy
-();
+\fB\%archive_read_close\fP()
Complete the archive and invoke the close callback.
.TP
-.nh
-\fBarchive_read_finish\fP
-.hy
-();
+\fB\%archive_read_finish\fP()
Invokes
-.nh
-\fBarchive_read_close\fP
-.hy
-();
+\fB\%archive_read_close\fP()
if it was not invoked manually, then release all resources.
Note: In libarchive 1.x, this function was declared to return
-\fIvoid,\fP
-.RE
+\fIvoid ,\fP
which made it impossible to detect certain errors when
-.nh
-\fBarchive_read_close\fP
-.hy
-();
+\fB\%archive_read_close\fP()
was invoked implicitly from this function.
The declaration is corrected beginning with libarchive 2.0.
+.RE
+.PP
Note that the library determines most of the relevant information about
the archive by inspection.
In particular, it automatically detects
@@ -623,6 +511,7 @@ or
\fBbzip2\fP(1)
compression and transparently performs the appropriate decompression.
It also automatically detects the archive format.
+.PP
A complete description of the
Tn struct archive
and
@@ -630,58 +519,39 @@ Tn struct archive_entry
objects can be found in the overview manual page for
\fBlibarchive\fP(3).
.SH CLIENT CALLBACKS
+.ad l
The callback functions must match the following prototypes:
+.RS 5
.IP
\fItypedef ssize_t\fP
-.RE
-Fo archive_read_callback
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "const void **buffer"
-Fc
+\fB\%archive_read_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%const\ void\ **buffer\fP)
.IP
\fItypedef int\fP
-.RE
-Fo archive_skip_callback
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "size_t request"
-Fc
+\fB\%archive_skip_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%size_t\ request\fP)
.IP
\fItypedef int\fP
-.RE
-.nh
-\fBarchive_open_callback\fP
-.hy
-("struct archive *" "void *client_data");
+\fB\%archive_open_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP)
.IP
\fItypedef int\fP
+\fB\%archive_close_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP)
.RE
-.nh
-\fBarchive_close_callback\fP
-.hy
-("struct archive *" "void *client_data");
+.PP
The open callback is invoked by
-.nh
-\fBarchive_open\fP
-.hy
-(.);
+\fB\%archive_open\fP().
It should return
\fBARCHIVE_OK\fP
if the underlying file or data source is successfully
opened.
If the open fails, it should call
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and return
\fBARCHIVE_FATAL\fP.
+.PP
The read callback is invoked whenever the library
requires raw bytes from the archive.
The read callback should read data into a buffer,
set the
-.RS
+.RS 4
const void **buffer
.RE
argument to point to the available data, and
@@ -693,12 +563,10 @@ of the data blocks returned.
On end-of-file, the read callback should
return zero.
On error, the read callback should invoke
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and
return -1.
+.PP
The skip callback is invoked when the
library wants to ignore a block of data.
The return value is the number of bytes actually
@@ -714,20 +582,19 @@ A skip callback can provide significant
performance gains when reading uncompressed
archives from slow disk drives or other media
that can skip quickly.
+.PP
The close callback is invoked by archive_close when
the archive processing is complete.
The callback should return
\fBARCHIVE_OK\fP
on success.
On failure, the callback should invoke
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and
return
\fBARCHIVE_FATAL.\fP
.SH EXAMPLE
+.ad l
The following illustrates basic usage of the library.
In this example,
the callback functions are simply wrappers around the standard
@@ -736,7 +603,8 @@ the callback functions are simply wrappers around the standard
and
\fBclose\fP(2)
system calls.
-.RS
+.RS 4
+.nf
void
list_archive(const char *name)
{
@@ -780,6 +648,7 @@ myclose(struct archive *a, void *client_data)
}
.RE
.SH RETURN VALUES
+.ad l
Most functions return zero on success, non-zero on error.
The possible return codes include:
\fBARCHIVE_OK\fP
@@ -794,30 +663,20 @@ and
\fBARCHIVE_FATAL\fP
(there was a fatal error; the archive should be closed immediately).
Detailed error codes and textual descriptions are available from the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions.
-.nh
-\fBarchive_read_new\fP
-.hy
-();
+.PP
+\fB\%archive_read_new\fP()
returns a pointer to a freshly allocated
Tn struct archive
object.
It returns
.BR NULL
on error.
-.nh
-\fBarchive_read_data\fP
-.hy
-();
+.PP
+\fB\%archive_read_data\fP()
returns a count of bytes actually read or zero at the end of the entry.
On error, a value of
\fBARCHIVE_FATAL\fP,
@@ -825,22 +684,14 @@ On error, a value of
or
\fBARCHIVE_RETRY\fP
is returned and an error code and textual description can be retrieved from the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions.
+.PP
The library expects the client callbacks to behave similarly.
If there is an error, you can use
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to set an appropriate error code and description,
then return one of the non-zero values above.
(Note that the value eventually returned to the client may
@@ -850,22 +701,26 @@ thus most I/O errors eventually cause
\fBARCHIVE_FATAL\fP
to be returned.)
.SH SEE ALSO
+.ad l
\fBtar\fP(1),
\fBarchive\fP(3),
\fBarchive_util\fP(3),
\fBtar\fP(5)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
.SH BUGS
+.ad l
Many traditional archiver programs treat
empty files as valid empty archives.
For example, many implementations of
diff --git a/archivers/libarchive/files/doc/man/archive_read_disk.3 b/archivers/libarchive/files/doc/man/archive_read_disk.3
new file mode 100644
index 00000000000..6e10f4f4c68
--- /dev/null
+++ b/archivers/libarchive/files/doc/man/archive_read_disk.3
@@ -0,0 +1,300 @@
+.TH archive_read_disk 3 "March 10, 2009" ""
+.SH NAME
+.ad l
+\fB\%archive_read_disk_new\fP,
+\fB\%archive_read_disk_set_symlink_logical\fP,
+\fB\%archive_read_disk_set_symlink_physical\fP,
+\fB\%archive_read_disk_set_symlink_hybrid\fP,
+\fB\%archive_read_disk_entry_from_file\fP,
+\fB\%archive_read_disk_gname\fP,
+\fB\%archive_read_disk_uname\fP,
+\fB\%archive_read_disk_set_uname_lookup\fP,
+\fB\%archive_read_disk_set_gname_lookup\fP,
+\fB\%archive_read_disk_set_standard_lookup\fP,
+\fB\%archive_read_close\fP,
+\fB\%archive_read_finish\fP
+\- functions for reading objects from disk
+.SH SYNOPSIS
+.ad l
+\fB#include <archive.h>\fP
+.br
+\fIstruct archive *\fP
+.br
+\fB\%archive_read_disk_new\fP(\fI\%void\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_symlink_logical\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_symlink_physical\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_symlink_hybrid\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_gname\fP(\fI\%struct\ archive\ *\fP, \fI\%gid_t\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_uname\fP(\fI\%struct\ archive\ *\fP, \fI\%uid_t\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_gname_lookup\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%const\ char\ *(*lookup)(void\ *,\ gid_t)\fP, \fI\%void\ (*cleanup)(void\ *)\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_uname_lookup\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%const\ char\ *(*lookup)(void\ *,\ uid_t)\fP, \fI\%void\ (*cleanup)(void\ *)\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_set_standard_lookup\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_disk_entry_from_file\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP, \fI\%int\ fd\fP, \fI\%const\ struct\ stat\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_close\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_read_finish\fP(\fI\%struct\ archive\ *\fP);
+.SH DESCRIPTION
+.ad l
+These functions provide an API for reading information about
+objects on disk.
+In particular, they provide an interface for populating
+Tn struct archive_entry
+objects.
+.RS 5
+.TP
+\fB\%archive_read_disk_new\fP()
+Allocates and initializes a
+Tn struct archive
+object suitable for reading object information from disk.
+.TP
+\fB\%archive_read_disk_set_symlink_logical\fP(),
+\fB\%archive_read_disk_set_symlink_physical\fP(),
+\fB\%archive_read_disk_set_symlink_hybrid\fP()
+This sets the mode used for handling symbolic links.
+The
+``logical''
+mode follows all symbolic links.
+The
+``physical''
+mode does not follow any symbolic links.
+The
+``hybrid''
+mode currently behaves identically to the
+``logical''
+mode.
+.TP
+\fB\%archive_read_disk_gname\fP(),
+\fB\%archive_read_disk_uname\fP()
+Returns a user or group name given a gid or uid value.
+By default, these always return a NULL string.
+.TP
+\fB\%archive_read_disk_set_gname_lookup\fP(),
+\fB\%archive_read_disk_set_uname_lookup\fP()
+These allow you to override the functions used for
+user and group name lookups.
+You may also provide a
+Tn void *
+pointer to a private data structure and a cleanup function for
+that data.
+The cleanup function will be invoked when the
+Tn struct archive
+object is destroyed or when new lookup functions are registered.
+.TP
+\fB\%archive_read_disk_set_standard_lookup\fP()
+This convenience function installs a standard set of user
+and group name lookup functions.
+These functions use
+\fBgetpwid\fP(3)
+and
+\fBgetgrid\fP(3)
+to convert ids to names, defaulting to NULL if the names cannot
+be looked up.
+These functions also implement a simple memory cache to reduce
+the number of calls to
+\fBgetpwid\fP(3)
+and
+\fBgetgrid\fP(3).
+.TP
+\fB\%archive_read_disk_entry_from_file\fP()
+Populates a
+Tn struct archive_entry
+object with information about a particular file.
+The
+Tn archive_entry
+object must have already been created with
+\fBarchive_entry_new\fP(3)
+and at least one of the source path or path fields must already be set.
+(If both are set, the source path will be used.)
+.PP
+Information is read from disk using the path name from the
+Tn struct archive_entry
+object.
+If a file descriptor is provided, some information will be obtained using
+that file descriptor, on platforms that support the appropriate
+system calls.
+.PP
+If a pointer to a
+Tn struct stat
+is provided, information from that structure will be used instead
+of reading from the disk where appropriate.
+This can provide performance benefits in scenarios where
+Tn struct stat
+information has already been read from the disk as a side effect
+of some other operation.
+(For example, directory traversal libraries often provide this information.)
+.PP
+Where necessary, user and group ids are converted to user and group names
+using the currently registered lookup functions above.
+This affects the file ownership fields and ACL values in the
+Tn struct archive_entry
+object.
+.TP
+\fB\%archive_read_close\fP()
+This currently does nothing.
+.TP
+\fB\%archive_write_finish\fP()
+Invokes
+\fB\%archive_write_close\fP()
+if it was not invoked manually, then releases all resources.
+.RE
+More information about the
+\fIstruct\fP archive
+object and the overall design of the library can be found in the
+\fBlibarchive\fP(3)
+overview.
+.SH EXAMPLE
+.ad l
+The following illustrates basic usage of the library by
+showing how to use it to copy an item on disk into an archive.
+.RS 4
+.nf
+void
+file_to_archive(struct archive *a, const char *name)
+{
+ char buff[8192];
+ size_t bytes_read;
+ struct archive *ard;
+ struct archive_entry *entry;
+ int fd;
+ ard = archive_read_disk_new();
+ archive_read_disk_set_standard_lookup(ard);
+ entry = archive_entry_new();
+ fd = open(name, O_RDONLY);
+ if (fd < 0)
+ return;
+ archive_entry_copy_sourcepath(entry, name);
+ archive_read_disk_entry_from_file(ard, entry, fd, NULL);
+ archive_write_header(a, entry);
+ while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
+ archive_write_data(a, buff, bytes_read);
+ archive_write_finish_entry(a);
+ archive_read_finish(ard);
+ archive_entry_free(entry);
+}
+.RE
+.SH RETURN VALUES
+.ad l
+Most functions return
+\fBARCHIVE_OK\fP
+(zero) on success, or one of several negative
+error codes for errors.
+Specific error codes include:
+\fBARCHIVE_RETRY\fP
+for operations that might succeed if retried,
+\fBARCHIVE_WARN\fP
+for unusual conditions that do not prevent further operations, and
+\fBARCHIVE_FATAL\fP
+for serious errors that make remaining operations impossible.
+The
+\fBarchive_errno\fP(3)
+and
+\fBarchive_error_string\fP(3)
+functions can be used to retrieve an appropriate error code and a
+textual error message.
+(See
+\fBarchive_util\fP(3)
+for details.)
+.PP
+\fB\%archive_read_disk_new\fP()
+returns a pointer to a newly-allocated
+Tn struct archive
+object or NULL if the allocation failed for any reason.
+.PP
+\fB\%archive_read_disk_gname\fP()
+and
+\fB\%archive_read_disk_uname\fP()
+return
+Tn const char *
+pointers to the textual name or NULL if the lookup failed for any reason.
+The returned pointer points to internal storage that
+may be reused on the next call to either of these functions;
+callers should copy the string if they need to continue accessing it.
+.PP
+.SH SEE ALSO
+.ad l
+\fBarchive_read\fP(3),
+\fBarchive_write\fP(3),
+\fBarchive_write_disk\fP(3),
+\fBtar\fP(1),
+\fBlibarchive\fP(3)
+.SH HISTORY
+.ad l
+The
+\fB\%libarchive\fP
+library first appeared in
+FreeBSD 5.3.
+The
+\fB\%archive_read_disk\fP
+interface was added to
+\fB\%libarchive\fP 2.6
+and first appeared in
+FreeBSD 8.0.
+.SH AUTHORS
+.ad l
+-nosplit
+The
+\fB\%libarchive\fP
+library was written by
+Tim Kientzle \%<kientzle@freebsd.org.>
+.SH BUGS
+.ad l
+The
+``standard''
+user name and group name lookup functions are not the defaults because
+\fBgetgrid\fP(3)
+and
+\fBgetpwid\fP(3)
+are sometimes too large for particular applications.
+The current design allows the application author to use a more
+compact implementation when appropriate.
+.PP
+The full list of metadata read from disk by
+\fB\%archive_read_disk_entry_from_file\fP()
+is necessarily system-dependent.
+.PP
+The
+\fB\%archive_read_disk_entry_from_file\fP()
+function reads as much information as it can from disk.
+Some method should be provided to limit this so that clients who
+do not need ACLs, for instance, can avoid the extra work needed
+to look up such information.
+.PP
+This API should provide a set of methods for walking a directory tree.
+That would make it a direct parallel of the
+\fBarchive_read\fP(3)
+API.
+When such methods are implemented, the
+``hybrid''
+symbolic link mode will make sense.
diff --git a/archivers/libarchive/files/doc/man/archive_util.3 b/archivers/libarchive/files/doc/man/archive_util.3
index 6a9b7f562b2..60375aff195 100644
--- a/archivers/libarchive/files/doc/man/archive_util.3
+++ b/archivers/libarchive/files/doc/man/archive_util.3
@@ -1,171 +1,124 @@
.TH archive_util 3 "January 8, 2005" ""
.SH NAME
-\fBarchive_clear_error\fP,
-\fBarchive_compression\fP,
-\fBarchive_compression_name\fP,
-\fBarchive_copy_error\fP,
-\fBarchive_errno\fP,
-\fBarchive_error_string\fP,
-\fBarchive_format\fP,
-\fBarchive_format_name\fP,
-\fBarchive_set_error\fP
+.ad l
+\fB\%archive_clear_error\fP,
+\fB\%archive_compression\fP,
+\fB\%archive_compression_name\fP,
+\fB\%archive_copy_error\fP,
+\fB\%archive_errno\fP,
+\fB\%archive_error_string\fP,
+\fB\%archive_file_count\fP,
+\fB\%archive_format\fP,
+\fB\%archive_format_name\fP,
+\fB\%archive_set_error\fP
\- libarchive utility functions
.SH SYNOPSIS
+.ad l
\fB#include <archive.h>\fP
.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_clear_error\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_clear_error\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_compression\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_compression\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_compression_name\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_compression_name\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIvoid\fP
-.RE
-.nh
-\fBarchive_copy_error\fP
-.hy
-("struct archive *" "struct archive *");
+.br
+\fB\%archive_copy_error\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_errno\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_errno\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_error_string\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_error_string\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_format\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_file_count\fP(\fI\%struct\ archive\ *\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_format\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIconst char *\fP
-.RE
-.nh
-\fBarchive_format_name\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_format_name\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIvoid\fP
-.RE
-Fo archive_set_error
-Fa "struct archive *"
-Fa "int error_code"
-Fa "const char *fmt"
-Fa "..."
-Fc
+.br
+\fB\%archive_set_error\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ error_code\fP, \fI\%const\ char\ *fmt\fP, \fI\%...\fP);
.SH DESCRIPTION
+.ad l
These functions provide access to various information about the
Tn struct archive
object used in the
\fBlibarchive\fP(3)
library.
+.RS 5
.TP
-.nh
-\fBarchive_clear_error\fP
-.hy
-();
+\fB\%archive_clear_error\fP()
Clears any error information left over from a previous call.
Not generally used in client code.
.TP
-.nh
-\fBarchive_compression\fP
-.hy
-();
+\fB\%archive_compression\fP()
Returns a numeric code indicating the current compression.
This value is set by
-.nh
-\fBarchive_read_open\fP
-.hy
-(.);
+\fB\%archive_read_open\fP().
.TP
-.nh
-\fBarchive_compression_name\fP
-.hy
-();
+\fB\%archive_compression_name\fP()
Returns a text description of the current compression suitable for display.
.TP
-.nh
-\fBarchive_copy_error\fP
-.hy
-();
+\fB\%archive_copy_error\fP()
Copies error information from one archive to another.
.TP
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
Returns a numeric error code (see
\fBerrno\fP(2))
indicating the reason for the most recent error return.
.TP
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
Returns a textual error message suitable for display.
The error message here is usually more specific than that
obtained from passing the result of
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
to
\fBstrerror\fP(3).
.TP
-.nh
-\fBarchive_format\fP
-.hy
-();
+\fB\%archive_file_count\fP()
+Returns a count of the number of files processed by this archive object.
+The count is incremented by calls to
+\fBarchive_write_header\fP()
+or
+\fBarchive_read_next_header\fP(.)
+.TP
+\fB\%archive_format\fP()
Returns a numeric code indicating the format of the current
archive entry.
This value is set by a successful call to
-.nh
-\fBarchive_read_next_header\fP
-.hy
-(.);
+\fB\%archive_read_next_header\fP().
Note that it is common for this value to change from
entry to entry.
For example, a tar archive might have several entries that
utilize GNU tar extensions and several entries that do not.
These entries will have different format codes.
.TP
-.nh
-\fBarchive_format_name\fP
-.hy
-();
+\fB\%archive_format_name\fP()
A textual description of the format of the current entry.
.TP
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
Sets the numeric error code and error description that will be returned
by
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-(.);
+\fB\%archive_error_string\fP().
This function should be used within I/O callbacks to set system-specific
error codes and error descriptions.
This function accepts a printf-like format string and arguments.
@@ -188,19 +141,23 @@ format specifiers:
``%%''.
Field-width specifiers and other printf features are
not uniformly supported and should not be used.
+.RE
.SH SEE ALSO
+.ad l
\fBarchive_read\fP(3),
\fBarchive_write\fP(3),
\fBlibarchive\fP(3),
\fBprintf\fP(3)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/man/archive_write.3 b/archivers/libarchive/files/doc/man/archive_write.3
index 3c02d5222d4..b485dcf796a 100644
--- a/archivers/libarchive/files/doc/man/archive_write.3
+++ b/archivers/libarchive/files/doc/man/archive_write.3
@@ -1,190 +1,152 @@
.TH archive_write 3 "May 11, 2008" ""
.SH NAME
-\fBarchive_write_new\fP,
-\fBarchive_write_set_format_cpio\fP,
-\fBarchive_write_set_format_pax\fP,
-\fBarchive_write_set_format_pax_restricted\fP,
-\fBarchive_write_set_format_shar\fP,
-\fBarchive_write_set_format_shar_binary\fP,
-\fBarchive_write_set_format_ustar\fP,
-\fBarchive_write_get_bytes_per_block\fP,
-\fBarchive_write_set_bytes_per_block\fP,
-\fBarchive_write_set_bytes_in_last_block\fP,
-\fBarchive_write_set_compression_bzip2\fP,
-\fBarchive_write_set_compression_compress\fP,
-\fBarchive_write_set_compression_gzip\fP,
-\fBarchive_write_set_compression_none\fP,
-\fBarchive_write_set_compression_program\fP,
-\fBarchive_write_open\fP,
-\fBarchive_write_open_fd\fP,
-\fBarchive_write_open_FILE\fP,
-\fBarchive_write_open_filename\fP,
-\fBarchive_write_open_memory\fP,
-\fBarchive_write_header\fP,
-\fBarchive_write_data\fP,
-\fBarchive_write_finish_entry\fP,
-\fBarchive_write_close\fP,
-\fBarchive_write_finish\fP
+.ad l
+\fB\%archive_write_new\fP,
+\fB\%archive_write_set_format_cpio\fP,
+\fB\%archive_write_set_format_pax\fP,
+\fB\%archive_write_set_format_pax_restricted\fP,
+\fB\%archive_write_set_format_shar\fP,
+\fB\%archive_write_set_format_shar_binary\fP,
+\fB\%archive_write_set_format_ustar\fP,
+\fB\%archive_write_get_bytes_per_block\fP,
+\fB\%archive_write_set_bytes_per_block\fP,
+\fB\%archive_write_set_bytes_in_last_block\fP,
+\fB\%archive_write_set_compression_bzip2\fP,
+\fB\%archive_write_set_compression_compress\fP,
+\fB\%archive_write_set_compression_gzip\fP,
+\fB\%archive_write_set_compression_none\fP,
+\fB\%archive_write_set_compression_program\fP,
+\fB\%archive_write_set_compressor_options\fP,
+\fB\%archive_write_set_format_options\fP,
+\fB\%archive_write_set_options\fP,
+\fB\%archive_write_open\fP,
+\fB\%archive_write_open_fd\fP,
+\fB\%archive_write_open_FILE\fP,
+\fB\%archive_write_open_filename\fP,
+\fB\%archive_write_open_memory\fP,
+\fB\%archive_write_header\fP,
+\fB\%archive_write_data\fP,
+\fB\%archive_write_finish_entry\fP,
+\fB\%archive_write_close\fP,
+\fB\%archive_write_finish\fP
\- functions for creating archives
.SH SYNOPSIS
+.ad l
\fB#include <archive.h>\fP
.br
\fIstruct archive *\fP
-.RE
-.nh
-\fBarchive_write_new\fP
-.hy
-("void");
+.br
+\fB\%archive_write_new\fP(\fI\%void\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_get_bytes_per_block\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_get_bytes_per_block\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_bytes_per_block\fP
-.hy
-("struct archive *" "int bytes_per_block");
+.br
+\fB\%archive_write_set_bytes_per_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ bytes_per_block\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_bytes_in_last_block\fP
-.hy
-("struct archive *" "int");
+.br
+\fB\%archive_write_set_bytes_in_last_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_compression_bzip2\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_compression_bzip2\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_compression_compress\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_compression_compress\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_compression_gzip\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_compression_gzip\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_compression_none\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_compression_none\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_write_set_compression_program
-Fa "struct archive *"
-Fa "const char * cmd"
-Fc
+.br
+\fB\%archive_write_set_compression_program\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\ cmd\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_cpio\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_cpio\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_pax\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_pax\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_pax_restricted\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_pax_restricted\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_shar\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_shar\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_shar_binary\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_shar_binary\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_set_format_ustar\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_set_format_ustar\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_write_open
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "archive_open_callback *"
-Fa "archive_write_callback *"
-Fa "archive_close_callback *"
-Fc
+.br
+\fB\%archive_write_set_format_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_open_fd\fP
-.hy
-("struct archive *" "int fd");
+.br
+\fB\%archive_write_set_compressor_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_open_FILE\fP
-.hy
-("struct archive *" "FILE *file");
+.br
+\fB\%archive_write_set_options\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-("struct archive *" "const char *filename");
+.br
+\fB\%archive_write_open\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%archive_open_callback\ *\fP, \fI\%archive_write_callback\ *\fP, \fI\%archive_close_callback\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_write_open_memory
-Fa "struct archive *"
-Fa "void *buffer"
-Fa "size_t bufferSize"
-Fa "size_t *outUsed"
-Fc
+.br
+\fB\%archive_write_open_fd\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ fd\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_header\fP
-.hy
-("struct archive *" "struct archive_entry *");
+.br
+\fB\%archive_write_open_FILE\fP(\fI\%struct\ archive\ *\fP, \fI\%FILE\ *file\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_write_open_filename\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ char\ *filename\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_write_open_memory\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *buffer\fP, \fI\%size_t\ bufferSize\fP, \fI\%size_t\ *outUsed\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_write_header\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP);
+.br
\fIssize_t\fP
-.RE
-.nh
-\fBarchive_write_data\fP
-.hy
-("struct archive *" "const void *" "size_t");
+.br
+\fB\%archive_write_data\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_finish_entry\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_finish_entry\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_close\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_close\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_finish\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_finish\fP(\fI\%struct\ archive\ *\fP);
.SH DESCRIPTION
+.ad l
These functions provide a complete API for creating streaming
archive files.
The general process is to first create the
@@ -193,19 +155,14 @@ object, set any desired options, initialize the archive, append entries, then
close the archive and release all resources.
The following summary describes the functions in approximately
the order they are ordinarily used:
+.RS 5
.TP
-.nh
-\fBarchive_write_new\fP
-.hy
-();
+\fB\%archive_write_new\fP()
Allocates and initializes a
Tn struct archive
object suitable for writing a tar archive.
.TP
-.nh
-\fBarchive_write_set_bytes_per_block\fP
-.hy
-();
+\fB\%archive_write_set_bytes_per_block\fP()
Sets the block size used for writing the archive data.
Every call to the write callback function, except possibly the last one, will
use this value for the length.
@@ -217,18 +174,12 @@ The default is to use a block size of 10240 bytes and to pad the last block.
Note that a block size of zero will suppress internal blocking
and cause writes to be sent directly to the write callback as they occur.
.TP
-.nh
-\fBarchive_write_get_bytes_per_block\fP
-.hy
-();
+\fB\%archive_write_get_bytes_per_block\fP()
Retrieve the block size to be used for writing.
A value of -1 here indicates that the library should use default values.
A value of zero indicates that internal blocking is suppressed.
.TP
-.nh
-\fBarchive_write_set_bytes_in_last_block\fP
-.hy
-();
+\fB\%archive_write_set_bytes_in_last_block\fP()
Sets the block size used for writing the last block.
If this value is zero, the last block will be padded to the same size
as the other blocks.
@@ -238,48 +189,22 @@ For compressed output, any padding generated by this option
is applied only after the compression.
The uncompressed data is always unpadded.
The default is to pad the last block to the full block size (note that
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-();
+\fB\%archive_write_open_filename\fP()
will set this based on the file type).
Unlike the other
``set''
functions, this function can be called after the archive is opened.
.TP
-.nh
-\fBarchive_write_get_bytes_in_last_block\fP
-.hy
-();
+\fB\%archive_write_get_bytes_in_last_block\fP()
Retrieve the currently-set value for last block size.
A value of -1 here indicates that the library should use default values.
.TP
-Xo
-.nh
-\fBarchive_write_set_format_cpio\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_format_pax\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_format_pax_restricted\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_format_shar\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_format_shar_binary\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_format_ustar\fP
-.hy
-();
-Xc
+\fB\%archive_write_set_format_cpio\fP(),
+\fB\%archive_write_set_format_pax\fP(),
+\fB\%archive_write_set_format_pax_restricted\fP(),
+\fB\%archive_write_set_format_shar\fP(),
+\fB\%archive_write_set_format_shar_binary\fP(),
+\fB\%archive_write_set_format_ustar\fP()
Sets the format that will be used for the archive.
The library can write
POSIX octet-oriented cpio format archives,
@@ -304,152 +229,153 @@ is the library default; this is the same as pax format, but suppresses
the pax extended header for most normal files.
In most cases, this will result in ordinary ustar archives.
.TP
-Xo
-.nh
-\fBarchive_write_set_compression_bzip2\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_compression_compress\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_compression_gzip\fP
-.hy
-(,);
-.nh
-\fBarchive_write_set_compression_none\fP
-.hy
-();
-Xc
+\fB\%archive_write_set_compression_bzip2\fP(),
+\fB\%archive_write_set_compression_compress\fP(),
+\fB\%archive_write_set_compression_gzip\fP(),
+\fB\%archive_write_set_compression_none\fP()
The resulting archive will be compressed as specified.
Note that the compressed output is always properly blocked.
.TP
-.nh
-\fBarchive_write_set_compression_program\fP
-.hy
-();
+\fB\%archive_write_set_compression_program\fP()
The archive will be fed into the specified compression program.
The output of that program is blocked and written to the client
write callbacks.
.TP
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_set_compressor_options\fP(),
+\fB\%archive_write_set_format_options\fP(),
+\fB\%archive_write_set_options\fP()
+Specifies options that will be passed to the currently-enabled
+compressor and/or format writer.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.RS 5
+.TP
+\fIoption=value\fP
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.TP
+\fIoption\fP
+The option will be provided to every module with a value of
+``1''.
+.TP
+\fI!option\fP
+The option will be provided to every module with a NULL value.
+.TP
+\fImodule:option=value\fP, \fImodule:option\fP, \fImodule:!option\fP
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+\fImodule\fP.
+.RE
+The return value will be
+\fBARCHIVE_OK\fP
+if any module accepts the option, or
+\fBARCHIVE_WARN\fP
+if no module accepted the option, or
+\fBARCHIVE_FATAL\fP
+if there was a fatal error while attempting to process the option.
+.PP
+The currently supported options are:
+.RS 5
+.TP
+Compressor gzip
+.RS 5
+.TP
+\fBcompression-level\fP
+The value is interpreted as a decimal integer specifying the
+gzip compression level.
+.RE
+.TP
+Compressor xz
+.RS 5
+.TP
+\fBcompression-level\fP
+The value is interpreted as a decimal integer specifying the
+compression level.
+.RE
+.TP
+Format mtree
+.RS 5
+.TP
+\fBcksum\fP, \fBdevice\fP, \fBflags\fP, \fBgid\fP, \fBgname\fP, \fBindent\fP, \fBlink\fP, \fBmd5\fP, \fBmode\fP, \fBnlink\fP, \fBrmd160\fP, \fBsha1\fP, \fBsha256\fP, \fBsha384\fP, \fBsha512\fP, \fBsize\fP, \fBtime\fP, \fBuid\fP, \fBuname\fP
+Enable a particular keyword in the mtree output.
+Prefix with an exclamation mark to disable the corresponding keyword.
+The default is equivalent to
+``device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname''.
+.TP
+\fBall\fP
+Enables all of the above keywords.
+.TP
+\fBuse-set\fP
+Enables generation of
+\fB/set\fP
+lines that specify default values for the following files and/or directories.
+.TP
+\fBindent\fP
+XXX needs explanation XXX
+.RE
+.RE
+.TP
+\fB\%archive_write_open\fP()
Freeze the settings, open the archive, and prepare for writing entries.
This is the most generic form of this function, which accepts
pointers to three callback functions which will be invoked by
the compression layer to write the constructed archive.
.TP
-.nh
-\fBarchive_write_open_fd\fP
-.hy
-();
+\fB\%archive_write_open_fd\fP()
A convenience form of
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_open\fP()
that accepts a file descriptor.
The
-.nh
-\fBarchive_write_open_fd\fP
-.hy
-();
+\fB\%archive_write_open_fd\fP()
function is safe for use with tape drives or other
block-oriented devices.
.TP
-.nh
-\fBarchive_write_open_FILE\fP
-.hy
-();
+\fB\%archive_write_open_FILE\fP()
A convenience form of
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_open\fP()
that accepts a
-\fI"FILE *"\fP
-.RE
+\fIFILE *\fP
pointer.
Note that
-.nh
-\fBarchive_write_open_FILE\fP
-.hy
-();
+\fB\%archive_write_open_FILE\fP()
is not safe for writing to tape drives or other devices
that require correct blocking.
.TP
-.nh
-\fBarchive_write_open_file\fP
-.hy
-();
+\fB\%archive_write_open_file\fP()
A deprecated synonym for
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-(.);
-.TP
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-();
+\fB\%archive_write_open_filename\fP().
+.TP
+\fB\%archive_write_open_filename\fP()
A convenience form of
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_open\fP()
that accepts a filename.
A NULL argument indicates that the output should be written to standard output;
an argument of
``-''
will open a file with that name.
If you have not invoked
-.nh
-\fBarchive_write_set_bytes_in_last_block\fP
-.hy
-(,);
+\fB\%archive_write_set_bytes_in_last_block\fP(),
then
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-();
+\fB\%archive_write_open_filename\fP()
will adjust the last-block padding depending on the file:
it will enable padding when writing to standard output or
to a character or block device node, it will disable padding otherwise.
You can override this by manually invoking
-.nh
-\fBarchive_write_set_bytes_in_last_block\fP
-.hy
-();
+\fB\%archive_write_set_bytes_in_last_block\fP()
before calling
-.nh
-\fBarchive_write_open\fP
-.hy
-(.);
+\fB\%archive_write_open\fP().
The
-.nh
-\fBarchive_write_open_filename\fP
-.hy
-();
+\fB\%archive_write_open_filename\fP()
function is safe for use with tape drives or other
block-oriented devices.
.TP
-.nh
-\fBarchive_write_open_memory\fP
-.hy
-();
+\fB\%archive_write_open_memory\fP()
A convenience form of
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_open\fP()
that accepts a pointer to a block of memory that will receive
the archive.
The final
-\fI"size_t *"\fP
-.RE
+\fIsize_t *\fP
argument points to a variable that will be updated
after each write to reflect how much of the buffer
is currently in use.
@@ -457,10 +383,7 @@ You should be careful to ensure that this variable
remains allocated until after the archive is
closed.
.TP
-.nh
-\fBarchive_write_header\fP
-.hy
-();
+\fB\%archive_write_header\fP()
Build and write a header using the data in the provided
Tn struct archive_entry
structure.
@@ -470,107 +393,72 @@ for information on creating and populating
Tn struct archive_entry
objects.
.TP
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+\fB\%archive_write_data\fP()
Write data corresponding to the header just written.
Returns number of bytes written or -1 on error.
.TP
-.nh
-\fBarchive_write_finish_entry\fP
-.hy
-();
+\fB\%archive_write_finish_entry\fP()
Close out the entry just written.
In particular, this writes out the final padding required by some formats.
Ordinarily, clients never need to call this, as it
is called automatically by
-.nh
-\fBarchive_write_next_header\fP
-.hy
-();
+\fB\%archive_write_next_header\fP()
and
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
as needed.
.TP
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
Complete the archive and invoke the close callback.
.TP
-.nh
-\fBarchive_write_finish\fP
-.hy
-();
+\fB\%archive_write_finish\fP()
Invokes
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
if it was not invoked manually, then releases all resources.
Note that this function was declared to return
\fIvoid\fP
-.RE
in libarchive 1.x, which made it impossible to detect errors when
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
was invoked implicitly from this function.
This is corrected beginning with libarchive 2.0.
+.RE
More information about the
\fIstruct\fP archive
object and the overall design of the library can be found in the
\fBlibarchive\fP(3)
overview.
.SH IMPLEMENTATION
+.ad l
Compression support is built-in to libarchive, which uses zlib and bzlib
to handle gzip and bzip2 compression, respectively.
.SH CLIENT CALLBACKS
+.ad l
To use this library, you will need to define and register
callback functions that will be invoked to write data to the
resulting archive.
These functions are registered by calling
-.nh
-\fBarchive_write_open\fP
-.hy
-(:);
+\fB\%archive_write_open\fP():
+.RS 5
.IP
\fItypedef int\fP
+\fB\%archive_open_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP)
.RE
-.nh
-\fBarchive_open_callback\fP
-.hy
-("struct archive *" "void *client_data");
+.PP
The open callback is invoked by
-.nh
-\fBarchive_write_open\fP
-.hy
-(.);
+\fB\%archive_write_open\fP().
It should return
\fBARCHIVE_OK\fP
if the underlying file or data source is successfully
opened.
If the open fails, it should call
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and return
\fBARCHIVE_FATAL\fP.
+.RS 5
.IP
\fItypedef ssize_t\fP
+\fB\%archive_write_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP, \fI\%const\ void\ *buffer\fP, \fI\%size_t\ length\fP)
.RE
-Fo archive_write_callback
-Fa "struct archive *"
-Fa "void *client_data"
-Fa "void *buffer"
-Fa "size_t length"
-Fc
+.PP
The write callback is invoked whenever the library
needs to write raw bytes to the archive.
For correct blocking, each call to the write callback function
@@ -581,32 +469,26 @@ This is especially critical when writing archives to tape drives.
On success, the write callback should return the
number of bytes actually written.
On error, the callback should invoke
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and return -1.
+.RS 5
.IP
\fItypedef int\fP
+\fB\%archive_close_callback\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *client_data\fP)
.RE
-.nh
-\fBarchive_close_callback\fP
-.hy
-("struct archive *" "void *client_data");
+.PP
The close callback is invoked by archive_close when
the archive processing is complete.
The callback should return
\fBARCHIVE_OK\fP
on success.
On failure, the callback should invoke
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to register an error code and message and
return
\fBARCHIVE_FATAL.\fP
.SH EXAMPLE
+.ad l
The following sketch illustrates basic usage of the library.
In this example,
the callback functions are simply wrappers around the standard
@@ -615,7 +497,11 @@ the callback functions are simply wrappers around the standard
and
\fBclose\fP(2)
system calls.
-.RS
+.RS 4
+.nf
+#ifdef __linux__
+#define _FILE_OFFSET_BITS 64
+#endif
#include <sys/stat.h>
#include <archive.h>
#include <archive_entry.h>
@@ -637,7 +523,7 @@ myopen(struct archive *a, void *client_data)
return (ARCHIVE_FATAL);
}
ssize_t
-mywrite(struct archive *a, void *client_data, void *buff, size_t n)
+mywrite(struct archive *a, void *client_data, const void *buff, size_t n)
{
struct mydata *mydata = client_data;
return (write(mydata->fd, buff, n));
@@ -692,6 +578,7 @@ int main(int argc, const char **argv)
}
.RE
.SH RETURN VALUES
+.ad l
Most functions return
\fBARCHIVE_OK\fP
(zero) on success, or one of several non-zero
@@ -704,98 +591,66 @@ for unusual conditions that do not prevent further operations, and
\fBARCHIVE_FATAL\fP
for serious errors that make remaining operations impossible.
The
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions can be used to retrieve an appropriate error code and a
textual error message.
-.nh
-\fBarchive_write_new\fP
-.hy
-();
+.PP
+\fB\%archive_write_new\fP()
returns a pointer to a newly-allocated
Tn struct archive
object.
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+.PP
+\fB\%archive_write_data\fP()
returns a count of the number of bytes actually written.
On error, -1 is returned and the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions will return appropriate values.
Note that if the client-provided write callback function
returns a non-zero value, that error will be propagated back to the caller
through whatever API function resulted in that call, which
may include
-.nh
-\fBarchive_write_header\fP
-.hy
-(,);
-.nh
-\fBarchive_write_data\fP
-.hy
-(,);
-.nh
-\fBarchive_write_close\fP
-.hy
-(,);
+\fB\%archive_write_header\fP(),
+\fB\%archive_write_data\fP(),
+\fB\%archive_write_close\fP(),
or
-.nh
-\fBarchive_write_finish\fP
-.hy
-(.);
+\fB\%archive_write_finish\fP().
The client callback can call
-.nh
-\fBarchive_set_error\fP
-.hy
-();
+\fB\%archive_set_error\fP()
to provide values that can then be retrieved by
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-(.);
+\fB\%archive_error_string\fP().
.SH SEE ALSO
+.ad l
\fBtar\fP(1),
\fBlibarchive\fP(3),
\fBtar\fP(5)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
.SH BUGS
+.ad l
There are many peculiar bugs in historic tar implementations that may cause
certain programs to reject archives written by this library.
For example, several historic implementations calculated header checksums
incorrectly and will thus reject valid archives; GNU tar does not fully support
pax interchange format; some old tar implementations required specific
field terminations.
+.PP
The default pax interchange format eliminates most of the historic
tar limitations and provides a generic key/value attribute facility
for vendor-defined extensions.
@@ -808,7 +663,7 @@ and
for device numbers that exceed the range supported by the backwards-compatible
ustar header.
These keys are compatible with Joerg Schilling's
-\fBstar\fP
+\fB\%star\fP
archiver.
Other implementations may not recognize these keys and will thus be unable
to correctly restore device nodes with large device numbers from archives
diff --git a/archivers/libarchive/files/doc/man/archive_write_disk.3 b/archivers/libarchive/files/doc/man/archive_write_disk.3
index e48292d0e47..a58181e23d1 100644
--- a/archivers/libarchive/files/doc/man/archive_write_disk.3
+++ b/archivers/libarchive/files/doc/man/archive_write_disk.3
@@ -1,131 +1,93 @@
-.TH archive_write_disk 3 "March 2, 2007" ""
+.TH archive_write_disk 3 "August 5, 2008" ""
.SH NAME
-\fBarchive_write_disk_new\fP,
-\fBarchive_write_disk_set_options\fP,
-\fBarchive_write_disk_set_skip_file\fP,
-\fBarchive_write_disk_set_group_lookup\fP,
-\fBarchive_write_disk_set_standard_lookup\fP,
-\fBarchive_write_disk_set_user_lookup\fP,
-\fBarchive_write_header\fP,
-\fBarchive_write_data\fP,
-\fBarchive_write_finish_entry\fP,
-\fBarchive_write_close\fP,
-\fBarchive_write_finish\fP
+.ad l
+\fB\%archive_write_disk_new\fP,
+\fB\%archive_write_disk_set_options\fP,
+\fB\%archive_write_disk_set_skip_file\fP,
+\fB\%archive_write_disk_set_group_lookup\fP,
+\fB\%archive_write_disk_set_standard_lookup\fP,
+\fB\%archive_write_disk_set_user_lookup\fP,
+\fB\%archive_write_header\fP,
+\fB\%archive_write_data\fP,
+\fB\%archive_write_finish_entry\fP,
+\fB\%archive_write_close\fP,
+\fB\%archive_write_finish\fP
\- functions for creating objects on disk
.SH SYNOPSIS
+.ad l
\fB#include <archive.h>\fP
.br
\fIstruct archive *\fP
-.RE
-.nh
-\fBarchive_write_disk_new\fP
-.hy
-("void");
+.br
+\fB\%archive_write_disk_new\fP(\fI\%void\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_disk_set_options\fP
-.hy
-("struct archive *" "int flags");
+.br
+\fB\%archive_write_disk_set_options\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ flags\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_disk_set_skip_file\fP
-.hy
-("struct archive *" "dev_t" "ino_t");
+.br
+\fB\%archive_write_disk_set_skip_file\fP(\fI\%struct\ archive\ *\fP, \fI\%dev_t\fP, \fI\%ino_t\fP);
+.br
\fIint\fP
-.RE
-Fo archive_write_disk_set_group_lookup
-Fa "struct archive *"
-Fa "void *"
-Fa "gid_t (*)(void *, const char *gname, gid_t gid)"
-Fa "void (*cleanup)(void *)"
-Fc
+.br
+\fB\%archive_write_disk_set_group_lookup\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%gid_t\ (*)(void\ *,\ const\ char\ *gname,\ gid_t\ gid)\fP, \fI\%void\ (*cleanup)(void\ *)\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_disk_set_standard_lookup\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_disk_set_standard_lookup\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-Fo archive_write_disk_set_user_lookup
-Fa "struct archive *"
-Fa "void *"
-Fa "uid_t (*)(void *, const char *uname, uid_t uid)"
-Fa "void (*cleanup)(void *)"
-Fc
+.br
+\fB\%archive_write_disk_set_user_lookup\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%uid_t\ (*)(void\ *,\ const\ char\ *uname,\ uid_t\ uid)\fP, \fI\%void\ (*cleanup)(void\ *)\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_header\fP
-.hy
-("struct archive *" "struct archive_entry *");
+.br
+\fB\%archive_write_header\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP);
+.br
\fIssize_t\fP
-.RE
-.nh
-\fBarchive_write_data\fP
-.hy
-("struct archive *" "const void *" "size_t");
+.br
+\fB\%archive_write_data\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_finish_entry\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_finish_entry\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_close\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_close\fP(\fI\%struct\ archive\ *\fP);
+.br
\fIint\fP
-.RE
-.nh
-\fBarchive_write_finish\fP
-.hy
-("struct archive *");
+.br
+\fB\%archive_write_finish\fP(\fI\%struct\ archive\ *\fP);
.SH DESCRIPTION
+.ad l
These functions provide a complete API for creating objects on
disk from
Tn struct archive_entry
descriptions.
They are most naturally used when extracting objects from an archive
using the
-.nh
-\fBarchive_read\fP
-.hy
-();
+\fB\%archive_read\fP()
interface.
The general process is to read
Tn struct archive_entry
objects from an archive, then write those objects to a
Tn struct archive
object created using the
-.nh
-\fBarchive_write_disk\fP
-.hy
-();
+\fB\%archive_write_disk\fP()
family functions.
This interface is deliberately very similar to the
-.nh
-\fBarchive_write\fP
-.hy
-();
+\fB\%archive_write\fP()
interface used to write objects to a streaming archive.
+.RS 5
.TP
-.nh
-\fBarchive_write_disk_new\fP
-.hy
-();
+\fB\%archive_write_disk_new\fP()
Allocates and initializes a
Tn struct archive
object suitable for writing objects to disk.
.TP
-.nh
-\fBarchive_write_disk_set_skip_file\fP
-.hy
-();
+\fB\%archive_write_disk_set_skip_file\fP()
Records the device and inode numbers of a file that should not be
overwritten.
This is typically used to ensure that an extraction process does not
@@ -133,12 +95,10 @@ overwrite the archive from which objects are being read.
This capability is technically unnecessary but can be a significant
performance optimization in practice.
.TP
-.nh
-\fBarchive_write_disk_set_options\fP
-.hy
-();
+\fB\%archive_write_disk_set_options\fP()
The options field consists of a bitwise OR of one or more of the
following values:
+.RS 5
.TP
\fBARCHIVE_EXTRACT_OWNER\fP
The user and group IDs should be set on the restored file.
@@ -214,17 +174,10 @@ always cause an error, regardless of this flag.
Scan data for blocks of NUL bytes and try to recreate them with holes.
This results in sparse files, independent of whether the archive format
supports or uses them.
+.RE
.TP
-Xo
-.nh
-\fBarchive_write_disk_set_group_lookup\fP
-.hy
-(,);
-.nh
-\fBarchive_write_disk_set_user_lookup\fP
-.hy
-();
-Xc
+\fB\%archive_write_disk_set_group_lookup\fP(),
+\fB\%archive_write_disk_set_user_lookup\fP()
The
Tn struct archive_entry
objects contain both names and ids that can be used to identify users
@@ -243,10 +196,7 @@ The cleanup function will be invoked when the
Tn struct archive
object is destroyed.
.TP
-.nh
-\fBarchive_write_disk_set_standard_lookup\fP
-.hy
-();
+\fB\%archive_write_disk_set_standard_lookup\fP()
This convenience function installs a standard set of user
and group lookup functions.
These functions use
@@ -261,10 +211,7 @@ the number of calls to
and
\fBgetgrnam\fP(3).
.TP
-.nh
-\fBarchive_write_header\fP
-.hy
-();
+\fB\%archive_write_header\fP()
Build and write a header using the data in the provided
Tn struct archive_entry
structure.
@@ -274,55 +221,35 @@ for information on creating and populating
Tn struct archive_entry
objects.
.TP
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+\fB\%archive_write_data\fP()
Write data corresponding to the header just written.
Returns number of bytes written or -1 on error.
.TP
-.nh
-\fBarchive_write_finish_entry\fP
-.hy
-();
+\fB\%archive_write_finish_entry\fP()
Close out the entry just written.
Ordinarily, clients never need to call this, as it
is called automatically by
-.nh
-\fBarchive_write_next_header\fP
-.hy
-();
+\fB\%archive_write_next_header\fP()
and
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
as needed.
.TP
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
Set any attributes that could not be set during the initial restore.
For example, directory timestamps are not restored initially because
restoring a subsequent file would alter that timestamp.
Similarly, non-writable directories are initially created with
write permissions (so that their contents can be restored).
The
-\fBarchive_write_disk_new\fP
+\fB\%archive_write_disk_new\fP
library maintains a list of all such deferred attributes and
sets them when this function is invoked.
.TP
-.nh
-\fBarchive_write_finish\fP
-.hy
-();
+\fB\%archive_write_finish\fP()
Invokes
-.nh
-\fBarchive_write_close\fP
-.hy
-();
+\fB\%archive_write_close\fP()
if it was not invoked manually, then releases all resources.
+.RE
More information about the
\fIstruct\fP archive
object and the overall design of the library can be found in the
@@ -331,6 +258,7 @@ overview.
Many of these functions are also documented under
\fBarchive_write\fP(3).
.SH RETURN VALUES
+.ad l
Most functions return
\fBARCHIVE_OK\fP
(zero) on success, or one of several non-zero
@@ -343,74 +271,56 @@ for unusual conditions that do not prevent further operations, and
\fBARCHIVE_FATAL\fP
for serious errors that make remaining operations impossible.
The
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions can be used to retrieve an appropriate error code and a
textual error message.
-.nh
-\fBarchive_write_disk_new\fP
-.hy
-();
+.PP
+\fB\%archive_write_disk_new\fP()
returns a pointer to a newly-allocated
Tn struct archive
object.
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+.PP
+\fB\%archive_write_data\fP()
returns a count of the number of bytes actually written.
On error, -1 is returned and the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions will return appropriate values.
.SH SEE ALSO
+.ad l
\fBarchive_read\fP(3),
\fBarchive_write\fP(3),
\fBtar\fP(1),
\fBlibarchive\fP(3)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
The
-\fBarchive_write_disk\fP
+\fB\%archive_write_disk\fP
interface was added to
-\fBlibarchive\fP 2.0
+\fB\%libarchive\fP 2.0
and first appeared in
FreeBSD 6.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
.SH BUGS
+.ad l
Directories are actually extracted in two distinct phases.
Directories are created during
-.nh
-\fBarchive_write_header\fP
-.hy
-(,);
+\fB\%archive_write_header\fP(),
but final permissions are not set until
-.nh
-\fBarchive_write_close\fP
-.hy
-(.);
+\fB\%archive_write_close\fP().
This separation is necessary to correctly handle borderline
cases such as a non-writable directory containing
files, but can cause unexpected results.
@@ -419,24 +329,20 @@ restored until the archive is closed.
If you use
\fBchdir\fP(2)
to change the current directory between calls to
-.nh
-\fBarchive_read_extract\fP
-.hy
-();
+\fB\%archive_read_extract\fP()
or before calling
-.nh
-\fBarchive_read_close\fP
-.hy
-(,);
+\fB\%archive_read_close\fP(),
you may confuse the permission-setting logic with
the result that directory permissions are restored
incorrectly.
+.PP
The library attempts to create objects with filenames longer than
\fBPATH_MAX\fP
by creating prefixes of the full path and changing the current directory.
Currently, this logic is limited in scope; the fixup pass does
not work correctly for such objects and the symlink security check
option disables the support for very long pathnames.
+.PP
Restoring the path
\fIaa/../bb\fP
does create each intermediate directory.
@@ -449,10 +355,12 @@ with a single request.
Of course, this does not work if the
\fBARCHIVE_EXTRACT_NODOTDOT\fP
option is specified.
+.PP
Implicit directories are always created obeying the current umask.
Explicit objects are created obeying the current umask unless
\fBARCHIVE_EXTRACT_PERM\fP
is specified, in which case they current umask is ignored.
+.PP
SGID and SUID bits are restored only if the correct user and
group could be set.
If
@@ -461,6 +369,7 @@ is not specified, then no attempt is made to set the ownership.
In this case, SGID and SUID bits are restored only if the
user and group of the final object happen to match those specified
in the entry.
+.PP
The
``standard''
user-id and group-id lookup functions are not the defaults because
@@ -470,7 +379,8 @@ and
are sometimes too large for particular applications.
The current design allows the application author to use a more
compact implementation when appropriate.
+.PP
There should be a corresponding
-\fBarchive_read_disk\fP
+\fB\%archive_read_disk\fP
interface that walks a directory heirarchy and returns archive
entry objects.
diff --git a/archivers/libarchive/files/doc/man/bsdcpio.1 b/archivers/libarchive/files/doc/man/bsdcpio.1
index fa1bd729c86..76217b457c5 100644
--- a/archivers/libarchive/files/doc/man/bsdcpio.1
+++ b/archivers/libarchive/files/doc/man/bsdcpio.1
@@ -1,35 +1,40 @@
.TH BSDCPIO 1 "December 21, 2007" ""
.SH NAME
-\fBcpio\fP
+.ad l
+\fB\%cpio\fP
\- copy files to and from archives
.SH SYNOPSIS
+.ad l
.br
-\fBcpio\fP
+\fB\%cpio\fP
{\fB\-i\fP}
[\fIoptions\fP]
[\fIpattern\fP ...]
[\fI<\fP archive]
.br
-\fBcpio\fP
+\fB\%cpio\fP
{\fB\-o\fP}
[\fIoptions\fP]
\fI<\fP name-list
[\fI>\fP archive]
.br
-\fBcpio\fP
+\fB\%cpio\fP
{\fB\-p\fP}
[\fIoptions\fP]
\fIdest-dir\fP
\fI<\fP name-list
.SH DESCRIPTION
-\fBcpio\fP
+.ad l
+\fB\%cpio\fP
copies files between archives and directories.
This implementation can extract from tar, pax, cpio, zip, jar, ar,
and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
and shar archives.
+.PP
The first option to
-\fBcpio\fP
+\fB\%cpio\fP
is a mode indicator from the following list:
+.RS 5
.TP
\fB\-i\fP
Input.
@@ -50,9 +55,17 @@ on standard output (unless overriden) containing the specified items.
Pass-through.
Read a list of filenames from standard input and copy the files to the
specified directory.
+.RE
+.PP
.SH OPTIONS
+.ad l
Unless specifically stated otherwise, options are applicable in
all operating modes.
+.RS 5
+.TP
+\fB\-0\fP
+Read filenames separated by NUL characters instead of newlines.
+This is necessary if any of the filenames being read might contain newlines.
.TP
\fB\-A\fP
(o mode only)
@@ -102,6 +115,8 @@ Ignore files that match
(o mode only)
Produce the output archive in the specified format.
Supported formats include:
+.PP
+.RS 5
.TP
\fIcpio\fP
Synonym for
@@ -118,6 +133,8 @@ The POSIX.1 pax format, an extension of the ustar format.
.TP
\fIustar\fP
The POSIX.1 tar format.
+.RE
+.PP
The default format is
\fIodc\fP.
See
@@ -127,6 +144,13 @@ formats currently supported by the underlying
\fBlibarchive\fP(3)
library.
.TP
+\fB\-H\fP \fIformat\fP
+Synonym for
+\fB\--format\fP.
+.TP
+\fB\-h\fP, \fB\--help\fP
+Print usage information.
+.TP
\fB\-I\fP \fIfile\fP
Read archive from
\fIfile\fP.
@@ -142,6 +166,16 @@ This allows extraction via symbolic links and path names containing
Sq ..
in the name.
.TP
+\fB\-J\fP
+(o mode only)
+Compress the file with xz-compatible compression before writing it.
+In input mode, this option is ignored; xz compression is recognized
+automatically on input.
+.TP
+\fB\-j\fP
+Synonym for
+\fB\-y\fP.
+.TP
\fB\-L\fP
(o and p modes)
All symbolic links will be followed.
@@ -153,11 +187,32 @@ With this option, the target of the link will be archived or copied instead.
Create links from the target directory to the original files,
instead of copying.
.TP
+\fB\-lzma\fP
+(o mode only)
+Compress the file with lzma-compatible compression before writing it.
+In input mode, this option is ignored; lzma compression is recognized
+automatically on input.
+.TP
\fB\-m\fP
(i and p modes)
Set file modification time on created files to match
those in the source.
.TP
+\fB\-n\fP
+(i mode, only with
+\fB\-t\fP)
+Display numeric uid and gid.
+By default,
+\fB\%cpio\fP
+displays the user and group names when they are provided in the
+archive, or looks up the user and group names in the system
+password database.
+.TP
+\fB\-no-preserve-owner\fP
+(i mode only)
+Do not attempt to restore file ownership.
+This is the default when run by non-root users.
+.TP
\fB\-O\fP \fIfile\fP
Write archive to
\fIfile\fP.
@@ -170,6 +225,11 @@ See above for description.
Pass-through mode.
See above for description.
.TP
+\fB\-preserve-owner\fP
+(i mode only)
+Restore file ownership.
+This is the default when run by the root user.
+.TP
\fB\--quiet\fP
Suppress unnecessary messages.
.TP
@@ -239,9 +299,12 @@ compression is recognized automatically on input.
Compress the archive with gzip-compatible compression before writing it.
In input mode, this option is ignored;
gzip compression is recognized automatically on input.
+.RE
.SH ENVIRONMENT
+.ad l
The following environment variables affect the execution of
-\fB:\fP
+\fB\%cpio\fP:
+.RS 5
.TP
.B LANG
The locale to use.
@@ -254,11 +317,14 @@ The timezone to use when displaying dates.
See
\fBenviron\fP(7)
for more information.
+.RE
.SH EXIT STATUS
+.ad l
The \fBcpio\fP utility exits 0 on success, and >0 if an error occurs.
.SH EXAMPLES
+.ad l
The
-\fBcpio\fP
+\fB\%cpio\fP
command is traditionally used to copy file heirarchies in conjunction
with the
\fBfind\fP(1)
@@ -267,9 +333,10 @@ The first example here simply copies all files from
\fIsrc\fP
to
\fIdest\fP:
-.RS
-\fBcpio\fP find \fIsrc\fP | \fBcpio\fP \fB\-pmud\fP \fIdest\fP
+.RS 4
+\fB\%find\fP \fIsrc\fP | \fB\%cpio\fP \fB\-pmud\fP \fIdest\fP
.RE
+.PP
By carefully selecting options to the
\fBfind\fP(1)
command and combining it with other standard utilities,
@@ -279,21 +346,24 @@ This next example copies files from
to
\fIdest\fP
that are more than 2 days old and whose names match a particular pattern:
-.RS
-\fBcpio\fP find \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fINm\fP grep foo[bar] | \fBcpio\fP \fB\-pdmu\fP \fIdest\fP
+.RS 4
+\fB\%find\fP \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fB\%grep\fP foo[bar] | \fB\%cpio\fP \fB\-pdmu\fP \fIdest\fP
.RE
+.PP
This example copies files from
\fIsrc\fP
to
\fIdest\fP
that are more than 2 days old and which contain the word
-Do foobar Dc:
-.RS
-\fBcpio\fP find \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fINm\fP xargs \fBcpio\fP grep -l foobar | \fBcpio\fP \fB\-pdmu\fP \fIdest\fP
+``foobar'':
+.RS 4
+\fB\%find\fP \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fB\%xargs\fP \fB\%grep\fP -l foobar | \fB\%cpio\fP \fB\-pdmu\fP \fIdest\fP
.RE
.SH COMPATIBILITY
+.ad l
The mode options i, o, and p and the options
a, B, c, d, f, l, m, r, t, u, and v comply with SUSv2.
+.PP
The old POSIX.1 standard specified that only
\fB\-i\fP,
\fB\-o\fP,
@@ -320,6 +390,7 @@ with the standard.
For best compatibility, scripts should limit themselves to the
standard syntax.
.SH SEE ALSO
+.ad l
\fBbzip2\fP(1),
\fBtar\fP(1),
\fBgzip\fP(1),
@@ -330,19 +401,22 @@ standard syntax.
\fBlibarchive-formats\fP(5),
\fBtar\fP(5)
.SH STANDARDS
+.ad l
There is no current POSIX standard for the cpio command; it appeared
in
ISO/IEC 9945-1:1996 (``POSIX.1'')
but was dropped from
IEEE Std 1003.1-2001 (``POSIX.1'').
+.PP
The cpio, ustar, and pax interchange file formats are defined by
IEEE Std 1003.1-2001 (``POSIX.1'')
for the pax command.
.SH HISTORY
+.ad l
The original
-\fBcpio\fP
+\fB\%cpio\fP
and
-\fBfind\fP
+\fB\%find\fP
utilities were written by Dick Haight
while working in AT&T's Unix Support Group.
They first appeared in 1977 in PWB/UNIX 1.0, the
@@ -350,14 +424,16 @@ They first appeared in 1977 in PWB/UNIX 1.0, the
system developed for use within AT&T.
They were first released outside of AT&T as part of System III Unix in 1981.
As a result,
-\fBcpio\fP
+\fB\%cpio\fP
actually predates
-\fBtar\fP,
+\fB\%tar\fP,
even though it was not well-known outside of AT&T until some time later.
+.PP
This is a complete re-implementation based on the
\fBlibarchive\fP(3)
library.
.SH BUGS
+.ad l
The cpio archive format has several basic limitations:
It does not store user and group names, only numbers.
As a result, it cannot be reliably used to transfer
diff --git a/archivers/libarchive/files/doc/man/bsdtar.1 b/archivers/libarchive/files/doc/man/bsdtar.1
index c1088d9e861..bd9f6189829 100644
--- a/archivers/libarchive/files/doc/man/bsdtar.1
+++ b/archivers/libarchive/files/doc/man/bsdtar.1
@@ -1,43 +1,49 @@
-.TH BSDTAR 1 "May 15, 2008" ""
+.TH BSDTAR 1 "Oct 12, 2009" ""
.SH NAME
-\fBtar\fP
+.ad l
+\fB\%tar\fP
\- manipulate tape archives
.SH SYNOPSIS
+.ad l
.br
-\fBtar\fP
+\fB\%tar\fP
[\fIbundled-flags\fP <args>]
[<\fIfile\fP> | <\fIpattern\fP> ...]
.br
-\fBtar\fP
+\fB\%tar\fP
{\fB\-c\fP}
[\fIoptions\fP]
[\fIfiles\fP | \fIdirectories\fP]
.br
-\fBtar\fP
+\fB\%tar\fP
{\fB\-r\fP | \fB\-u\fP}
\fB\-f\fP \fIarchive-file\fP
[\fIoptions\fP]
[\fIfiles\fP | \fIdirectories\fP]
.br
-\fBtar\fP
+\fB\%tar\fP
{\fB\-t\fP | \fB\-x\fP}
[\fIoptions\fP]
[\fIpatterns\fP]
.SH DESCRIPTION
-\fBtar\fP
+.ad l
+\fB\%tar\fP
creates and manipulates streaming archive files.
This implementation can extract from tar, pax, cpio, zip, jar, ar,
and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
and shar archives.
+.PP
The first synopsis form shows a
``bundled''
option word.
This usage is provided for compatibility with historical implementations.
See COMPATIBILITY below for details.
+.PP
The other synopsis forms show the preferred usage.
The first option to
-\fBtar\fP
+\fB\%tar\fP
is a mode indicator from the following list:
+.RS 5
.TP
\fB\-c\fP
Create a new archive containing the specified items.
@@ -69,6 +75,8 @@ Extract to disk from the archive.
If a file with the same name appears more than once in the archive,
each copy will be extracted, with later copies overwriting (replacing)
earlier copies.
+.RE
+.PP
In
\fB\-c\fP,
\fB\-r\fP,
@@ -77,6 +85,7 @@ or
mode, each specified file or directory is added to the
archive in the order specified on the command line.
By default, the contents of each directory are also archived.
+.PP
In extract or list mode, the entire command line
is read and parsed before the archive is opened.
The pathnames or patterns on the command line indicate
@@ -85,35 +94,37 @@ Patterns are shell-style globbing patterns as
documented in
\fBtcsh\fP(1).
.SH OPTIONS
+.ad l
Unless specifically stated otherwise, options are applicable in
all operating modes.
+.RS 5
.TP
\fB@\fP \fIarchive\fP
(c and r mode only)
The specified archive is opened and the entries
in it will be appended to the current archive.
As a simple example,
-.RS
-\fBtar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fB@\fP \fIoriginal.tar\fP
+.RS 4
+\fB\%tar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fB@\fP \fIoriginal.tar\fP
.RE
writes a new archive to standard output containing a file
\fInewfile\fP
and all of the entries from
\fIoriginal.tar\fP.
In contrast,
-.RS
-\fBtar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fIoriginal.tar\fP
+.RS 4
+\fB\%tar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fIoriginal.tar\fP
.RE
creates a new archive with only two entries.
Similarly,
-.RS
-\fBtar\fP \fB\-czf\fP \fI-\fP \fB\--format\fP \fBpax\fP \fB@\fP \fI-\fP
+.RS 4
+\fB\%tar\fP \fB\-czf\fP \fI-\fP \fB\--format\fP \fBpax\fP \fB@\fP \fI-\fP
.RE
reads an archive from standard input (whose format will be determined
automatically) and converts it into a gzip-compressed
pax-format archive on stdout.
In this way,
-\fBtar\fP
+\fB\%tar\fP
can be used to convert archives from one format to another.
.TP
\fB\-b\fP \fIblocksize\fP
@@ -128,27 +139,24 @@ the following files.
In x mode, change directories after opening the archive
but before extracting entries from the archive.
.TP
-\fB\--check-links\fP (\fB\-W\fP \fBcheck-links\fP)
+\fB\--check-links\fP
(c and r modes only)
Issue a warning message unless all links to each file are archived.
.TP
-\fB\--chroot\fP (\fB\-W\fP \fBchroot\fP)
+\fB\--chroot\fP
(x mode only)
-.nh
-\fBchroot\fP
-.hy
-();
+\fB\%chroot\fP()
to the current directory after processing any
\fB\-C\fP
options and before extracting any files.
.TP
-\fB\--exclude\fP \fIpattern\fP (\fB\-W\fP \fBexclude\fP=\fIpattern\fP)
+\fB\--exclude\fP \fIpattern\fP
Do not process files or directories that match the
specified pattern.
Note that exclusions take precedence over patterns or filenames
specified on the command line.
.TP
-\fB\--format\fP \fIformat\fP (\fB\-W\fP \fBformat\fP=\fIformat\fP)
+\fB\--format\fP \fIformat\fP
(c, r, u mode only)
Use the specified format for the created archive.
Supported formats include
@@ -188,7 +196,7 @@ Synonym for
Synonym for
\fB\-T\fP.
.TP
-\fB\--include\fP \fIpattern\fP (\fB\-W\fP \fBinclude\fP=\fIpattern\fP)
+\fB\--include\fP \fIpattern\fP
Process only files or directories that match the specified pattern.
Note that exclusions specified with
\fB\--exclude\fP
@@ -199,8 +207,8 @@ The
\fB\--include\fP
option is especially useful when filtering archives.
For example, the command
-.RS
-\fBtar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fB\--include='*foo*'\fP \fB@\fP \fIold.tgz\fP
+.RS 4
+\fB\%tar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fB\--include='*foo*'\fP \fB@\fP \fIold.tgz\fP
.RE
creates a new archive
\fInew.tar\fP
@@ -215,7 +223,7 @@ Compress the resulting archive with
\fBbzip2\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-\fBtar\fP
+\fB\%tar\fP
implementations, this implementation recognizes bzip2 compression
automatically when reading archives.
.TP
@@ -225,7 +233,7 @@ Do not overwrite existing files.
In particular, if a file appears more than once in an archive,
later copies will not overwrite earlier copies.
.TP
-\fB\--keep-newer-files\fP (\fB\-W\fP \fBkeep-newer-files\fP)
+\fB\--keep-newer-files\fP
(x mode only)
Do not overwrite existing files that are newer than the
versions appearing in the archive being extracted.
@@ -250,33 +258,33 @@ By default, the modification time is set to the time stored in the archive.
(c, r, u modes only)
Do not recursively archive the contents of directories.
.TP
-\fB\--newer\fP \fIdate\fP (\fB\-W\fP \fBnewer\fP=\fIdate\fP)
+\fB\--newer\fP \fIdate\fP
(c, r, u modes only)
Only include files and directories newer than the specified date.
This compares ctime entries.
.TP
-\fB\--newer-mtime\fP \fIdate\fP (\fB\-W\fP \fBnewer-mtime\fP=\fIdate\fP)
+\fB\--newer-mtime\fP \fIdate\fP
(c, r, u modes only)
Like
\fB\--newer\fP,
except it compares mtime entries instead of ctime entries.
.TP
-\fB\--newer-than\fP \fIfile\fP (\fB\-W\fP \fBnewer-than\fP=\fIfile\fP)
+\fB\--newer-than\fP \fIfile\fP
(c, r, u modes only)
Only include files and directories newer than the specified file.
This compares ctime entries.
.TP
-\fB\--newer-mtime-than\fP \fIfile\fP (\fB\-W\fP \fBnewer-mtime-than\fP=\fIfile\fP)
+\fB\--newer-mtime-than\fP \fIfile\fP
(c, r, u modes only)
Like
\fB\--newer-than\fP,
except it compares mtime entries instead of ctime entries.
.TP
-\fB\--nodump\fP (\fB\-W\fP \fBnodump\fP)
+\fB\--nodump\fP
(c and r modes only)
Honor the nodump file flag by skipping this file.
.TP
-\fB\--null\fP (\fB\-W\fP \fBnull\fP)
+\fB\--null\fP
(use with
\fB\-I\fP,
\fB\-T\fP,
@@ -317,17 +325,102 @@ the archive will be discarded.
A synonym for
\fB\--format\fP \fIustar\fP
.TP
-\fB\--one-file-system\fP (\fB\-W\fP \fBone-file-system\fP)
+\fB\--one-file-system\fP
(c, r, and u modes)
Do not cross mount points.
.TP
+\fB\--options\fP \fIoptions\fP
+Select optional behaviors for particular modules.
+The argument is a text string containing comma-separated
+keywords and values.
+These are passed to the modules that handle particular
+formats to control how those formats will behave.
+Each option has one of the following forms:
+.RS 5
+.TP
+\fIkey=value\fP
+The key will be set to the specified value in every module that supports it.
+Modules that do not support this key will ignore it.
+.TP
+\fIkey\fP
+The key will be enabled in every module that supports it.
+This is equivalent to
+\fIkey\fP \fB=1\fP.
+.TP
+\fI!key\fP
+The key will be disabled in every module that supports it.
+.TP
+\fImodule:key=value\fP, \fImodule:key\fP, \fImodule:!key\fP
+As above, but the corresponding key and value will be provided
+only to modules whose name matches
+\fImodule\fP.
+.RE
+The currently supported modules and keys are:
+.RS 5
+.TP
+\fBiso9660:joliet\fP
+Support Joliet extensions.
+This is enabled by default, use
+\fB!joliet\fP
+or
+\fBiso9660:!joliet\fP
+to disable.
+.TP
+\fBiso9660:rockridge\fP
+Support Rock Ridge extensions.
+This is enabled by default, use
+\fB!rockridge\fP
+or
+\fBiso9660:!rockridge\fP
+to disable.
+.TP
+\fBgzip:compression-level\fP
+A decimal integer from 0 to 9 specifying the gzip compression level.
+.TP
+\fBxz:compression-level\fP
+A decimal integer from 0 to 9 specifying the xz compression level.
+.TP
+\fBmtree:\fP \fIkeyword\fP
+The mtree writer module allows you to specify which mtree keywords
+will be included in the output.
+Supported keywords include:
+\fBcksum\fP, \fBdevice\fP, \fBflags\fP, \fBgid\fP, \fBgname\fP, \fBindent\fP,
+\fBlink\fP, \fBmd5\fP, \fBmode\fP, \fBnlink\fP, \fBrmd160\fP, \fBsha1\fP, \fBsha256\fP,
+\fBsha384\fP, \fBsha512\fP, \fBsize\fP, \fBtime\fP, \fBuid\fP, \fBuname\fP.
+The default is equivalent to:
+``device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname''.
+.TP
+\fBmtree:all\fP
+Enables all of the above keywords.
+You can also use
+\fBmtree:!all\fP
+to disable all keywords.
+.TP
+\fBmtree:use-set\fP
+Enable generation of
+\fB/set\fP
+lines in the output.
+.TP
+\fBmtree:indent\fP
+Produce human-readable output by indenting options and splitting lines
+to fit into 80 columns.
+.TP
+\fBzip:compression\fP=\fItype\fP
+Use
+\fItype\fP
+as compression method.
+Supported values are store (uncompressed) and deflate (gzip algorithm).
+.RE
+If a provided option is not supported by any module, that
+is a fatal error.
+.TP
\fB\-P\fP
Preserve pathnames.
By default, absolute pathnames (those that begin with a /
character) have the leading slash removed both when creating archives
and extracting from them.
Also,
-\fBtar\fP
+\fB\%tar\fP
will refuse to extract archive entries whose pathnames contain
\fI\& ..\fP
or whose target directory would be altered by a symlink.
@@ -339,11 +432,11 @@ Preserve file permissions.
Attempt to restore the full permissions, including owner, file modes, file
flags and ACLs, if available, for each item extracted from the archive.
By default, newly-created files are owned by the user running
-\fB,\fP
+\fB\%tar\fP,
the file mode is restored for newly-created regular files, and
all other types of entries receive default permissions.
If
-\fBtar\fP
+\fB\%tar\fP
is being run by root, the default is to restore the owner unless the
\fB\-o\fP
option is also specified.
@@ -365,8 +458,8 @@ For every block on disk, check first if it contains only NULL bytes and seek
over it otherwise.
This works similiar to the conv=sparse option of dd.
.TP
-\fB\--strip-components\fP \fIcount\fP (\fB\-W\fP \fBstrip-components\fP=\fIcount\fP)
-(x and t mode only)
+\fB\--strip-components\fP \fIcount\fP
+(x mode only)
Remove the specified number of leading path elements.
Pathnames with fewer elements will be silently skipped.
Note that the pathname is edited after checking inclusion/exclusion patterns
@@ -375,10 +468,20 @@ but before security checks.
\fB\-s\fP \fIpattern\fP
Modify file or archive member names according to
\fIpattern\fP.
-The pattern has the format /old/new/[gps].
-old is a basic regular expression.
-If it doesn't apply, the pattern is skipped.
-new is the replacement string of the matched part.
+The pattern has the format
+\fI/old/new/\fP [gps]
+where
+\fIold\fP
+is a basic regular expression,
+\fInew\fP
+is the replacement string of the matched part,
+and the optional trailing letters modify
+how the replacement is handled.
+If
+\fIold\fP
+is not matched, the pattern is skipped.
+Within
+\fInew\fP,
~ is substituted with the match, \1 to \9 with the content of
the corresponding captured group.
The optional trailing g specifies that matching should continue
@@ -391,11 +494,11 @@ standard error.
.TP
\fB\-T\fP \fIfilename\fP
In x or t mode,
-\fBtar\fP
+\fB\%tar\fP
will read the list of names to be extracted from
\fIfilename\fP.
In c mode,
-\fBtar\fP
+\fB\%tar\fP
will read names to be archived from
\fIfilename\fP.
The special name
@@ -414,7 +517,7 @@ also disables the special handling of lines containing
(x mode only)
Unlink files before creating them.
Without this option,
-\fBtar\fP
+\fB\%tar\fP
overwrites existing files, which preserves existing hardlinks.
With this option, existing hardlinks will be broken, as will any
symlink that would affect the location of an extracted file.
@@ -427,27 +530,23 @@ instead of using the builtin compression support.
\fB\-v\fP
Produce verbose output.
In create and extract modes,
-\fBtar\fP
+\fB\%tar\fP
will list each file name as it is read from or written to
the archive.
In list mode,
-\fBtar\fP
+\fB\%tar\fP
will produce output similar to that of
\fBls\fP(1).
Additional
\fB\-v\fP
options will provide additional detail.
.TP
-\fB\-W\fP \fIlongopt=value\fP
-Long options (preceded by
-\fB\--\fP)
-are only supported directly on systems that have the
-\fBgetopt_long\fP(3)
-function.
-The
-\fB\-W\fP
-option can be used to access long options on systems that
-do not support this function.
+\fB\--version\fP
+Print version of
+\fB\%tar\fP
+and
+\fB\%libarchive\fP,
+and exit.
.TP
\fB\-w\fP
Ask for confirmation for every action.
@@ -464,7 +563,7 @@ Compress the resulting archive with
\fBbzip2\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-\fBtar\fP
+\fB\%tar\fP
implementations, this implementation recognizes bzip2 compression
automatically when reading archives.
.TP
@@ -474,7 +573,7 @@ Compress the resulting archive with
\fBgzip\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-\fBtar\fP
+\fB\%tar\fP
implementations, this implementation recognizes gzip compression
automatically when reading archives.
.TP
@@ -484,12 +583,15 @@ Compress the resulting archive with
\fBcompress\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-\fBtar\fP
+\fB\%tar\fP
implementations, this implementation recognizes compress compression
automatically when reading archives.
+.RE
.SH ENVIRONMENT
+.ad l
The following environment variables affect the execution of
-\fB:\fP
+\fB\%tar\fP:
+.RS 5
.TP
.B LANG
The locale to use.
@@ -508,7 +610,10 @@ The timezone to use when displaying dates.
See
\fBenviron\fP(7)
for more information.
+.RE
.SH FILES
+.ad l
+.RS 5
.TP
.B /dev/sa0
The default tape device, if not overridden by the
@@ -516,9 +621,12 @@ The default tape device, if not overridden by the
environment variable or the
\fB\-f\fP
option.
+.RE
.SH EXIT STATUS
+.ad l
The \fBtar\fP utility exits 0 on success, and >0 if an error occurs.
.SH EXAMPLES
+.ad l
The following creates a new archive
called
\fIfile.tar.gz\fP
@@ -526,45 +634,50 @@ that contains two files
\fIsource.c\fP
and
\fIsource.h\fP:
-.RS
-\fBtar\fP \fB\-czf\fP \fIfile.tar.gz\fP \fIsource.c\fP \fIsource.h\fP
+.RS 4
+\fB\%tar\fP \fB\-czf\fP \fIfile.tar.gz\fP \fIsource.c\fP \fIsource.h\fP
.RE
+.PP
To view a detailed table of contents for this
archive:
-.RS
-\fBtar\fP \fB\-tvf\fP \fIfile.tar.gz\fP
+.RS 4
+\fB\%tar\fP \fB\-tvf\fP \fIfile.tar.gz\fP
.RE
+.PP
To extract all entries from the archive on
the default tape drive:
-.RS
-\fBtar\fP \fB\-x\fP
+.RS 4
+\fB\%tar\fP \fB\-x\fP
.RE
+.PP
To examine the contents of an ISO 9660 cdrom image:
-.RS
-\fBtar\fP \fB\-tf\fP \fIimage.iso\fP
+.RS 4
+\fB\%tar\fP \fB\-tf\fP \fIimage.iso\fP
.RE
+.PP
To move file hierarchies, invoke
-\fBtar\fP
+\fB\%tar\fP
as
-.RS
-\fBtar\fP \fB\-cf\fP \fI-\fP \fB\-C\fP \fIsrcdir\\fP. | \fBtar\fP \fB\-xpf\fP \fI-\fP \fB\-C\fP \fIdestdir\fP
+.RS 4
+\fB\%tar\fP \fB\-cf\fP \fI-\fP \fB\-C\fP \fIsrcdir\\fP. | \fB\%tar\fP \fB\-xpf\fP \fI-\fP \fB\-C\fP \fIdestdir\fP
.RE
or more traditionally
-.RS
-cd srcdir \&; \fBtar\fP \fB\-cf\fP \fI-\\fP. | (cd destdir \&; \fBtar\fP \fB\-xpf\fP \fI-\fP)
+.RS 4
+cd srcdir \&; \fB\%tar\fP \fB\-cf\fP \fI-\\fP. | (cd destdir \&; \fB\%tar\fP \fB\-xpf\fP \fI-\fP)
.RE
+.PP
In create mode, the list of files and directories to be archived
can also include directory change instructions of the form
\fB-C\fP \fIfoo/baz\fP
and archive inclusions of the form
\fB@\fP \fIarchive-file\fP.
For example, the command line
-.RS
-\fBtar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fIfoo1\fP \fB@\fP \fIold.tgz\fP \fB-C\fP \fI/tmp\fP \fIfoo2\fP
+.RS 4
+\fB\%tar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fIfoo1\fP \fB@\fP \fIold.tgz\fP \fB-C\fP \fI/tmp\fP \fIfoo2\fP
.RE
will create a new archive
\fInew.tar\fP.
-\fBtar\fP
+\fB\%tar\fP
will read the file
\fIfoo1\fP
from the current directory and add it to the output archive.
@@ -576,22 +689,28 @@ Finally, it will switch to the
directory and add
\fIfoo2\fP
to the output archive.
+.PP
An input file in
\fBmtree\fP(5)
format can be used to create an output archive with arbitrary ownership,
permissions, or names that differ from existing data on disk:
-.RS
+.PP
+.RS 4
$ cat input.mtree
.RE
-.RS
+.RS 4
+#mtree
+.RE
+.RS 4
usr/bin uid=0 gid=0 mode=0755 type=dir
.RE
-.RS
+.RS 4
usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
.RE
-.RS
+.RS 4
$ tar -cvf output.tar @input.mtree
.RE
+.PP
The
\fB\--newer\fP
and
@@ -602,7 +721,33 @@ switches accept a variety of common date and time specifications, including
``5 minutes ago'',
and
``19:14 PST May 1''.
+.PP
+The
+\fB\--options\fP
+argument can be used to control various details of archive generation
+or reading.
+For example, you can generate mtree output which only contains
+\fBtype\fP, \fBtime\fP,
+and
+\fBuid\fP
+keywords:
+.RS 4
+\fB\%tar\fP \fB\-cf\fP \fIfile.tar\fP \fB\--format=mtree\fP \fB\--options='!all,type,time,uid'\fP \fIdir\fP
+.RE
+or you can set the compression level used by gzip or xz compression:
+.RS 4
+\fB\%tar\fP \fB\-czf\fP \fIfile.tar\fP \fB\--options='compression-level=9'\fP.
+.RE
+For more details, see the explanation of the
+\fB\%archive_read_set_options\fP()
+and
+\fB\%archive_write_set_options\fP()
+API calls that are described in
+\fBarchive_read\fP(3)
+and
+\fBarchive_write\fP(3).
.SH COMPATIBILITY
+.ad l
The bundled-arguments format is supported for compatibility
with historic implementations.
It consists of an initial word (with no leading - character) in which
@@ -611,8 +756,8 @@ Arguments follow as separate words.
The order of the arguments must match the order
of the corresponding characters in the bundled command word.
For example,
-.RS
-\fBtar\fP \fBtbf\fP 32 \fIfile.tar\fP
+.RS 4
+\fB\%tar\fP \fBtbf\fP 32 \fIfile.tar\fP
.RE
specifies three flags
\fBt\fP,
@@ -635,10 +780,12 @@ flag, and
is the argument to the
\fBf\fP
flag.
+.PP
The mode options c, r, t, u, and x and the options
b, f, l, m, o, v, and w comply with SUSv2.
+.PP
For maximum portability, scripts that invoke
-\fBtar\fP
+\fB\%tar\fP
should use the bundled-argument format above, should limit
themselves to the
\fBc\fP,
@@ -653,13 +800,15 @@ modes, and the
and
\fBw\fP
options.
-On systems that support getopt_long(), additional long options
-are available to improve compatibility with other tar implementations.
+.PP
+Additional long options are provided to improve compatibility with other
+tar implementations.
.SH SECURITY
+.ad l
Certain security issues are common to many archiving programs, including
-\fB.\fP
+\fB\%tar\fP.
In particular, carefully-crafted archives can request that
-\fBtar\fP
+\fB\%tar\fP
extract files to locations outside of the target directory.
This can potentially be used to cause unwitting users to overwrite
files they did not intend to overwrite.
@@ -667,13 +816,14 @@ If the archive is being extracted by the superuser, any file
on the system can potentially be overwritten.
There are three ways this can happen.
Although
-\fBtar\fP
+\fB\%tar\fP
has mechanisms to protect against each one,
savvy users should be aware of the implications:
+.RS 5
.IP \(bu
Archive entries can have absolute pathnames.
By default,
-\fBtar\fP
+\fB\%tar\fP
removes the leading
\fI/\fP
character from filenames before restoring them to guard against this problem.
@@ -682,7 +832,7 @@ Archive entries can have pathnames that include
\fI\& ..\fP
components.
By default,
-\fBtar\fP
+\fB\%tar\fP
will not extract files containing
\fI\& ..\fP
components in their pathname.
@@ -692,7 +842,7 @@ files to other directories.
An archive can restore a symbolic link to another directory,
then use that link to restore a file into that directory.
To guard against this,
-\fBtar\fP
+\fB\%tar\fP
checks each extracted path for symlinks.
If the final path element is a symlink, it will be removed
and replaced with the archive entry.
@@ -704,19 +854,20 @@ If neither
nor
\fB\-P\fP
is specified,
-\fBtar\fP
+\fB\%tar\fP
will refuse to extract the entry.
+.RE
To protect yourself, you should be wary of any archives that
come from untrusted sources.
You should examine the contents of an archive with
-.RS
-\fBtar\fP \fB\-tf\fP \fIfilename\fP
+.RS 4
+\fB\%tar\fP \fB\-tf\fP \fIfilename\fP
.RE
before extraction.
You should use the
\fB\-k\fP
option to ensure that
-\fBtar\fP
+\fB\%tar\fP
will not overwrite any existing files or the
\fB\-U\fP
option to remove any pre-existing files.
@@ -725,12 +876,13 @@ privileges.
Note that the
\fB\-P\fP
option to
-\fBtar\fP
+\fB\%tar\fP
disables the security checks above and allows you to extract
an archive while preserving any absolute pathnames,
\fI\& ..\fP
components, or symlinks to other directories.
.SH SEE ALSO
+.ad l
\fBbzip2\fP(1),
\fBcompress\fP(1),
\fBcpio\fP(1),
@@ -742,6 +894,7 @@ components, or symlinks to other directories.
\fBlibarchive-formats\fP(5),
\fBtar\fP(5)
.SH STANDARDS
+.ad l
There is no current POSIX standard for the tar command; it appeared
in
ISO/IEC 9945-1:1996 (``POSIX.1'')
@@ -750,17 +903,19 @@ IEEE Std 1003.1-2001 (``POSIX.1'').
The options used by this implementation were developed by surveying a
number of existing tar implementations as well as the old POSIX specification
for tar and the current POSIX specification for pax.
+.PP
The ustar and pax interchange file formats are defined by
IEEE Std 1003.1-2001 (``POSIX.1'')
for the pax command.
.SH HISTORY
+.ad l
A
-\fBtar\fP
+\fB\%tar\fP
command appeared in Seventh Edition Unix, which was released in January, 1979.
There have been numerous other implementations,
many of which extended the file format.
John Gilmore's
-\fBpdtar\fP
+\fB\%pdtar\fP
public-domain implementation (circa November, 1987)
was quite influential, and formed the basis of GNU tar.
GNU tar was included as the standard system tar
@@ -768,10 +923,12 @@ in
FreeBSD
beginning with
FreeBSD 1.0.
+.PP
This is a complete re-implementation based on the
\fBlibarchive\fP(3)
library.
.SH BUGS
+.ad l
This program follows
ISO/IEC 9945-1:1996 (``POSIX.1'')
for the definition of the
@@ -782,9 +939,11 @@ Note that GNU tar prior to version 1.15 treated
as a synonym for the
\fB\--one-file-system\fP
option.
+.PP
The
\fB\-C\fP \fIdir\fP
option may differ from historic implementations.
+.PP
All archive output is written in correctly-sized blocks, even
if the output is being compressed.
Whether or not the last output block is padded to a full
@@ -801,20 +960,23 @@ Many compressors, including
and
\fBbzip2\fP(1),
complain about the null padding when decompressing an archive created by
-\fB,\fP
+\fB\%tar\fP,
although they still extract it correctly.
+.PP
The compression and decompression is implemented internally, so
there may be insignificant differences between the compressed output
generated by
-.RS
-\fBtar\fP \fB\-czf\fP \fI-\fP file
+.RS 4
+\fB\%tar\fP \fB\-czf\fP \fI-\fP file
.RE
and that generated by
-.RS
-\fBtar\fP \fB\-cf\fP \fI-\fP file | \fBtar\fP gzip
+.RS 4
+\fB\%tar\fP \fB\-cf\fP \fI-\fP file | \fB\%gzip\fP
.RE
+.PP
The default should be to read and write archives to the standard I/O paths,
but tradition (and POSIX) dictates otherwise.
+.PP
The
\fBr\fP
and
@@ -826,6 +988,7 @@ Other archives can be modified using
mode with the
\fI@archive-file\fP
extension.
+.PP
To archive a file called
\fI@foo\fP
or
@@ -835,6 +998,7 @@ you must specify it as
or
\fI\& ./-foo\fP,
respectively.
+.PP
In create mode, a leading
\fI\& ./\fP
is always removed.
@@ -843,14 +1007,18 @@ A leading
is stripped unless the
\fB\-P\fP
option is specified.
+.PP
There needs to be better support for file selection on both create
and extract.
+.PP
There is not yet any support for multi-volume archives or for archiving
sparse files.
+.PP
Converting between dissimilar archive formats (such as tar and cpio) using the
\fB@\fP \fI-\fP
convention can cause hard link information to be lost.
(This is a consequence of the incompatible ways that different archive
formats store hardlink information.)
+.PP
There are alternative long options for many of the short options that
are deliberately not documented.
diff --git a/archivers/libarchive/files/doc/man/cpio.5 b/archivers/libarchive/files/doc/man/cpio.5
index e389f71e119..922df018ff9 100644
--- a/archivers/libarchive/files/doc/man/cpio.5
+++ b/archivers/libarchive/files/doc/man/cpio.5
@@ -1,16 +1,18 @@
.TH CPIO 5 "October 5, 2007" ""
.SH NAME
-\fBcpio\fP
+.ad l
+\fB\%cpio\fP
\- format of cpio archive files
.SH DESCRIPTION
+.ad l
The
-\fBcpio\fP
+\fB\%cpio\fP
archive format collects any number of files, directories, and other
file system objects (symbolic links, device nodes, etc.) into a single
stream of bytes.
.SS General Format
Each file system object in a
-\fBcpio\fP
+\fB\%cpio\fP
archive comprises a header record with basic numeric metadata
followed by the full pathname of the entry and the file data.
The header record stores a series of integer values that generally
@@ -31,10 +33,11 @@ the pathname
XXX Any documentation of the original PWB/UNIX 1.0 format? XXX
.SS Old Binary Format
The old binary
-\fBcpio\fP
+\fB\%cpio\fP
format stores numbers as 2-byte and 4-byte binary values.
Each entry begins with a header in the following format:
-.RS
+.RS 4
+.nf
struct header_old_cpio {
unsigned short c_magic;
unsigned short c_dev;
@@ -49,12 +52,14 @@ struct header_old_cpio {
unsigned short c_filesize[2];
};
.RE
+.PP
The
\fIunsigned\fP short
fields here are 16-bit integer values; the
\fIunsigned\fP int
fields are 32-bit integer values.
The fields are as follows
+.RS 5
.TP
\fImagic\fP
The integer value octal 070707.
@@ -64,15 +69,16 @@ written with little-endian or big-endian integers.
\fIdev\fP, \fIino\fP
The device and inode numbers from the disk.
These are used by programs that read
-\fBcpio\fP
+\fB\%cpio\fP
archives to determine when two entries refer to the same file.
Programs that synthesize
-\fBcpio\fP
+\fB\%cpio\fP
archives should be careful to set these to distinct values for each entry.
.TP
\fImode\fP
The mode specifies both the regular permissions and the file type.
It consists of several bit fields as follows:
+.RS 5
.TP
0170000
This masks the file type bits.
@@ -112,6 +118,7 @@ On some systems, this modifies the behavior of executables and/or directories.
0000777
The lower 9 bits specify read/write/execute permissions
for world, group, and user following standard POSIX conventions.
+.RE
.TP
\fIuid\fP, \fIgid\fP
The numeric user id and group id of the owner.
@@ -146,12 +153,15 @@ four gigabyte file sizes.
See
\fImtime\fP
above for a description of the storage of four-byte integers.
+.RE
+.PP
The pathname immediately follows the fixed header.
If the
\fBnamesize\fP
is odd, an additional NUL byte is added after the pathname.
The file data is then appended, padded with NUL
bytes to an even length.
+.PP
Hardlinked files are not given special treatment;
the full file contents are included with each copy of the
file.
@@ -166,7 +176,8 @@ format or as the
format.
It stores the same numeric fields as the old binary format, but
represents them as 6-character or 11-character octal values.
-.RS
+.RS 4
+.nf
struct cpio_odc_header {
char c_magic[6];
char c_dev[6];
@@ -181,6 +192,7 @@ struct cpio_odc_header {
char c_filesize[11];
};
.RE
+.PP
The fields are identical to those in the old binary format.
The name and file body follow the fixed header.
Unlike the old binary format, there is no additional padding
@@ -192,7 +204,8 @@ NUL byte that terminates the name field.
The "new" ASCII format uses 8-byte hexadecimal fields for
all numbers and separates device numbers into separate fields
for major and minor numbers.
-.RS
+.RS 4
+.nf
struct cpio_newc_header {
char c_magic[6];
char c_ino[8];
@@ -210,8 +223,10 @@ struct cpio_newc_header {
char c_check[8];
};
.RE
+.PP
Except as specified below, the fields here match those specified
for the old binary format above.
+.RS 5
.TP
\fImagic\fP
The string
@@ -220,11 +235,14 @@ The string
\fIcheck\fP
This field is always set to zero by writers and ignored by readers.
See the next section for more details.
+.RE
+.PP
The pathname is followed by NUL bytes so that the total size
of the fixed header plus pathname is a multiple of four.
Likewise, the file data is padded to a multiple of four bytes.
Note that this format supports only 4 gigabyte files (unlike the
older ASCII format, which supports 8 gigabyte files).
+.PP
In this format, hardlinked files are handled by setting the
filesize to zero for each entry except the last one that
appears in the archive.
@@ -241,40 +259,49 @@ and using unsigned arithmetic.
Only the least-significant 32 bits of the sum are stored.
.SS HP variants
The
-\fBcpio\fP
+\fB\%cpio\fP
implementation distributed with HPUX used XXXX but stored
device numbers differently XXX.
.SS Other Extensions and Variants
Sun Solaris uses additional file types to store extended file
data, including ACLs and extended attributes, as special
entries in cpio archives.
+.PP
XXX Others? XXX
.SH BUGS
+.ad l
The
``CRC''
format is mis-named, as it uses a simple checksum and
not a cyclic redundancy check.
+.PP
The old binary format is limited to 16 bits for user id,
group id, device, and inode numbers.
It is limited to 4 gigabyte file sizes.
+.PP
The old ASCII format is limited to 18 bits for
the user id, group id, device, and inode numbers.
It is limited to 8 gigabyte file sizes.
+.PP
The new ASCII format is limited to 4 gigabyte file sizes.
+.PP
None of the cpio formats store user or group names,
which are essential when moving files between systems with
dissimilar user or group numbering.
+.PP
Especially when writing older cpio variants, it may be necessary
to map actual device/inode values to synthesized values that
fit the available fields.
With very large filesystems, this may be necessary even for
the newer formats.
.SH SEE ALSO
+.ad l
\fBcpio\fP(1),
\fBtar\fP(5)
.SH STANDARDS
+.ad l
The
-\fBcpio\fP
+\fB\%cpio\fP
utility is no longer a part of POSIX or the Single Unix Standard.
It last appeared in
Version 2 of the Single UNIX Specification (``SUSv2'').
@@ -284,6 +311,7 @@ The portable ASCII format is currently part of the specification for the
\fBpax\fP(1)
utility.
.SH HISTORY
+.ad l
The original cpio utility was written by Dick Haight
while working in AT&T's Unix Support Group.
It appeared in 1977 as part of PWB/UNIX 1.0, the
diff --git a/archivers/libarchive/files/doc/man/libarchive-formats.5 b/archivers/libarchive/files/doc/man/libarchive-formats.5
index 580aaeaa071..ff87c8ba860 100644
--- a/archivers/libarchive/files/doc/man/libarchive-formats.5
+++ b/archivers/libarchive/files/doc/man/libarchive-formats.5
@@ -1,8 +1,10 @@
-.TH libarchive-formats 3 "April 27, 2004" ""
+.TH libarchive-formats 5 "December 27, 2009" ""
.SH NAME
-\fBlibarchive-formats\fP
+.ad l
+\fB\%libarchive-formats\fP
\- archive formats supported by the libarchive library
.SH DESCRIPTION
+.ad l
The
\fBlibarchive\fP(3)
library reads and writes a variety of streaming archive formats.
@@ -10,13 +12,15 @@ Generally speaking, all of these archive formats consist of a series of
``entries''.
Each entry stores a single file system object, such as a file, directory,
or symbolic link.
+.PP
The following provides a brief description of each format supported
by libarchive, with some information about recognized extensions or
limitations of the current library support.
Note that just because a format is supported by libarchive does not
imply that a program that uses libarchive will support that format.
Applications that use libarchive specify which formats they wish
-to support.
+to support, though many programs do use libarchive convenience
+functions to enable all supported formats.
.SS Tar Formats
The
\fBlibarchive\fP(3)
@@ -26,6 +30,7 @@ However, it only writes POSIX-standard
and
``pax interchange''
formats.
+.PP
All tar formats store each entry in one or more 512-byte records.
The first record is used for file metadata, including filename,
timestamp, and mode information, and the file data is stored in
@@ -34,6 +39,8 @@ Later variants have extended this by either appropriating undefined
areas of the header record, extending the header to multiple records,
or by storing special entries that modify the interpretation of
subsequent entries.
+.PP
+.RS 5
.TP
\fBgnutar\fP
The
@@ -53,8 +60,8 @@ library can read and write POSIX-compliant pax interchange format
archives.
Pax interchange format archives are an extension of the older ustar
format that adds a separate entry with additional attributes stored
-as key/value pairs.
-The presence of this additional entry is the only difference between
+as key/value pairs immediately before each regular entry.
+The presence of these additional entries is the only difference between
pax interchange format and the older ustar format.
The extended attributes are of unlimited length and are stored
as UTF-8 Unicode strings.
@@ -63,8 +70,9 @@ to define custom keys by preceding them with the vendor name in all uppercase.
When writing pax archives, libarchive uses many of the SCHILY keys
defined by Joerg Schilling's
``star''
-archiver.
-The libarchive library can read most of the SCHILY keys.
+archiver and a few LIBARCHIVE keys.
+The libarchive library can read most of the SCHILY keys
+and most of the GNU keys introduced by GNU tar.
It silently ignores any keywords that it does not understand.
.TP
\fBrestricted\fP pax
@@ -87,6 +95,7 @@ directories.
\fBustar\fP
The libarchive library can both read and write this format.
This format has the following limitations:
+.RS 5
.IP \(bu
Device major and minor numbers are limited to 21 bits.
Nodes with larger numbers will not be added to the archive.
@@ -101,13 +110,33 @@ This name is limited to 100 bytes.
Extended attributes, file flags, and other extended
security information cannot be stored.
.IP \(bu
-Archive entries are limited to 2 gigabytes in size.
+Archive entries are limited to 8 gigabytes in size.
+.RE
Note that the pax interchange format has none of these restrictions.
-The libarchive library can also read a variety of commonly-used extensions to
+.RE
+.PP
+The libarchive library also reads a variety of commonly-used extensions to
the basic tar format.
-In particular, it supports base-256 values in certain numeric fields.
-This essentially removes the limitations on file size, modification time,
+These extensions are recognized automatically whenever they appear.
+.RS 5
+.TP
+Numeric extensions.
+The POSIX standards require fixed-length numeric fields to be written with
+some character position reserved for terminators.
+Libarchive allows these fields to be written without terminator characters.
+This extends the allowable range; in particular, ustar archives with this
+extension can support entries up to 64 gigabytes in size.
+Libarchive also recognizes base-256 values in most numeric fields.
+This essentially removes all limitations on file size, modification time,
and device numbers.
+.TP
+Solaris extensions
+Libarchive recognizes ACL and extended attribute records written
+by Solaris tar.
+Currently, libarchive only has support for old-style ACLs; the
+newer NFSv4 ACLs are recognized but discarded.
+.RE
+.PP
The first tar program appeared in Seventh Edition Unix in 1979.
The first official standard for the tar file format was the
``ustar''
@@ -123,21 +152,28 @@ and
format archives.
A cpio archive stores each entry as a fixed-size header followed
by a variable-length filename and variable-length data.
-Unlike tar, cpio does only minimal padding of the header or file data.
-There are a variety of cpio formats, which differ primarily in
+Unlike the tar format, the cpio format does only minimal padding
+of the header or file data.
+There are several cpio variants, which differ primarily in
how they store the initial header: some store the values as
octal or hexadecimal numbers in ASCII, others as binary values of
varying byte order and length.
+.RS 5
.TP
\fBbinary\fP
-The libarchive library can read both big-endian and little-endian
+The libarchive library transparently reads both big-endian and little-endian
variants of the original binary cpio format.
This format used 32-bit binary values for file size and mtime,
and 16-bit binary values for the other fields.
.TP
\fBodc\fP
The libarchive library can both read and write this
-POSIX-standard format.
+POSIX-standard format, which is officially known as the
+``cpio interchange format''
+or the
+``octet-oriented cpio archive format''
+and sometimes unofficially referred to as the
+``old character format''.
This format stores the header contents as octal values in ASCII.
It is standard, portable, and immune from byte-order confusion.
File sizes and mtime are limited to 33 bits (8GB file size),
@@ -152,6 +188,8 @@ This limits file size to 4GB, and also limits the mtime and
other fields to 32 bits.
The SVR4 format can optionally include a CRC of the file
contents, although libarchive does not currently verify this CRC.
+.RE
+.PP
Cpio first appeared in PWB/UNIX 1.0, which was released within
AT&T in 1977.
PWB/UNIX 1.0 formed the basis of System III Unix, released outside
@@ -161,9 +199,9 @@ in Version 7 AT&T Unix.
As a result, the tar command became much better known in universities
and research groups that used Version 7.
The combination of the
-\fBfind\fP
+\fB\%find\fP
and
-\fBcpio\fP
+\fB\%cpio\fP
utilities provided very precise control over file selection.
Unfortunately, the format has many limitations that make it unsuitable
for widespread use.
@@ -178,6 +216,7 @@ A
is a shell script that, when executed on a POSIX-compliant
system, will recreate a collection of file system objects.
The libarchive library can write two different kinds of shar archives:
+.RS 5
.TP
\fBshar\fP
The traditional shar format uses a limited set of POSIX
@@ -200,20 +239,33 @@ It also includes additional shell commands that attempt to reproduce as
many file attributes as possible, including owner, mode, and flags.
The additional commands used to restore file attributes make
shardump archives less portable than plain shar archives.
+.RE
.SS ISO9660 format
Libarchive can read and extract from files containing ISO9660-compliant
CDROM images.
-It also has partial support for Rockridge extensions.
-In many cases, this can remove the need to burn a physical CDROM.
+In many cases, this can remove the need to burn a physical CDROM
+just in order to read the files contained in an ISO9660 image.
It also avoids security and complexity issues that come with
virtual mounts and loopback devices.
+Libarchive supports the most common Rockridge extensions and has partial
+support for Joliet extensions.
+If both extensions are present, the Joliet extensions will be
+used and the Rockridge extensions will be ignored.
+In particular, this can create problems with hardlinks and symlinks,
+which are supported by Rockridge but not by Joliet.
.SS Zip format
-Libarchive can extract from most zip format archives.
-It currently only supports uncompressed entries and entries
-compressed with the
+Libarchive can read and write zip format archives that have
+uncompressed entries and entries compressed with the
``deflate''
algorithm.
Older zip compression algorithms are not supported.
+It can extract jar archives, archives that use Zip64 extensions and many
+self-extracting zip archives.
+Libarchive reads Zip archives as they are being streamed,
+which allows it to read archives of arbitrary size.
+It currently does not use the central directory; this
+limits libarchive's ability to support some self-extracting
+archives and ones that have been modified in certain ways.
.SS Archive (library) file format
The Unix archive format (commonly created by the
\fBar\fP(1)
@@ -225,16 +277,58 @@ The ar format has never been standardised.
There are two common variants:
the GNU format derived from SVR4,
and the BSD format, which first appeared in 4.4BSD.
-Libarchive provides read and write support for both variants.
+The two differ primarily in their handling of filenames
+longer than 15 characters:
+the GNU/SVR4 variant writes a filename table at the beginning of the archive;
+the BSD format stores each long filename in an extension
+area adjacent to the entry.
+Libarchive can read both extensions,
+including archives that may include both types of long filenames.
+Programs using libarchive can write GNU/SVR4 format
+if they provide a filename table to be written into
+the archive before any of the entries.
+Any entries whose names are not in the filename table
+will be written using BSD-style long filenames.
+This can cause problems for programs such as
+GNU ld that do not support the BSD-style long filenames.
.SS mtree
-Libarchive can read files in
+Libarchive can read and write files in
\fBmtree\fP(5)
-format. This format is not a true archive format, but rather a description
-of a file hierarchy. When requested, libarchive obtains the contents of
-the files described by the
-\fBmtree\fP(5)
-format from files on disk instead.
+format.
+This format is not a true archive format, but rather a textual description
+of a file hierarchy in which each line specifies the name of a file and
+provides specific metadata about that file.
+Libarchive can read all of the keywords supported by both
+the NetBSD and FreeBSD versions of
+\fBmtree\fP(1),
+although many of the keywords cannot currently be stored in an
+Tn archive_entry
+object.
+When writing, libarchive supports use of the
+\fBarchive_write_set_options\fP(3)
+interface to specify which keywords should be included in the
+output.
+If libarchive was compiled with access to suitable
+cryptographic libraries (such as the OpenSSL libraries),
+it can compute hash entries such as
+\fBsha512\fP
+or
+\fBmd5\fP
+from file data being written to the mtree writer.
+.PP
+When reading an mtree file, libarchive will locate the corresponding
+files on disk using the
+\fBcontents\fP
+keyword if present or the regular filename.
+If it can locate and open the file on disk, it will use that
+to fill in any metadata that is missing from the mtree file
+and will read the file contents and return those to the program
+using libarchive.
+If it cannot locate and open the file on disk, libarchive
+will return an error for any attempt to read the entry
+body.
.SH SEE ALSO
+.ad l
\fBar\fP(1),
\fBcpio\fP(1),
\fBmkisofs\fP(1),
diff --git a/archivers/libarchive/files/doc/man/libarchive.3 b/archivers/libarchive/files/doc/man/libarchive.3
index 722b765e78e..1af1861fcae 100644
--- a/archivers/libarchive/files/doc/man/libarchive.3
+++ b/archivers/libarchive/files/doc/man/libarchive.3
@@ -1,21 +1,26 @@
.TH LIBARCHIVE 3 "August 19, 2006" ""
.SH NAME
-\fBlibarchive\fP
+.ad l
+\fB\%libarchive\fP
\- functions for reading and writing streaming archives
.SH LIBRARY
+.ad l
Lb libarchive
.SH OVERVIEW
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library provides a flexible interface for reading and writing
streaming archive files such as tar and cpio.
The library is inherently stream-oriented; readers serially iterate through
the archive, writers serially add things to the archive.
In particular, note that there is no built-in support for
random access nor for in-place modification.
+.PP
When reading an archive, the library automatically detects the
format and the compression.
The library currently has read support for:
+.RS 5
.IP \(bu
old-style tar archives,
.IP \(bu
@@ -34,15 +39,18 @@ most common cpio archive formats,
ISO9660 CD images (with or without RockRidge extensions),
.IP \(bu
Zip archives.
+.RE
The library automatically detects archives compressed with
\fBgzip\fP(1),
\fBbzip2\fP(1),
or
\fBcompress\fP(1)
and decompresses them transparently.
+.PP
When writing an archive, you can specify the compression
to be used and the format to use.
The library can write
+.RS 5
.IP \(bu
POSIX-standard
``ustar''
@@ -55,6 +63,7 @@ archives,
POSIX octet-oriented cpio archives,
.IP \(bu
two different variants of shar archives.
+.RE
Pax interchange format is an extension of the tar archive format that
eliminates essentially all of the limitations of historic tar formats
in a standard fashion that is supported
@@ -65,47 +74,32 @@ implementations on many systems as well as several newer implementations of
Note that the default write format will suppress the pax extended
attributes for most entries; explicitly requesting pax format will
enable those attributes for all entries.
+.PP
The read and write APIs are accessed through the
-.nh
-\fBarchive_read_XXX\fP
-.hy
-();
+\fB\%archive_read_XXX\fP()
functions and the
-.nh
-\fBarchive_write_XXX\fP
-.hy
-();
+\fB\%archive_write_XXX\fP()
functions, respectively, and either can be used independently
of the other.
+.PP
The rest of this manual page provides an overview of the library
operation.
More detailed information can be found in the individual manual
pages for each API or utility function.
.SH READING AN ARCHIVE
+.ad l
To read an archive, you must first obtain an initialized
Tn struct archive
object from
-.nh
-\fBarchive_read_new\fP
-.hy
-(.);
+\fB\%archive_read_new\fP().
You can then modify this object for the desired operations with the
various
-.nh
-\fBarchive_read_set_XXX\fP
-.hy
-();
+\fB\%archive_read_set_XXX\fP()
and
-.nh
-\fBarchive_read_support_XXX\fP
-.hy
-();
+\fB\%archive_read_support_XXX\fP()
functions.
In particular, you will need to invoke appropriate
-.nh
-\fBarchive_read_support_XXX\fP
-.hy
-();
+\fB\%archive_read_support_XXX\fP()
functions to enable the corresponding compression and format
support.
Note that these latter functions perform two distinct operations:
@@ -113,125 +107,85 @@ they cause the corresponding support code to be linked into your
program, and they enable the corresponding auto-detect code.
Unless you have specific constraints, you will generally want
to invoke
-.nh
-\fBarchive_read_support_compression_all\fP
-.hy
-();
+\fB\%archive_read_support_compression_all\fP()
and
-.nh
-\fBarchive_read_support_format_all\fP
-.hy
-();
+\fB\%archive_read_support_format_all\fP()
to enable auto-detect for all formats and compression types
currently supported by the library.
+.PP
Once you have prepared the
Tn struct archive
object, you call
-.nh
-\fBarchive_read_open\fP
-.hy
-();
+\fB\%archive_read_open\fP()
to actually open the archive and prepare it for reading.
There are several variants of this function;
the most basic expects you to provide pointers to several
functions that can provide blocks of bytes from the archive.
There are convenience forms that allow you to
specify a filename, file descriptor,
-\fI"FILE *"\fP
-.RE
+\fIFILE *\fP
object, or a block of memory from which to read the archive data.
Note that the core library makes no assumptions about the
size of the blocks read;
callback functions are free to read whatever block size is
most appropriate for the medium.
+.PP
Each archive entry consists of a header followed by a certain
amount of data.
You can obtain the next header with
-.nh
-\fBarchive_read_next_header\fP
-.hy
-(,);
+\fB\%archive_read_next_header\fP(),
which returns a pointer to an
Tn struct archive_entry
structure with information about the current archive element.
If the entry is a regular file, then the header will be followed
by the file data.
You can use
-.nh
-\fBarchive_read_data\fP
-.hy
-();
+\fB\%archive_read_data\fP()
(which works much like the
\fBread\fP(2)
system call)
to read this data from the archive.
You may prefer to use the higher-level
-.nh
-\fBarchive_read_data_skip\fP
-.hy
-(,);
+\fB\%archive_read_data_skip\fP(),
which reads and discards the data for this entry,
-.nh
-\fBarchive_read_data_to_buffer\fP
-.hy
-(,);
+\fB\%archive_read_data_to_buffer\fP(),
which reads the data into an in-memory buffer,
-.nh
-\fBarchive_read_data_to_file\fP
-.hy
-(,);
+\fB\%archive_read_data_to_file\fP(),
which copies the data to the provided file descriptor, or
-.nh
-\fBarchive_read_extract\fP
-.hy
-(,);
+\fB\%archive_read_extract\fP(),
which recreates the specified entry on disk and copies data
from the archive.
In particular, note that
-.nh
-\fBarchive_read_extract\fP
-.hy
-();
+\fB\%archive_read_extract\fP()
uses the
Tn struct archive_entry
structure that you provide it, which may differ from the
entry just read from the archive.
In particular, many applications will want to override the
pathname, file permissions, or ownership.
+.PP
Once you have finished reading data from the archive, you
should call
-.nh
-\fBarchive_read_close\fP
-.hy
-();
+\fB\%archive_read_close\fP()
to close the archive, then call
-.nh
-\fBarchive_read_finish\fP
-.hy
-();
+\fB\%archive_read_finish\fP()
to release all resources, including all memory allocated by the library.
+.PP
The
\fBarchive_read\fP(3)
manual page provides more detailed calling information for this API.
.SH WRITING AN ARCHIVE
+.ad l
You use a similar process to write an archive.
The
-.nh
-\fBarchive_write_new\fP
-.hy
-();
+\fB\%archive_write_new\fP()
function creates an archive object useful for writing,
the various
-.nh
-\fBarchive_write_set_XXX\fP
-.hy
-();
+\fB\%archive_write_set_XXX\fP()
functions are used to set parameters for writing the archive, and
-.nh
-\fBarchive_write_open\fP
-.hy
-();
+\fB\%archive_write_open\fP()
completes the setup and opens the archive for writing.
+.PP
Individual archive entries are written in a three-step
process:
You first initialize a
@@ -246,38 +200,35 @@ field, which specifies the type of object and
\fIst_size\fP
field, which specifies the size of the data portion of the object.
The
-.nh
-\fBarchive_write_header\fP
-.hy
-();
+\fB\%archive_write_header\fP()
function actually writes the header data to the archive.
You can then use
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+\fB\%archive_write_data\fP()
to write the actual data.
+.PP
After all entries have been written, use the
-.nh
-\fBarchive_write_finish\fP
-.hy
-();
+\fB\%archive_write_finish\fP()
function to release all resources.
+.PP
The
\fBarchive_write\fP(3)
manual page provides more detailed calling information for this API.
.SH DESCRIPTION
+.ad l
Detailed descriptions of each function are provided by the
corresponding manual pages.
+.PP
All of the functions utilize an opaque
Tn struct archive
datatype that provides access to the archive contents.
+.PP
The
Tn struct archive_entry
structure contains a complete description of a single archive
entry.
It uses an opaque interface that is fully documented in
\fBarchive_entry\fP(3).
+.PP
Users familiar with historic formats should be aware that the newer
variants have eliminated most restrictions on the length of textual fields.
Clients should not assume that filenames, link names, user names, or
@@ -286,6 +237,7 @@ In particular, pax interchange format can easily accommodate pathnames
in arbitrary character sets that exceed
\fIPATH_MAX\fP.
.SH RETURN VALUES
+.ad l
Most functions return zero on success, non-zero on error.
The return value indicates the general severity of the error, ranging
from
@@ -296,57 +248,37 @@ to the user, to
which indicates a serious problem that will prevent any further
operations on this archive.
On error, the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
function can be used to retrieve a numeric error code (see
\fBerrno\fP(2)).
The
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
returns a textual error message suitable for display.
-.nh
-\fBarchive_read_new\fP
-.hy
-();
+.PP
+\fB\%archive_read_new\fP()
and
-.nh
-\fBarchive_write_new\fP
-.hy
-();
+\fB\%archive_write_new\fP()
return pointers to an allocated and initialized
Tn struct archive
object.
-.nh
-\fBarchive_read_data\fP
-.hy
-();
+.PP
+\fB\%archive_read_data\fP()
and
-.nh
-\fBarchive_write_data\fP
-.hy
-();
+\fB\%archive_write_data\fP()
return a count of the number of bytes actually read or written.
A value of zero indicates the end of the data for this entry.
A negative value indicates an error, in which case the
-.nh
-\fBarchive_errno\fP
-.hy
-();
+\fB\%archive_errno\fP()
and
-.nh
-\fBarchive_error_string\fP
-.hy
-();
+\fB\%archive_error_string\fP()
functions can be used to obtain more information.
.SH ENVIRONMENT
+.ad l
There are character set conversions within the
\fBarchive_entry\fP(3)
functions that are impacted by the currently-selected locale.
.SH SEE ALSO
+.ad l
\fBtar\fP(1),
\fBarchive_entry\fP(3),
\fBarchive_read\fP(3),
@@ -354,23 +286,27 @@ functions that are impacted by the currently-selected locale.
\fBarchive_write\fP(3),
\fBtar\fP(5)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
.SH BUGS
+.ad l
Some archive formats support information that is not supported by
Tn struct archive_entry.
Such information cannot be fully archived or restored using this library.
This includes, for example, comments, character sets,
or the arbitrary key/value pairs that can appear in
pax interchange format archives.
+.PP
Conversely, of course, not all of the information that can be
stored in an
Tn struct archive_entry
diff --git a/archivers/libarchive/files/doc/man/libarchive_internals.3 b/archivers/libarchive/files/doc/man/libarchive_internals.3
index fae95d8aebf..98b99a3a9ce 100644
--- a/archivers/libarchive/files/doc/man/libarchive_internals.3
+++ b/archivers/libarchive/files/doc/man/libarchive_internals.3
@@ -1,15 +1,18 @@
.TH LIBARCHIVE 3 "April 16, 2007" ""
.SH NAME
-\fBlibarchive_internals\fP
+.ad l
+\fB\%libarchive_internals\fP
\- description of libarchive internal interfaces
.SH OVERVIEW
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library provides a flexible interface for reading and writing
streaming archive files such as tar and cpio.
Internally, it follows a modular layered design that should
make it easy to add new archive and compression formats.
.SH GENERAL ARCHITECTURE
+.ad l
Externally, libarchive exposes most operations through an
opaque, object-style interface.
The
@@ -23,26 +26,29 @@ and write them to disk.
(There are plans to add a facility to read
\fBarchive_entry\fP(1)
objects from disk as well.)
+.PP
The read and write APIs each have four layers: a public API
layer, a format layer that understands the archive file format,
a compression layer, and an I/O layer.
The I/O layer is completely exposed to clients who can replace
it entirely with their own functions.
+.PP
In order to provide as much consistency as possible for clients,
some public functions are virtualized.
Eventually, it should be possible for clients to open
an archive or disk writer, and then use a single set of
code to select and write entries, regardless of the target.
.SH READ ARCHITECTURE
+.ad l
From the outside, clients use the
\fBarchive_read\fP(3)
API to manipulate an
-\fBarchive\fP
+\fB\%archive\fP
object to read entries and bodies from an archive stream.
Internally, the
-\fBarchive\fP
+\fB\%archive\fP
object is cast to an
-\fBarchive_read\fP
+\fB\%archive_read\fP
object, which holds all read-specific data.
The API has four layers:
The lowest layer is the I/O layer.
@@ -55,7 +61,7 @@ The compression layer calls the I/O layer to
read bytes and decompresses them for the format layer.
The format layer unpacks a stream of uncompressed bytes and
creates
-\fBarchive_entry\fP
+\fB\%archive_entry\fP
objects from the incoming data.
The API layer tracks overall state
(for example, it prevents clients from reading data before reading a header)
@@ -73,17 +79,20 @@ entry, but this design hindered error recovery.)
The read API goes to some lengths to be nice to clients.
As a result, there are few restrictions on the behavior of
the client callbacks.
+.PP
The client read callback is expected to provide a block
of data on each call.
A zero-length return does indicate end of file, but otherwise
blocks may be as small as one byte or as large as the entire file.
In particular, blocks may be of different sizes.
+.PP
The client skip callback returns the number of bytes actually
skipped, which may be much smaller than the skip requested.
The only requirement is that the skip not be larger.
In particular, clients are allowed to return zero for any
skip that they don't want to handle.
The skip callback must never be invoked with a negative value.
+.PP
Keep in mind that not all clients are reading from disk:
clients reading from networks may provide different-sized
blocks on every request and cannot skip at all;
@@ -104,42 +113,31 @@ that much data.
If more data is immediately available, it should return more:
the format layer handles bulk data reads by asking for a minimum
of one byte and then copying as much data as is available.
+.PP
A subsequent call to the
-.nh
-\fBconsume\fP
-.hy
-();
+\fB\%consume\fP()
function advances the read pointer.
Note that data returned from a
-.nh
-\fBread_ahead\fP
-.hy
-();
+\fB\%read_ahead\fP()
call is guaranteed to remain in place until
the next call to
-.nh
-\fBread_ahead\fP
-.hy
-(.);
+\fB\%read_ahead\fP().
Intervening calls to
-.nh
-\fBconsume\fP
-.hy
-();
+\fB\%consume\fP()
should not cause the data to move.
+.PP
Skip requests must always be handled exactly.
Decompression handlers that cannot seek forward should
not register a skip handler;
the API layer fills in a generic skip handler that reads and discards data.
+.PP
A decompression handler has a specific lifecycle:
+.RS 5
.TP
Registration/Configuration
When the client invokes the public support function,
the decompression handler invokes the internal
-.nh
-\fB__archive_read_register_compression\fP
-.hy
-();
+\fB\%__archive_read_register_compression\fP()
function to provide bid and initialization functions.
This function returns
\fBNULL\fP
@@ -159,6 +157,7 @@ element of the
object.
The bid function is otherwise stateless.
In particular, it must not perform any I/O operations.
+.PP
The value returned by the bid function indicates its suitability
for handling this data stream.
A bid of zero will ensure that this decompressor is never invoked.
@@ -209,23 +208,19 @@ slots of the
\fIdecompressor\fP
object.
It should not invoke the client close callback.
+.RE
.SS Format Layer
The read formats have a similar lifecycle to the decompression handlers:
+.RS 5
.TP
Registration
Allocate your private data and initialize your pointers.
.TP
Bid
Formats bid by invoking the
-.nh
-\fBread_ahead\fP
-.hy
-();
+\fB\%read_ahead\fP()
decompression method but not calling the
-.nh
-\fBconsume\fP
-.hy
-();
+\fB\%consume\fP()
method.
This allows each bidder to look ahead in the input stream.
Bidders should not look further ahead than necessary, as long
@@ -265,17 +260,16 @@ The skip data call should skip over all file data and trailing padding.
This is called automatically by the API layer just before each
header read.
It is also called in response to the client calling the public
-.nh
-\fBdata_skip\fP
-.hy
-();
+\fB\%data_skip\fP()
function.
.TP
Cleanup
On cleanup, the format should release all of its allocated memory.
+.RE
.SS API Layer
XXX to do XXX
.SH WRITE ARCHITECTURE
+.ad l
The write API has a similar set of four layers:
an API layer, a format layer, a compression layer, and an I/O layer.
The registration here is much simpler because only
@@ -289,29 +283,32 @@ XXX To be written XXX
.SS API Layer
XXX To be written XXX
.SH WRITE_DISK ARCHITECTURE
+.ad l
The write_disk API is intended to look just like the write API
to clients.
Since it does not handle multiple formats or compression, it
is not layered internally.
.SH GENERAL SERVICES
+.ad l
The
-\fBarchive_read\fP,
-\fBarchive_write\fP,
+\fB\%archive_read\fP,
+\fB\%archive_write\fP,
and
-\fBarchive_write_disk\fP
+\fB\%archive_write_disk\fP
objects all contain an initial
-\fBarchive\fP
+\fB\%archive\fP
object which provides common support for a set of standard services.
(Recall that ANSI/ISO C90 guarantees that you can cast freely between
a pointer to a structure and a pointer to the first element of that
structure.)
The
-\fBarchive\fP
+\fB\%archive\fP
object has a magic value that indicates which API this object
is associated with,
slots for storing error information,
and function pointers for virtualized API functions.
.SH MISCELLANEOUS NOTES
+.ad l
Connecting existing archiving libraries into libarchive is generally
quite difficult.
In particular, many existing libraries strongly assume that you
@@ -319,6 +316,7 @@ are reading from a file; they seek forwards and backwards as necessary
to locate various pieces of information.
In contrast, libarchive never seeks backwards in its input, which
sometimes requires very different approaches.
+.PP
For example, libarchive's ISO9660 support operates very differently
from most ISO9660 readers.
The libarchive support utilizes a work-queue design that
@@ -330,6 +328,7 @@ items are added to the list.
This design relies heavily on the ISO9660 image being optimized so that
directories always occur earlier on the disk than the files they
describe.
+.PP
Depending on the specific format, such approaches may not be possible.
The ZIP format specification, for example, allows archivers to store
key information only at the end of the file.
@@ -339,20 +338,24 @@ Fortunately, such archives are very rare, and libarchive can read
most ZIP archives, though it cannot always extract as much information
as a dedicated ZIP program.
.SH SEE ALSO
+.ad l
\fBarchive\fP(3),
\fBarchive_entry\fP(3),
\fBarchive_read\fP(3),
\fBarchive_write\fP(3),
\fBarchive_write_disk\fP(3)
.SH HISTORY
+.ad l
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
+.ad l
-nosplit
The
-\fBlibarchive\fP
+\fB\%libarchive\fP
library was written by
-Tim Kientzle <kientzle@acm.org.>
+Tim Kientzle \%<kientzle@acm.org.>
.SH BUGS
+.ad l
diff --git a/archivers/libarchive/files/doc/man/mtree.5 b/archivers/libarchive/files/doc/man/mtree.5
index 0f4c255b495..2cf2e3a1191 100644
--- a/archivers/libarchive/files/doc/man/mtree.5
+++ b/archivers/libarchive/files/doc/man/mtree.5
@@ -1,18 +1,21 @@
.TH MTREE 5 "August 20, 2007" ""
.SH NAME
-\fBmtree\fP
+.ad l
+\fB\%mtree\fP
\- format of mtree dir hierarchy files
.SH DESCRIPTION
+.ad l
The
-\fBmtree\fP
+\fB\%mtree\fP
format is a textual format that describes a collection of filesystem objects.
Such files are typically used to create or verify directory hierarchies.
.SS General Format
An
-\fBmtree\fP
+\fB\%mtree\fP
file consists of a series of lines, each providing information
about a single filesystem object.
Leading whitespace is always ignored.
+.PP
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
encoded as a a backslash followed by three
@@ -20,7 +23,9 @@ octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
corresponding character.
+.PP
Each line is interpreted independently as one of the following types:
+.RS 5
.TP
Signature
The first line of any mtree file must begin with
@@ -66,14 +71,17 @@ character after
the first character, it is the pathname of a file relative to the
starting directory.
There can be multiple full entries describing the same file.
+.RE
+.PP
Some tools that process
-\fBmtree\fP
+\fB\%mtree\fP
files may require that multiple lines describing the same file
occur consecutively.
It is not permitted for the same file to be mentioned using
both a relative and a full file specification.
.SS Special commands
Two special commands are currently defined:
+.RS 5
.TP
\fB/set\fP
This command defines default values for one or more keywords.
@@ -88,6 +96,7 @@ This command removes any default value set by a previous
command.
It is followed on the same line by one or more keywords
separated by whitespace.
+.RE
.SS Keywords
After the filename, a full or relative entry consists of zero
or more whitespace-separated keyword definitions.
@@ -96,7 +105,9 @@ list immediately followed by an '=' sign
and a value.
Software programs reading mtree files should warn about
unrecognized keywords.
+.PP
Currently supported keywords are as follows:
+.RS 5
.TP
\fBcksum\fP
The checksum of the file using the default algorithm specified by
@@ -188,6 +199,8 @@ The last modification time of the file.
.TP
\fBtype\fP
The type of the file; may be set to any one of the following:
+.PP
+.RS 5
.TP
\fBblock\fP
block special device
@@ -209,30 +222,36 @@ symbolic link
.TP
\fBsocket\fP
socket
+.RE
.TP
\fBuid\fP
The file owner as a numeric value.
.TP
\fBuname\fP
The file owner as a symbolic name.
+.RE
+.PP
.SH SEE ALSO
+.ad l
\fBcksum\fP(1),
\fBfind\fP(1),
\fBmtree\fP(8)
.SH BUGS
+.ad l
The
FreeBSD
implementation of mtree does not currently support
the
-\fBmtree\fP
+\fB\%mtree\fP
2.0
format.
The requirement for a
``#mtree''
signature line is new and not yet widely implemented.
.SH HISTORY
+.ad l
The
-\fBmtree\fP
+\fB\%mtree\fP
utility appeared in
Bx 4.3 Reno.
The
diff --git a/archivers/libarchive/files/doc/man/tar.5 b/archivers/libarchive/files/doc/man/tar.5
index 4901e2c6c68..ab1995880ee 100644
--- a/archivers/libarchive/files/doc/man/tar.5
+++ b/archivers/libarchive/files/doc/man/tar.5
@@ -1,10 +1,12 @@
-.TH TAR 5 "May 20, 2004" ""
+.TH tar 5 "December 27, 2009" ""
.SH NAME
-\fBtar\fP
+.ad l
+\fB\%tar\fP
\- format of tape archive files
.SH DESCRIPTION
+.ad l
The
-\fBtar\fP
+\fB\%tar\fP
archive format collects any number of files, directories, and other
file system objects (symbolic links, device nodes, etc.) into a single
stream of bytes.
@@ -13,28 +15,32 @@ tape drives that operate with fixed-size blocks, but is widely used as
a general packaging mechanism.
.SS General Format
A
-\fBtar\fP
+\fB\%tar\fP
archive consists of a series of 512-byte records.
Each file system object requires a header record which stores basic metadata
(pathname, owner, permissions, etc.) and zero or more records containing any
file data.
The end of the archive is indicated by two records consisting
entirely of zero bytes.
+.PP
For compatibility with tape drives that use fixed block sizes,
programs that read or write tar files always read or write a fixed
number of records with each I/O operation.
These
``blocks''
are always a multiple of the record size.
-The most common block size\(emand the maximum supported by historic
-implementations\(emis 10240 bytes or 20 records.
+The maximum block size supported by early
+implementations was 10240 bytes or 20 records.
+This is still the default for most implementations
+although block sizes of 1MiB (2048 records) or larger are
+commonly used with modern high-speed tape drives.
(Note: the terms
``block''
and
``record''
here are not entirely standard; this document follows the
convention established by John Gilmore in documenting
-\fBpdtar\fP.)
+\fB\%pdtar\fP.)
.SS Old-Style Archive Format
The original tar archive format has been extended many times to
include additional information that various implementors found
@@ -42,11 +48,13 @@ necessary.
This section describes the variant implemented by the tar command
included in
At v7,
-which is one of the earliest widely-used versions of the tar program.
+which seems to be the earliest widely-used version of the tar program.
+.PP
The header record for an old-style
-\fBtar\fP
+\fB\%tar\fP
archive consists of the following:
-.RS
+.RS 4
+.nf
struct header_old_tar {
char name[100];
char mode[8];
@@ -61,6 +69,7 @@ struct header_old_tar {
};
.RE
All unused bytes in the header record are filled with nulls.
+.RS 5
.TP
\fIname\fP
Pathname, stored as a null-terminated string.
@@ -117,6 +126,8 @@ field holds the first name under which this file appears.
(Note that regular files have a null value in the
\fIlinkflag\fP
field.)
+.RE
+.PP
Early tar implementations varied in how they terminated these fields.
The tar command in
At v7
@@ -135,11 +146,12 @@ fields with leading zeros.
An early draft of
IEEE Std 1003.1-1988 (``POSIX.1'')
served as the basis for John Gilmore's
-\fBpdtar\fP
+\fB\%pdtar\fP
program and many system implementations from the late 1980s
and early 1990s.
These archives generally follow the POSIX ustar
format described below with the following variations:
+.RS 5
.IP \(bu
The magic value is
``ustar\ \&''
@@ -151,6 +163,7 @@ The numeric fields are generally filled with leading spaces
.IP \(bu
The prefix field is often not used, limiting pathnames to
the 100 characters of old-style archives.
+.RE
.SS POSIX ustar Archives
IEEE Std 1003.1-1988 (``POSIX.1'')
defined a standard tar file format to be read and written
@@ -163,7 +176,8 @@ in the header.
(The name is an acronym for
``Unix Standard TAR''.)
It extends the historic format with new fields:
-.RS
+.RS 4
+.nf
struct header_posix_ustar {
char name[100];
char mode[8];
@@ -184,12 +198,14 @@ struct header_posix_ustar {
char pad[12];
};
.RE
+.RS 5
.TP
\fItypeflag\fP
Type of entry.
POSIX extended the earlier
\fIlinkflag\fP
field with several new type values:
+.RS 5
.TP
``0''
Regular file.
@@ -224,6 +240,7 @@ have a valid filename so that they can be restored by readers that do not
support the corresponding extension.
Uppercase letters "A" through "Z" are reserved for custom extensions.
Note that sockets and whiteout entries are not archivable.
+.RE
It is worth noting that the
\fIsize\fP
field, in particular, has different meanings depending on the type.
@@ -256,18 +273,24 @@ the system.
\fIdevmajor\fP, \fIdevminor\fP
Major and minor numbers for character device or block device entry.
.TP
-\fIprefix\fP
-First part of pathname.
+\fIname\fP, \fIprefix\fP
If the pathname is too long to fit in the 100 bytes provided by the standard
format, it can be split at any
\fI/\fP
-character with the first portion going here.
+character with the first portion going into the prefix field.
If the prefix field is not empty, the reader will prepend
the prefix value and a
\fI/\fP
character to the regular name field to obtain the full pathname.
+The standard does not require a trailing
+\fI/\fP
+character on directory names, though most implementations still
+include this for compatibility reasons.
+.RE
+.PP
Note that all unused bytes must be set to
.BR NUL.
+.PP
Field termination is specified slightly differently by POSIX
than by previous implementations.
The
@@ -289,10 +312,11 @@ unless they fill the entire field.
happens to have a
\fI/\fP
as the 156th character.)
-POSIX requires numeric fields to be zero-padded in the front, and allows
+POSIX requires numeric fields to be zero-padded in the front, and requires
them to be terminated with either space or
.BR NUL
characters.
+.PP
Currently, most tar implementations comply with the ustar
format, occasionally extending it by adding new fields to the
blank area at the end of the header record.
@@ -314,6 +338,7 @@ typeflag.
In particular, older implementations that do not fully support these
extensions will extract the metadata into regular files, where the
metadata can be examined as necessary.
+.PP
An entry in a pax interchange format archive consists of one or
two standard ustar entries, each with its own header and data.
The first optional entry stores the extended attributes
@@ -327,7 +352,7 @@ sign, a value string, and a new line.
The decimal number indicates the length of the entire line, including the
initial length field and the trailing newline.
An example of such a field is:
-.RS
+.RS 4
25 ctime=1084839148.1212\en
.RE
Keys in all lowercase are standard keys.
@@ -336,6 +361,7 @@ vendor name and a period.
Note that, unlike the historic header, numeric values are stored using
decimal, not octal.
A description of some common keys follows:
+.RS 5
.TP
\fBatime\fP, \fBctime\fP, \fBmtime\fP
File access, inode change, and modification times.
@@ -365,7 +391,7 @@ archives to store files much larger than the historic 8GB limit.
.TP
\fBSCHILY.*\fP
Vendor-specific attributes used by Joerg Schilling's
-\fBstar\fP
+\fB\%star\fP
implementation.
.TP
\fBSCHILY.acl.access\fP, \fBSCHILY.acl.default\fP
@@ -380,6 +406,13 @@ are temporarily unavailable).
\fBSCHILY.devminor\fP, \fBSCHILY.devmajor\fP
The full minor and major numbers for device nodes.
.TP
+\fBSCHILY.fflags\fP
+The file flags.
+.TP
+\fBSCHILY.realsize\fP
+The full size of the file on disk.
+XXX explain? XXX
+.TP
\fBSCHILY.dev,\fP \fBSCHILY.ino\fP, \fBSCHILY.nlinks\fP
The device number, inode number, and link count for the entry.
In particular, note that a pax interchange format archive using Joerg
@@ -407,6 +440,8 @@ XXX Detail the base-64 format here XXX
.TP
\fBVENDOR.*\fP
XXX document other vendor-specific extensions XXX
+.RE
+.PP
Any values stored in an extended attribute override the corresponding
values in the regular tar header.
Note that compliant readers should ignore the regular fields when they
@@ -419,6 +454,7 @@ All text fields are encoded in UTF8.
Compliant writers should store only portable 7-bit ASCII characters in
the standard ustar header and use extended
attributes whenever a text value contains non-ASCII characters.
+.PP
In addition to the
\fBx\fP
entry described above, the pax interchange format
@@ -432,6 +468,7 @@ defaults for all subsequent archive entries.
The
\fBg\fP
entry is not widely used.
+.PP
Besides the new
\fBx\fP
and
@@ -460,7 +497,8 @@ entry).
As a result, GNU tar archives are not POSIX compatible, although
more lenient POSIX-compliant readers can successfully extract most
GNU tar archives.
-.RS
+.RS 4
+.nf
struct header_gnu_tar {
char name[100];
char mode[8];
@@ -491,17 +529,19 @@ struct header_gnu_tar {
char pad[17];
};
.RE
+.RS 5
.TP
\fItypeflag\fP
GNU tar uses the following special entry types, in addition to
those defined by POSIX:
+.RS 5
.TP
-"7"
+7
GNU tar treats type "7" records identically to type "0" records,
except on one obscure RTOS where they are used to indicate the
pre-allocation of a contiguous file on disk.
.TP
-"D"
+D
This indicates a directory entry.
Unlike the POSIX-standard "5"
typeflag, the header is followed by data records listing the names
@@ -515,18 +555,19 @@ The purpose of this
entry is to support incremental backups; a program restoring from
such an archive may wish to delete files on disk that did not exist
in the directory when the archive was made.
+.PP
Note that the "D" typeflag specifically violates POSIX, which requires
that unrecognized typeflags be restored as normal files.
In this case, restoring the "D" entry as a file could interfere
with subsequent creation of the like-named directory.
.TP
-"K"
+K
The data for this entry is a long linkname for the following regular entry.
.TP
-"L"
+L
The data for this entry is a long pathname for the following regular entry.
.TP
-"M"
+M
This is a continuation of the last file on the previous volume.
GNU multi-volume archives guarantee that each volume begins with a valid
entry header.
@@ -551,11 +592,8 @@ plus
When extracting, GNU tar checks that the header file name is the one it is
expecting, that the header offset is in the correct sequence, and that
the sum of offset and size is equal to realsize.
-FreeBSD's version of GNU tar does not handle the corner case of an
-archive's being continued in the middle of a long name or other
-extension header.
.TP
-"N"
+N
Type "N" records are no longer generated by GNU tar.
They contained a
list of files to be renamed or symlinked after extraction; this was
@@ -567,8 +605,10 @@ or
``Symlink %s to %s\en ;''
in either case, both
filenames are escaped using K&R C syntax.
+Due to security concerns, "N" records are now generally ignored
+when reading archives.
.TP
-"S"
+S
This is a
``sparse''
regular file.
@@ -581,11 +621,12 @@ header extensions (an older format that is no longer used), or
``sparse''
extensions.
.TP
-"V"
+V
The
\fIname\fP
field should be interpreted as a tape/volume header name.
This entry should generally be ignored on extraction.
+.RE
.TP
\fImagic\fP
The magic field holds the five characters
@@ -622,7 +663,8 @@ If this is set to non-zero, the header will be followed by additional
records.
Each such record contains information about as many as 21 additional
sparse blocks as shown here:
-.RS
+.RS 4
+.nf
struct gnu_sparse_header {
struct {
char offset[12];
@@ -643,12 +685,78 @@ In that case, the POSIX size field will indicate the size of this
entry; the
\fIrealsize\fP
field will indicate the total size of the file.
+.RE
+.SS GNU tar pax archives
+GNU tar 1.14 (XXX check this XXX) and later will write
+pax interchange format archives when you specify the
+\fB\--posix\fP
+flag.
+This format uses custom keywords to store sparse file information.
+There have been three iterations of this support, referred to
+as
+``0.0'',
+``0.1'',
+and
+``1.0''.
+.RS 5
+.TP
+\fBGNU.sparse.numblocks\fP, \fBGNU.sparse.offset\fP, \fBGNU.sparse.numbytes\fP, \fBGNU.sparse.size\fP
+The
+``0.0''
+format used an initial
+\fBGNU.sparse.numblocks\fP
+attribute to indicate the number of blocks in the file, a pair of
+\fBGNU.sparse.offset\fP
+and
+\fBGNU.sparse.numbytes\fP
+to indicate the offset and size of each block,
+and a single
+\fBGNU.sparse.size\fP
+to indicate the full size of the file.
+This is not the same as the size in the tar header because the
+latter value does not include the size of any holes.
+This format required that the order of attributes be preserved and
+relied on readers accepting multiple appearances of the same attribute
+names, which is not officially permitted by the standards.
+.TP
+\fBGNU.sparse.map\fP
+The
+``0.1''
+format used a single attribute that stored a comma-separated
+list of decimal numbers.
+Each pair of numbers indicated the offset and size, respectively,
+of a block of data.
+This does not work well if the archive is extracted by an archiver
+that does not recognize this extension, since many pax implementations
+simply discard unrecognized attributes.
+.TP
+\fBGNU.sparse.major\fP, \fBGNU.sparse.minor\fP, \fBGNU.sparse.name\fP, \fBGNU.sparse.realsize\fP
+The
+``1.0''
+format stores the sparse block map in one or more 512-byte blocks
+prepended to the file data in the entry body.
+The pax attributes indicate the existence of this map
+(via the
+\fBGNU.sparse.major\fP
+and
+\fBGNU.sparse.minor\fP
+fields)
+and the full size of the file.
+The
+\fBGNU.sparse.name\fP
+holds the true name of the file.
+To avoid confusion, the name stored in the regular tar header
+is a modified name so that extraction errors will be apparent
+to users.
+.RE
.SS Solaris Tar
XXX More Details Needed XXX
+.PP
Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an
``extended''
format that is fundamentally similar to pax interchange format,
with the following differences:
+.RS 5
.IP \(bu
Extended attributes are stored in an entry whose type is
\fBX\fP,
@@ -664,15 +772,42 @@ An additional
\fBA\fP
entry is used to store an ACL for the following regular entry.
The body of this entry contains a seven-digit octal number
-(whose value is 01000000 plus the number of ACL entries)
followed by a zero byte, followed by the
textual ACL description.
+The octal value is the number of ACL entries
+plus a constant that indicates the ACL type: 01000000
+for POSIX.1e ACLs and 03000000 for NFSv4 ACLs.
+.RE
+.SS AIX Tar
+XXX More details needed XXX
+.SS Mac OS X Tar
+The tar distributed with Apple's Mac OS X stores most regular files
+as two separate entries in the tar archive.
+The two entries have the same name except that the first
+one has
+``._''
+added to the beginning of the name.
+This first entry stores the
+``resource fork''
+with additional attributes for the file.
+The Mac OS X
+\fB\%CopyFile\fP()
+API is used to separate a file on disk into separate
+resource and data streams and to reassemble those separate
+streams when the file is restored to disk.
.SS Other Extensions
-One common extension, utilized by GNU tar, star, and other newer
-\fBtar\fP
-implementations, permits binary numbers in the standard numeric
-fields.
-This is flagged by setting the high bit of the first character.
+One obvious extension to increase the size of files is to
+eliminate the terminating characters from the various
+numeric fields.
+For example, the standard only allows the size field to contain
+11 octal digits, reserving the twelfth byte for a trailing
+NUL character.
+Allowing 12 octal digits allows file sizes up to 64 GB.
+.PP
+Another extension, utilized by GNU tar, star, and other newer
+\fB\%tar\fP
+implementations, permits binary numbers in the standard numeric fields.
+This is flagged by setting the high bit of the first byte.
This permits 95-bit values for the length and time fields
and 63-bit values for the uid, gid, and device numbers.
GNU tar supports this extension for the
@@ -681,19 +816,19 @@ Joerg Schilling's star program supports this extension for
all numeric fields.
Note that this extension is largely obsoleted by the extended attribute
record provided by the pax interchange format.
-Another early GNU extension allowed base-64 values rather
-than octal.
-This extension was short-lived and such archives are almost never seen.
-However, there is still code in GNU tar to support them; this code is
-responsible for a very cryptic warning message that is sometimes seen when
-GNU tar encounters a damaged archive.
+.PP
+Another early GNU extension allowed base-64 values rather than octal.
+This extension was short-lived and is no longer supported by any
+implementation.
.SH SEE ALSO
+.ad l
\fBar\fP(1),
\fBpax\fP(1),
\fBtar\fP(1)
.SH STANDARDS
+.ad l
The
-\fBtar\fP
+\fB\%tar\fP
utility is no longer a part of POSIX or the Single Unix Standard.
It last appeared in
Version 2 of the Single UNIX Specification (``SUSv2'').
@@ -705,21 +840,30 @@ utility.
The pax interchange file format is new with
IEEE Std 1003.1-2001 (``POSIX.1'').
.SH HISTORY
+.ad l
A
-\fBtar\fP
+\fB\%tar\fP
command appeared in Seventh Edition Unix, which was released in January, 1979.
It replaced the
-\fBtp\fP
+\fB\%tp\fP
program from Fourth Edition Unix which in turn replaced the
-\fBtap\fP
+\fB\%tap\fP
program from First Edition Unix.
John Gilmore's
-\fBpdtar\fP
+\fB\%pdtar\fP
public-domain implementation (circa 1987) was highly influential
and formed the basis of
-\fBGNU\fP tar.
+\fB\%GNU\fP tar
+(circa 1988).
Joerg Shilling's
-\fBstar\fP
+\fB\%star\fP
archiver is another open-source (GPL) archiver (originally developed
circa 1985) which features complete support for pax interchange
format.
+.PP
+This documentation was written as part of the
+\fB\%libarchive\fP
+and
+\fB\%bsdtar\fP
+project by
+Tim Kientzle \%<kientzle@FreeBSD.org.>
diff --git a/archivers/libarchive/files/doc/mdoc2man.awk b/archivers/libarchive/files/doc/mdoc2man.awk
index c71e52861c6..c55b953ee60 100644
--- a/archivers/libarchive/files/doc/mdoc2man.awk
+++ b/archivers/libarchive/files/doc/mdoc2man.awk
@@ -85,7 +85,7 @@ function breakline() {
# Start an indented display
function dispstart() {
- linecmd(".RS")
+ linecmd(".RS 4")
}
# End an indented display
@@ -104,6 +104,37 @@ function wtail() {
return retval
}
+function splitwords(l, dest, n, o, w) {
+ n = 1
+ delete dest
+ while (length(l) > 0) {
+ sub("^[ \t]*", "", l)
+ if (match(l, "^\"")) {
+ l = substr(l, 2)
+ o = index(l, "\"")
+ if (o > 0) {
+ w = substr(l, 1, o-1)
+ l = substr(l, o+1)
+ dest[n++] = w
+ } else {
+ dest[n++] = l
+ l = ""
+ }
+ } else {
+ o = match(l, "[ \t]")
+ if (o > 0) {
+ w = substr(l, 1, o-1)
+ l = substr(l, o+1)
+ dest[n++] = w
+ } else {
+ dest[n++] = l
+ l = ""
+ }
+ }
+ }
+ return n-1
+}
+
! /^\./ {
out = $0
endline()
@@ -114,7 +145,7 @@ function wtail() {
{
sub("^\\.","")
- nwords=split($0,words)
+ nwords=splitwords($0, words)
# TODO: Instead of iterating 'w' over the array, have a separate
# function that returns 'next word' and use that. This will allow
# proper handling of double-quoted arguments as well.
@@ -128,6 +159,7 @@ function wtail() {
} else if(match(words[w],"^Bd$")) { # Begin display
if(match(words[w+1],"-literal")) {
dispstart()
+ linecmd(".nf")
displaylines=10000
w=nwords
}
@@ -144,6 +176,10 @@ function wtail() {
while(w<nwords&&!match(words[w+1],"^[\\.,]"))
add(words[++w])
addclose("''")
+ } else if(match(words[w],"^Do$")) {
+ addopen("``")
+ } else if(match(words[w],"^Dc$")) {
+ addclose("''")
} else if(match(words[w],"^Oo$")) {
addopen("[")
} else if(match(words[w],"^Oc$")) {
@@ -189,15 +225,20 @@ function wtail() {
} else if(match(words[w],"^Os$")) {
add(".TH " id " \"" date "\" \"" wtail() "\"")
} else if(match(words[w],"^Sh$")) {
- add(".SH")
- section=words[w+1]
+ section=wtail()
+ add(".SH " section)
+ linecmd(".ad l")
} else if(match(words[w],"^Xr$")) {
add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w])
} else if(match(words[w],"^Nm$")) {
if(match(section,"SYNOPSIS"))
breakline()
- if(w>1)
- n=name
+ if(w >= nwords)
+ n=name
+ else if (match(words[w+1], "^[A-Z][a-z]$"))
+ n=name
+ else if (match(words[w+1], "^[.,;:]$"))
+ n=name
else {
n=words[++w]
if(!length(name))
@@ -205,7 +246,7 @@ function wtail() {
}
if(!length(n))
n=name
- add("\\fB" n "\\fP")
+ add("\\fB\\%" n "\\fP")
} else if(match(words[w],"^Nd$")) {
add("\\- " wtail())
} else if(match(words[w],"^Fl$")) {
@@ -214,11 +255,8 @@ function wtail() {
addopen("\\fI")
if(w==nwords)
add("file ...\\fP")
- else {
+ else
add(words[++w] "\\fP")
- while(match(words[w+1],"^\\|$"))
- add(words[++w] " \\fI" words[++w] "\\fP")
- }
} else if(match(words[w],"^Cm$")) {
add("\\fB" words[++w] "\\fP")
} else if(match(words[w],"^Op$")) {
@@ -226,38 +264,57 @@ function wtail() {
option=1
trailer="]" trailer
} else if(match(words[w],"^Pp$")) {
- endline()
+ linecmd(".PP")
} else if(match(words[w],"^An$")) {
endline()
} else if(match(words[w],"^Ss$")) {
add(".SS")
} else if(match(words[w],"^Ft$")) {
- addopen("\\fI")
- trailer = "\\fP" trailer
- displaylines = 1
+ if (match(section, "SYNOPSIS")) {
+ breakline()
+ }
+ add("\\fI" wtail() "\\fP")
+ if (match(section, "SYNOPSIS")) {
+ breakline()
+ }
} else if(match(words[w],"^Fn$")) {
- # Using '.nh' to suppress hyphenation doesn't really work...
- # TODO: Fix this.
- add(".nh")
- endline()
- addopen("\\fB")
+ ++w
+ F = "\\fB\\%" words[w] "\\fP("
+ Fsep = ""
+ while(w<nwords) {
+ ++w
+ if (match(words[w], "^[.,:]$")) {
+ --w
+ break
+ }
+ gsub(" ", "\\ ", words[w])
+ F = F Fsep "\\fI\\%" words[w] "\\fP"
+ Fsep = ", "
+ }
+ add(F ")")
+ if (match(section, "SYNOPSIS")) {
+ addclose(";")
+ }
+ } else if(match(words[w],"^Fo$")) {
w++
- add(words[w])
- addclose("\\fP")
- endline()
- add(".hy")
- endline()
- addpunct("(")
- # This is broken; Fn should peek ahead and put each double-quoted
- # arg in .Ty and be smarter about following punct.
- trailer = ");" trailer
+ F = "\\fB\\%" words[w] "\\fP("
+ Fsep = ""
+ } else if(match(words[w],"^Fa$")) {
+ w++
+ gsub(" ", "\\ ", words[w])
+ F = F Fsep "\\fI\\%" words[w] "\\fP"
+ Fsep = ", "
+ } else if(match(words[w],"^Fc$")) {
+ add(F ")")
+ if (match(section, "SYNOPSIS")) {
+ addclose(";")
+ }
} else if(match(words[w],"^Va$")) {
w++
add("\\fI" words[w] "\\fP")
} else if(match(words[w],"^In$")) {
w++
add("\\fB#include <" words[w] ">\\fP")
- breakline()
} else if(match(words[w],"^Pa$")) {
addopen("\\fI")
w++
@@ -272,7 +329,7 @@ function wtail() {
addopen("(")
trailer=")" trailer
} else if(match(words[w],"^Aq$")) {
- addopen("<")
+ addopen("\\%<")
trailer=">" trailer
} else if(match(words[w],"^Brq$")) {
addopen("{")
@@ -284,6 +341,7 @@ function wtail() {
trailer="\\fP" trailer
} else if(match(words[w],"^Bl$")) {
oldoptlist=optlist
+ linecmd(".RS 5")
if(match(words[w+1],"-bullet"))
optlist=1
else if(match(words[w+1],"-enum")) {
@@ -297,6 +355,7 @@ function wtail() {
optlist=1
w=nwords
} else if(match(words[w],"^El$")) {
+ linecmd(".RE")
optlist=oldoptlist
} else if(match(words[w],"^It$")&&optlist) {
if(optlist==1)
@@ -312,6 +371,10 @@ function wtail() {
}
} else if(optlist==4)
add(".IP")
+ } else if(match(words[w],"^Xo$")) {
+ # TODO: Figure out how to handle this
+ } else if(match(words[w],"^Xc$")) {
+ # TODO: Figure out how to handle this
} else if(match(words[w],"^[=]$")) {
addpunct(words[w])
} else if(match(words[w],"^[\[{(]$")) {
diff --git a/archivers/libarchive/files/doc/mdoc2wiki.awk b/archivers/libarchive/files/doc/mdoc2wiki.awk
new file mode 100644
index 00000000000..146d9619824
--- /dev/null
+++ b/archivers/libarchive/files/doc/mdoc2wiki.awk
@@ -0,0 +1,448 @@
+#!/usr/bin/awk
+#
+# Copyright (c) 2003 Peter Stuge <stuge-mdoc2man@cdy.org>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# Dramatically overhauled by Tim Kientzle. This version almost
+# handles library-style pages with Fn, Ft, etc commands. Still
+# a lot of problems...
+
+BEGIN {
+ displaylines = 0
+ listdepth = 0
+ trailer = ""
+ out = ""
+ sep = ""
+ nextsep = " "
+ spaces = " "
+}
+
+# Add a word with appropriate preceding whitespace
+# Maintain a short queue of the expected upcoming word separators.
+function add(str) {
+ out=out sep str
+ sep = nextsep
+ nextsep = " "
+}
+
+# Add a word with no following whitespace
+# Use for opening punctuation such as '('
+function addopen(str) {
+ add(str)
+ sep = ""
+}
+
+# Add a word with no preceding whitespace
+# Use for closing punctuation such as ')' or '.'
+function addclose(str) {
+ sep = ""
+ add(str)
+}
+
+# Add a word with no space before or after
+# Use for separating punctuation such as '='
+function addpunct(str) {
+ sep = ""
+ add(str)
+ sep = ""
+}
+
+# Emit the current line so far
+function endline() {
+ addclose(trailer)
+ trailer = ""
+ if(length(out) > 0) {
+ print out
+ out=""
+ }
+ if(displaylines > 0) {
+ displaylines = displaylines - 1
+ if (displaylines == 0)
+ dispend()
+ }
+ # First word on next line has no preceding whitespace
+ sep = ""
+}
+
+function linecmd(cmd) {
+ endline()
+ add(cmd)
+ endline()
+}
+
+function breakline() {
+ linecmd("<br>")
+}
+
+# Start an indented display
+function dispstart() {
+ linecmd("{{{")
+}
+
+# End an indented display
+function dispend() {
+ linecmd("}}}")
+}
+
+# Collect rest of input line
+function wtail() {
+ retval=""
+ while(w<nwords) {
+ if(length(retval))
+ retval=retval " "
+ retval=retval words[++w]
+ }
+ return retval
+}
+
+function splitwords(l, dest, n, o, w) {
+ n = 1
+ delete dest
+ while (length(l) > 0) {
+ sub("^[ \t]*", "", l)
+ if (match(l, "^\"")) {
+ l = substr(l, 2)
+ o = index(l, "\"")
+ if (o > 0) {
+ w = substr(l, 1, o-1)
+ l = substr(l, o+1)
+ dest[n++] = w
+ } else {
+ dest[n++] = l
+ l = ""
+ }
+ } else {
+ o = match(l, "[ \t]")
+ if (o > 0) {
+ w = substr(l, 1, o-1)
+ l = substr(l, o+1)
+ dest[n++] = w
+ } else {
+ dest[n++] = l
+ l = ""
+ }
+ }
+ }
+ return n-1
+}
+
+! /^\./ {
+ out = $0
+ endline()
+ next
+}
+
+/^\.\\"/ { next }
+
+{
+ sub("^\\.","")
+ nwords=splitwords($0, words)
+ # TODO: Instead of iterating 'w' over the array, have a separate
+ # function that returns 'next word' and use that. This will allow
+ # proper handling of double-quoted arguments as well.
+ for(w=1;w<=nwords;w++) {
+ if(match(words[w],"^Li$")) { # Literal; rest of line is unformatted
+ dispstart()
+ displaylines = 1
+ } else if(match(words[w],"^Dl$")) { # Display literal
+ dispstart()
+ displaylines = 1
+ } else if(match(words[w],"^Bd$")) { # Begin display
+ if(match(words[w+1],"-literal")) {
+ dispstart()
+ displaylines=10000
+ w=nwords
+ }
+ } else if(match(words[w],"^Ed$")) { # End display
+ displaylines = 0
+ dispend()
+ } else if(match(words[w],"^Ns$")) { # Suppress space before next word
+ sep=""
+ } else if(match(words[w],"^No$")) { # Normal text
+ add(words[++w])
+ } else if(match(words[w],"^Dq$")) { # Quote
+ addopen("\"")
+ add(words[++w])
+ while(w<nwords&&!match(words[w+1],"^[\\.,]"))
+ add(words[++w])
+ addclose("\"")
+ } else if(match(words[w],"^Do$")) {
+ addopen("\"")
+ } else if(match(words[w],"^Dc$")) {
+ addclose("\"")
+ } else if(match(words[w],"^Oo$")) {
+ addopen("`[`")
+ } else if(match(words[w],"^Oc$")) {
+ addclose("`]`")
+ } else if(match(words[w],"^Ao$")) {
+ addopen("`<`")
+ } else if(match(words[w],"^Ac$")) {
+ addclose("`>`")
+ } else if(match(words[w],"^Dd$")) {
+ date=wtail()
+ next
+ } else if(match(words[w],"^Dt$")) {
+ id=wtail()
+ next
+ } else if(match(words[w],"^Ox$")) {
+ add("OpenBSD")
+ } else if(match(words[w],"^Fx$")) {
+ add("FreeBSD")
+ } else if(match(words[w],"^Bx$")) {
+ add("BSD")
+ } else if(match(words[w],"^Nx$")) {
+ add("NetBSD")
+ } else if(match(words[w],"^St$")) {
+ if (match(words[w+1], "^-p1003.1$")) {
+ w++
+ add("IEEE Std 1003.1 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-96$")) {
+ w++
+ add("ISO/IEC 9945-1:1996 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-88$")) {
+ w++
+ add("IEEE Std 1003.1-1988 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-2001$")) {
+ w++
+ add("IEEE Std 1003.1-2001 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-susv2$")) {
+ w++
+ add("Version 2 of the Single UNIX Specification (``SUSv2'')")
+ }
+ } else if(match(words[w],"^Ex$")) {
+ if (match(words[w+1], "^-std$")) {
+ w++
+ add("The *" name "* utility exits 0 on success, and >0 if an error occurs.")
+ }
+ } else if(match(words[w],"^Os$")) {
+ add("#summary " id " manual page")
+ } else if(match(words[w],"^Sh$")) {
+ section=wtail()
+ linecmd("== " section " ==")
+ } else if(match(words[w],"^Xr$")) {
+ add("*" words[++w] "*(" words[++w] ")" words[++w])
+ } else if(match(words[w],"^Nm$")) {
+ if(match(section,"SYNOPSIS"))
+ breakline()
+ if(w >= nwords)
+ n=name
+ else if (match(words[w+1], "^[A-Z][a-z]$"))
+ n=name
+ else if (match(words[w+1], "^[.,;:]$"))
+ n=name
+ else {
+ n=words[++w]
+ if(!length(name))
+ name=n
+ }
+ if(!length(n))
+ n=name
+ if (displaylines == 0)
+ add("*" n "*")
+ else
+ add(n)
+ } else if(match(words[w],"^Nd$")) {
+ add("- " wtail())
+ } else if(match(words[w],"^Fl$")) {
+ if (displaylines == 0)
+ add("*-" words[++w] "*")
+ else
+ add("-" words[++w])
+ } else if(match(words[w],"^Ar$")) {
+ if(w==nwords)
+ add("_file ..._")
+ else {
+ ++w
+ gsub("<", "`<`", words[w])
+ add("_" words[w] "_")
+ }
+ } else if(match(words[w],"^Cm$")) {
+ ++w
+ if (displaylines == 0) {
+ gsub("^_", "`_`", words[w])
+ gsub("\\*$", "`*`", words[w])
+ add("*" words[w] "*")
+ } else
+ add(words[w])
+ } else if(match(words[w],"^Op$")) {
+ addopen("`[`")
+ option=1
+ trailer="`]`" trailer
+ } else if(match(words[w],"^Pp$")) {
+ ++w
+ endline()
+ print ""
+ } else if(match(words[w],"^An$")) {
+ if (match(words[w+1],"-nosplit"))
+ ++w
+ endline()
+ } else if(match(words[w],"^Ss$")) {
+ add("===")
+ trailer="==="
+ } else if(match(words[w],"^Ft$")) {
+ if (match(section, "SYNOPSIS")) {
+ breakline()
+ }
+ l = wtail()
+ gsub("\\*", "`*`", l)
+
+ add("*" l "*")
+ if (match(section, "SYNOPSIS")) {
+ breakline()
+ }
+ } else if(match(words[w],"^Fn$")) {
+ ++w
+ F = "*" words[w] "*("
+ Fsep = ""
+ while(w<nwords) {
+ ++w
+ if (match(words[w], "^[.,:]$")) {
+ --w
+ break
+ }
+ gsub("\\*", "`*`", words[w])
+ F = F Fsep "_" words[w] "_"
+ Fsep = ", "
+ }
+ add(F ")")
+ if (match(section, "SYNOPSIS")) {
+ addclose(";")
+ }
+ } else if(match(words[w],"^Fo$")) {
+ w++
+ F = "*" words[w] "*("
+ Fsep = ""
+ } else if(match(words[w],"^Fa$")) {
+ w++
+ gsub("\\*", "`*`", words[w])
+ F = F Fsep "_" words[w] "_"
+ Fsep = ", "
+ } else if(match(words[w],"^Fc$")) {
+ add(F ")")
+ if (match(section, "SYNOPSIS")) {
+ addclose(";")
+ }
+ } else if(match(words[w],"^Va$")) {
+ w++
+ add("_" words[w] "_")
+ } else if(match(words[w],"^In$")) {
+ w++
+ add("*#include <" words[w] ">*")
+ } else if(match(words[w],"^Pa$")) {
+ w++
+# if(match(words[w],"^\\."))
+# add("\\&")
+ if (displaylines == 0)
+ add("_" words[w] "_")
+ else
+ add(words[w])
+ } else if(match(words[w],"^Dv$")) {
+ linecmd()
+ } else if(match(words[w],"^Em|Ev$")) {
+ add(".IR")
+ } else if(match(words[w],"^Pq$")) {
+ addopen("(")
+ trailer=")" trailer
+ } else if(match(words[w],"^Aq$")) {
+ addopen(" <")
+ trailer=">" trailer
+ } else if(match(words[w],"^Brq$")) {
+ addopen("{")
+ trailer="}" trailer
+ } else if(match(words[w],"^S[xy]$")) {
+ add(".B " wtail())
+ } else if(match(words[w],"^Tn$")) {
+ n=wtail()
+ gsub("\\*$", "`*`", n)
+ add("*" n "*")
+ } else if(match(words[w],"^Ic$")) {
+ add("\\fB")
+ trailer="\\fP" trailer
+ } else if(match(words[w],"^Bl$")) {
+ ++listdepth
+ listnext[listdepth]=""
+ if(match(words[w+1],"-bullet")) {
+ optlist[listdepth]=1
+ addopen("<ul>")
+ listclose[listdepth]="</ul>"
+ } else if(match(words[w+1],"-enum")) {
+ optlist[listdepth]=2
+ enum=0
+ addopen("<ol>")
+ listclose[listdepth]="</ol>"
+ } else if(match(words[w+1],"-tag")) {
+ optlist[listdepth]=3
+ addopen("<dl>")
+ listclose[listdepth]="</dl>"
+ } else if(match(words[w+1],"-item")) {
+ optlist[listdepth]=4
+ addopen("<ul>")
+ listclose[listdepth]="</ul>"
+ }
+ w=nwords
+ } else if(match(words[w],"^El$")) {
+ addclose(listnext[listdepth])
+ addclose(listclose[listdepth])
+ listclose[listdepth]=""
+ listdepth--
+ } else if(match(words[w],"^It$")) {
+ addclose(listnext[listdepth])
+ if(optlist[listdepth]==1) {
+ addpunct("<li>")
+ listnext[listdepth] = "</li>"
+ } else if(optlist[listdepth]==2) {
+ addpunct("<li>")
+ listnext[listdepth] = "</li>"
+ } else if(optlist[listdepth]==3) {
+ addpunct("<dt>")
+ listnext[listdepth] = "</dt>"
+ if(match(words[w+1],"^Xo$")) {
+ # Suppress trailer
+ w++
+ } else if(match(words[w+1],"^Pa$|^Ev$")) {
+ addopen("*")
+ w++
+ add(words[++w] "*")
+ } else {
+ trailer = listnext[listdepth] "<dd>" trailer
+ listnext[listdepth] = "</dd>"
+ }
+ } else if(optlist[listdepth]==4) {
+ addpunct("<li>")
+ listnext[listdepth] = "</li>"
+ }
+ } else if(match(words[w],"^Xo$")) {
+ # TODO: Figure out how to handle this
+ } else if(match(words[w],"^Xc$")) {
+ # TODO: Figure out how to handle this
+ if (optlist[listdepth] == 3) {
+ addclose(listnext[listdepth])
+ addopen("<dd>")
+ listnext[listdepth] = "</dd>"
+ }
+ } else if(match(words[w],"^[=]$")) {
+ addpunct(words[w])
+ } else if(match(words[w],"^[\[{(]$")) {
+ addopen(words[w])
+ } else if(match(words[w],"^[\\\])}.,;:]$")) {
+ addclose(words[w])
+ } else {
+ sub("\\\\&", "", words[w])
+ add(words[w])
+ }
+ }
+ if(match(out,"^\\.[^a-zA-Z]"))
+ sub("^\\.","",out)
+ endline()
+}
diff --git a/archivers/libarchive/files/doc/pdf/Makefile b/archivers/libarchive/files/doc/pdf/Makefile
new file mode 100644
index 00000000000..a563105fb10
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/Makefile
@@ -0,0 +1,46 @@
+
+default: all
+
+
+archive_entry.3.pdf: ../../libarchive/archive_entry.3
+ groff -mdoc -T ps ../../libarchive/archive_entry.3 | ps2pdf - - > archive_entry.3.pdf
+
+archive_read.3.pdf: ../../libarchive/archive_read.3
+ groff -mdoc -T ps ../../libarchive/archive_read.3 | ps2pdf - - > archive_read.3.pdf
+
+archive_read_disk.3.pdf: ../../libarchive/archive_read_disk.3
+ groff -mdoc -T ps ../../libarchive/archive_read_disk.3 | ps2pdf - - > archive_read_disk.3.pdf
+
+archive_util.3.pdf: ../../libarchive/archive_util.3
+ groff -mdoc -T ps ../../libarchive/archive_util.3 | ps2pdf - - > archive_util.3.pdf
+
+archive_write.3.pdf: ../../libarchive/archive_write.3
+ groff -mdoc -T ps ../../libarchive/archive_write.3 | ps2pdf - - > archive_write.3.pdf
+
+archive_write_disk.3.pdf: ../../libarchive/archive_write_disk.3
+ groff -mdoc -T ps ../../libarchive/archive_write_disk.3 | ps2pdf - - > archive_write_disk.3.pdf
+
+cpio.5.pdf: ../../libarchive/cpio.5
+ groff -mdoc -T ps ../../libarchive/cpio.5 | ps2pdf - - > cpio.5.pdf
+
+libarchive-formats.5.pdf: ../../libarchive/libarchive-formats.5
+ groff -mdoc -T ps ../../libarchive/libarchive-formats.5 | ps2pdf - - > libarchive-formats.5.pdf
+
+libarchive.3.pdf: ../../libarchive/libarchive.3
+ groff -mdoc -T ps ../../libarchive/libarchive.3 | ps2pdf - - > libarchive.3.pdf
+
+libarchive_internals.3.pdf: ../../libarchive/libarchive_internals.3
+ groff -mdoc -T ps ../../libarchive/libarchive_internals.3 | ps2pdf - - > libarchive_internals.3.pdf
+
+mtree.5.pdf: ../../libarchive/mtree.5
+ groff -mdoc -T ps ../../libarchive/mtree.5 | ps2pdf - - > mtree.5.pdf
+
+tar.5.pdf: ../../libarchive/tar.5
+ groff -mdoc -T ps ../../libarchive/tar.5 | ps2pdf - - > tar.5.pdf
+
+bsdtar.1.pdf: ../../tar/bsdtar.1
+ groff -mdoc -T ps ../../tar/bsdtar.1 | ps2pdf - - > bsdtar.1.pdf
+
+bsdcpio.1.pdf: ../../cpio/bsdcpio.1
+ groff -mdoc -T ps ../../cpio/bsdcpio.1 | ps2pdf - - > bsdcpio.1.pdf
+all: archive_entry.3.pdf archive_read.3.pdf archive_read_disk.3.pdf archive_util.3.pdf archive_write.3.pdf archive_write_disk.3.pdf cpio.5.pdf libarchive-formats.5.pdf libarchive.3.pdf libarchive_internals.3.pdf mtree.5.pdf tar.5.pdf bsdtar.1.pdf bsdcpio.1.pdf
diff --git a/archivers/libarchive/files/doc/pdf/archive_entry.3.pdf b/archivers/libarchive/files/doc/pdf/archive_entry.3.pdf
new file mode 100644
index 00000000000..658d0adc972
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_entry.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/archive_read.3.pdf b/archivers/libarchive/files/doc/pdf/archive_read.3.pdf
new file mode 100644
index 00000000000..12581db47a3
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_read.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/archive_read_disk.3.pdf b/archivers/libarchive/files/doc/pdf/archive_read_disk.3.pdf
new file mode 100644
index 00000000000..0f21d06ef3e
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_read_disk.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/archive_util.3.pdf b/archivers/libarchive/files/doc/pdf/archive_util.3.pdf
new file mode 100644
index 00000000000..a7ff8ed8d37
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_util.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/archive_write.3.pdf b/archivers/libarchive/files/doc/pdf/archive_write.3.pdf
new file mode 100644
index 00000000000..4e0069aa91c
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_write.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/archive_write_disk.3.pdf b/archivers/libarchive/files/doc/pdf/archive_write_disk.3.pdf
new file mode 100644
index 00000000000..ed8f6739300
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/archive_write_disk.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/bsdcpio.1.pdf b/archivers/libarchive/files/doc/pdf/bsdcpio.1.pdf
new file mode 100644
index 00000000000..771e5c66af3
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/bsdcpio.1.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/bsdtar.1.pdf b/archivers/libarchive/files/doc/pdf/bsdtar.1.pdf
new file mode 100644
index 00000000000..0ebd4f2b800
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/bsdtar.1.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/cpio.5.pdf b/archivers/libarchive/files/doc/pdf/cpio.5.pdf
new file mode 100644
index 00000000000..8bd1276eb29
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/cpio.5.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/libarchive-formats.5.pdf b/archivers/libarchive/files/doc/pdf/libarchive-formats.5.pdf
new file mode 100644
index 00000000000..db03ba1ee4d
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/libarchive-formats.5.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/libarchive.3.pdf b/archivers/libarchive/files/doc/pdf/libarchive.3.pdf
new file mode 100644
index 00000000000..25e2b0c780f
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/libarchive.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/libarchive_internals.3.pdf b/archivers/libarchive/files/doc/pdf/libarchive_internals.3.pdf
new file mode 100644
index 00000000000..a0eafe5b8ef
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/libarchive_internals.3.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/mtree.5.pdf b/archivers/libarchive/files/doc/pdf/mtree.5.pdf
new file mode 100644
index 00000000000..9297b0d7645
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/mtree.5.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/pdf/tar.5.pdf b/archivers/libarchive/files/doc/pdf/tar.5.pdf
new file mode 100644
index 00000000000..6c934df6128
--- /dev/null
+++ b/archivers/libarchive/files/doc/pdf/tar.5.pdf
Binary files differ
diff --git a/archivers/libarchive/files/doc/text/Makefile b/archivers/libarchive/files/doc/text/Makefile
index a70eb1825c6..2671acd4455 100644
--- a/archivers/libarchive/files/doc/text/Makefile
+++ b/archivers/libarchive/files/doc/text/Makefile
@@ -1,42 +1,46 @@
-all: archive_entry.3 archive_read.3 archive_util.3 archive_write.3 archive_write_disk.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
+default: all
-archive_entry.3: ../../libarchive/archive_entry.3
- nroff -mdoc ../../libarchive/archive_entry.3 | col -b > archive_entry.3
+archive_entry.3.txt: ../../libarchive/archive_entry.3
+ nroff -mdoc ../../libarchive/archive_entry.3 | col -b > archive_entry.3.txt
-archive_read.3: ../../libarchive/archive_read.3
- nroff -mdoc ../../libarchive/archive_read.3 | col -b > archive_read.3
+archive_read.3.txt: ../../libarchive/archive_read.3
+ nroff -mdoc ../../libarchive/archive_read.3 | col -b > archive_read.3.txt
-archive_util.3: ../../libarchive/archive_util.3
- nroff -mdoc ../../libarchive/archive_util.3 | col -b > archive_util.3
+archive_read_disk.3.txt: ../../libarchive/archive_read_disk.3
+ nroff -mdoc ../../libarchive/archive_read_disk.3 | col -b > archive_read_disk.3.txt
-archive_write.3: ../../libarchive/archive_write.3
- nroff -mdoc ../../libarchive/archive_write.3 | col -b > archive_write.3
+archive_util.3.txt: ../../libarchive/archive_util.3
+ nroff -mdoc ../../libarchive/archive_util.3 | col -b > archive_util.3.txt
-archive_write_disk.3: ../../libarchive/archive_write_disk.3
- nroff -mdoc ../../libarchive/archive_write_disk.3 | col -b > archive_write_disk.3
+archive_write.3.txt: ../../libarchive/archive_write.3
+ nroff -mdoc ../../libarchive/archive_write.3 | col -b > archive_write.3.txt
-cpio.5: ../../libarchive/cpio.5
- nroff -mdoc ../../libarchive/cpio.5 | col -b > cpio.5
+archive_write_disk.3.txt: ../../libarchive/archive_write_disk.3
+ nroff -mdoc ../../libarchive/archive_write_disk.3 | col -b > archive_write_disk.3.txt
-libarchive-formats.5: ../../libarchive/libarchive-formats.5
- nroff -mdoc ../../libarchive/libarchive-formats.5 | col -b > libarchive-formats.5
+cpio.5.txt: ../../libarchive/cpio.5
+ nroff -mdoc ../../libarchive/cpio.5 | col -b > cpio.5.txt
-libarchive.3: ../../libarchive/libarchive.3
- nroff -mdoc ../../libarchive/libarchive.3 | col -b > libarchive.3
+libarchive-formats.5.txt: ../../libarchive/libarchive-formats.5
+ nroff -mdoc ../../libarchive/libarchive-formats.5 | col -b > libarchive-formats.5.txt
-libarchive_internals.3: ../../libarchive/libarchive_internals.3
- nroff -mdoc ../../libarchive/libarchive_internals.3 | col -b > libarchive_internals.3
+libarchive.3.txt: ../../libarchive/libarchive.3
+ nroff -mdoc ../../libarchive/libarchive.3 | col -b > libarchive.3.txt
-mtree.5: ../../libarchive/mtree.5
- nroff -mdoc ../../libarchive/mtree.5 | col -b > mtree.5
+libarchive_internals.3.txt: ../../libarchive/libarchive_internals.3
+ nroff -mdoc ../../libarchive/libarchive_internals.3 | col -b > libarchive_internals.3.txt
-tar.5: ../../libarchive/tar.5
- nroff -mdoc ../../libarchive/tar.5 | col -b > tar.5
+mtree.5.txt: ../../libarchive/mtree.5
+ nroff -mdoc ../../libarchive/mtree.5 | col -b > mtree.5.txt
-bsdtar.1: ../../tar/bsdtar.1
- nroff -mdoc ../../tar/bsdtar.1 | col -b > bsdtar.1
+tar.5.txt: ../../libarchive/tar.5
+ nroff -mdoc ../../libarchive/tar.5 | col -b > tar.5.txt
-bsdcpio.1: ../../cpio/bsdcpio.1
- nroff -mdoc ../../cpio/bsdcpio.1 | col -b > bsdcpio.1
+bsdtar.1.txt: ../../tar/bsdtar.1
+ nroff -mdoc ../../tar/bsdtar.1 | col -b > bsdtar.1.txt
+
+bsdcpio.1.txt: ../../cpio/bsdcpio.1
+ nroff -mdoc ../../cpio/bsdcpio.1 | col -b > bsdcpio.1.txt
+all: archive_entry.3.txt archive_read.3.txt archive_read_disk.3.txt archive_util.3.txt archive_write.3.txt archive_write_disk.3.txt cpio.5.txt libarchive-formats.5.txt libarchive.3.txt libarchive_internals.3.txt mtree.5.txt tar.5.txt bsdtar.1.txt bsdcpio.1.txt
diff --git a/archivers/libarchive/files/doc/text/archive_entry.3.txt b/archivers/libarchive/files/doc/text/archive_entry.3.txt
index 5201c4f6d5b..a2e5f3c3a53 100644
--- a/archivers/libarchive/files/doc/text/archive_entry.3.txt
+++ b/archivers/libarchive/files/doc/text/archive_entry.3.txt
@@ -5,21 +5,22 @@ NAME
archive_entry_acl_clear, archive_entry_acl_count, archive_entry_acl_next,
archive_entry_acl_next_w, archive_entry_acl_reset,
archive_entry_acl_text_w, archive_entry_atime, archive_entry_atime_nsec,
- archive_entry_clear, archive_entry_clone,
+ archive_entry_clear, archive_entry_clone, archive_entry_copy_fflags_text,
archive_entry_copy_fflags_text_w, archive_entry_copy_gname,
archive_entry_copy_gname_w, archive_entry_copy_hardlink,
- archive_entry_copy_hardlink_w, archive_entry_copy_pathname_w,
- archive_entry_copy_stat, archive_entry_copy_symlink,
- archive_entry_copy_symlink_w, archive_entry_copy_uname,
- archive_entry_copy_uname_w, archive_entry_dev, archive_entry_devmajor,
- archive_entry_devminor, archive_entry_filetype, archive_entry_fflags,
- archive_entry_fflags_text, archive_entry_free, archive_entry_gid,
- archive_entry_gname, archive_entry_hardlink, archive_entry_ino,
- archive_entry_mode, archive_entry_mtime, archive_entry_mtime_nsec,
- archive_entry_nlink, archive_entry_new, archive_entry_pathname,
- archive_entry_pathname_w, archive_entry_rdev, archive_entry_rdevmajor,
- archive_entry_rdevminor, archive_entry_set_atime,
- archive_entry_set_ctime, archive_entry_set_dev,
+ archive_entry_copy_hardlink_w, archive_entry_copy_link,
+ archive_entry_copy_link_w, archive_entry_copy_pathname_w,
+ archive_entry_copy_sourcepath, archive_entry_copy_stat,
+ archive_entry_copy_symlink, archive_entry_copy_symlink_w,
+ archive_entry_copy_uname, archive_entry_copy_uname_w, archive_entry_dev,
+ archive_entry_devmajor, archive_entry_devminor, archive_entry_filetype,
+ archive_entry_fflags, archive_entry_fflags_text, archive_entry_free,
+ archive_entry_gid, archive_entry_gname, archive_entry_hardlink,
+ archive_entry_ino, archive_entry_mode, archive_entry_mtime,
+ archive_entry_mtime_nsec, archive_entry_nlink, archive_entry_new,
+ archive_entry_pathname, archive_entry_pathname_w, archive_entry_rdev,
+ archive_entry_rdevmajor, archive_entry_rdevminor,
+ archive_entry_set_atime, archive_entry_set_ctime, archive_entry_set_dev,
archive_entry_set_devmajor, archive_entry_set_devminor,
archive_entry_set_filetype, archive_entry_set_fflags,
archive_entry_set_gid, archive_entry_set_gname,
@@ -28,9 +29,10 @@ NAME
archive_entry_set_pathname, archive_entry_set_rdevmajor,
archive_entry_set_rdevminor, archive_entry_set_size,
archive_entry_set_symlink, archive_entry_set_uid,
- archive_entry_set_uname, archive_entry_size, archive_entry_stat,
- archive_entry_symlink, archive_entry_uid, archive_entry_uname -- func-
- tions for manipulating archive entry descriptions
+ archive_entry_set_uname, archive_entry_size, archive_entry_sourcepath,
+ archive_entry_stat, archive_entry_symlink, archive_entry_uid,
+ archive_entry_uname -- functions for manipulating archive entry descrip-
+ tions
SYNOPSIS
#include <archive_entry.h>
@@ -75,6 +77,9 @@ SYNOPSIS
struct archive_entry *
archive_entry_clone(struct archive_entry *);
+ const char * *
+ archive_entry_copy_fflags_text_w(struct archive_entry *, const char *);
+
const wchar_t *
archive_entry_copy_fflags_text_w(struct archive_entry *,
const wchar_t *);
@@ -92,6 +97,9 @@ SYNOPSIS
archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
void
+ archive_entry_copy_sourcepath(struct archive_entry *, const char *);
+
+ void
archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
void
@@ -237,6 +245,9 @@ SYNOPSIS
int64_t
archive_entry_size(struct archive_entry *);
+ const char *
+ archive_entry_sourcepath(struct archive_entry *);
+
const struct stat *
archive_entry_stat(struct archive_entry *);
@@ -316,15 +327,15 @@ DESCRIPTION
bits that are not meaningful on the current platform will be ignored.
The canonical text format is a comma-separated list of flag names. The
- archive_entry_copy_fflags_text_w() function parses the provided text and
- sets the internal bitmap values. This is a platform-specific operation;
- names that are not meaningful on the current platform will be ignored.
- The function returns a pointer to the start of the first name that was
- not recognized, or NULL if every name was recognized. Note that every
- name--including names that follow an unrecognized name--will be evalu-
- ated, and the bitmaps will be set to reflect every name that is recog-
- nized. (In particular, this differs from strtofflags(3), which stops
- parsing at the first unrecognized name.)
+ archive_entry_copy_fflags_text() and archive_entry_copy_fflags_text_w()
+ functions parse the provided text and sets the internal bitmap values.
+ This is a platform-specific operation; names that are not meaningful on
+ the current platform will be ignored. The function returns a pointer to
+ the start of the first name that was not recognized, or NULL if every
+ name was recognized. Note that every name--including names that follow
+ an unrecognized name--will be evaluated, and the bitmaps will be set to
+ reflect every name that is recognized. (In particular, this differs from
+ strtofflags(3), which stops parsing at the first unrecognized name.)
ACL Handling
XXX This needs serious help. XXX
@@ -347,4 +358,4 @@ HISTORY
AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
-FreeBSD 6.0 December 15, 2003 FreeBSD 6.0
+FreeBSD 8.0 May 12, 2008 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/archive_read.3.txt b/archivers/libarchive/files/doc/text/archive_read.3.txt
index 95b86866b06..08ebef09324 100644
--- a/archivers/libarchive/files/doc/text/archive_read.3.txt
+++ b/archivers/libarchive/files/doc/text/archive_read.3.txt
@@ -1,23 +1,29 @@
archive_read(3) FreeBSD Library Functions Manual archive_read(3)
NAME
- archive_read_new, archive_read_support_compression_all,
+ archive_read_new, archive_read_set_filter_options,
+ archive_read_set_format_options, archive_read_set_options,
+ archive_read_support_compression_all,
archive_read_support_compression_bzip2,
archive_read_support_compression_compress,
archive_read_support_compression_gzip,
+ archive_read_support_compression_lzma,
archive_read_support_compression_none,
+ archive_read_support_compression_xz,
archive_read_support_compression_program,
- archive_read_support_format_all, archive_read_support_format_cpio,
- archive_read_support_format_empty, archive_read_support_format_iso9660,
- archive_read_support_format_tar, archive_read_support_format_zip,
- archive_read_open, archive_read_open2, archive_read_open_fd,
- archive_read_open_FILE, archive_read_open_filename,
- archive_read_open_memory, archive_read_next_header, archive_read_data,
- archive_read_data_block, archive_read_data_skip,
- archive_read_data_into_buffer, archive_read_data_into_fd,
- archive_read_extract, archive_read_extract_set_progress_callback,
- archive_read_close, archive_read_finish -- functions for reading stream-
- ing archives
+ archive_read_support_compression_program_signature,
+ archive_read_support_format_all, archive_read_support_format_ar,
+ archive_read_support_format_cpio, archive_read_support_format_empty,
+ archive_read_support_format_iso9660, archive_read_support_format_mtree,
+ archive_read_support_format_raw, archive_read_support_format_tar,
+ archive_read_support_format_zip, archive_read_open, archive_read_open2,
+ archive_read_open_fd, archive_read_open_FILE, archive_read_open_filename,
+ archive_read_open_memory, archive_read_next_header,
+ archive_read_next_header2, archive_read_data, archive_read_data_block,
+ archive_read_data_skip, archive_read_data_into_buffer,
+ archive_read_data_into_fd, archive_read_extract, archive_read_extract2,
+ archive_read_extract_set_progress_callback, archive_read_close,
+ archive_read_finish -- functions for reading streaming archives
SYNOPSIS
#include <archive.h>
@@ -38,16 +44,29 @@ SYNOPSIS
archive_read_support_compression_gzip(struct archive *);
int
+ archive_read_support_compression_lzma(struct archive *);
+
+ int
archive_read_support_compression_none(struct archive *);
int
+ archive_read_support_compression_xz(struct archive *);
+
+ int
archive_read_support_compression_program(struct archive *,
const char *cmd);
int
+ archive_read_support_compression_program_signature(struct archive *,
+ const char *cmd, const void *signature, size_t signature_length);
+
+ int
archive_read_support_format_all(struct archive *);
int
+ archive_read_support_format_ar(struct archive *);
+
+ int
archive_read_support_format_cpio(struct archive *);
int
@@ -57,12 +76,27 @@ SYNOPSIS
archive_read_support_format_iso9660(struct archive *);
int
+ archive_read_support_format_mtree(struct archive *);
+
+ int
+ archive_read_support_format_raw(struct archive *);
+
+ int
archive_read_support_format_tar(struct archive *);
int
archive_read_support_format_zip(struct archive *);
int
+ archive_read_set_filter_options(struct archive *, const char *);
+
+ int
+ archive_read_set_format_options(struct archive *, const char *);
+
+ int
+ archive_read_set_options(struct archive *, const char *);
+
+ int
archive_read_open(struct archive *, void *client_data,
archive_open_callback *, archive_read_callback *,
archive_close_callback *);
@@ -88,6 +122,9 @@ SYNOPSIS
int
archive_read_next_header(struct archive *, struct archive_entry **);
+ int
+ archive_read_next_header2(struct archive *, struct archive_entry *);
+
ssize_t
archive_read_data(struct archive *, void *buff, size_t len);
@@ -108,6 +145,10 @@ SYNOPSIS
archive_read_extract(struct archive *, struct archive_entry *,
int flags);
+ int
+ archive_read_extract2(struct archive *src, struct archive_entry *,
+ struct archive *dest);
+
void
archive_read_extract_set_progress_callback(struct archive *,
void (*func)(void *), void *user_data);
@@ -128,24 +169,36 @@ DESCRIPTION
archive_read_new()
Allocates and initializes a struct archive object suitable for
reading from an archive.
- archive_read_support_compression_all(),
- archive_read_support_compression_bzip2(),
+ archive_read_support_compression_bzip2(),
archive_read_support_compression_compress(),
archive_read_support_compression_gzip(),
- archive_read_support_compression_none()
+ archive_read_support_compression_lzma(),
+ archive_read_support_compression_none(),
+ archive_read_support_compression_xz()
Enables auto-detection code and decompression support for the
- specified compression. Note that ``none'' is always enabled by
- default. For convenience, archive_read_support_compression_all()
- enables all available decompression code.
+ specified compression. Returns ARCHIVE_OK if the compression is
+ fully supported, or ARCHIVE_WARN if the compression is supported
+ only through an external program. Note that decompression using
+ an external program is usually slower than decompression through
+ built-in libraries. Note that ``none'' is always enabled by
+ default.
+ archive_read_support_compression_all()
+ Enables all available decompression filters.
archive_read_support_compression_program()
Data is fed through the specified external program before being
dearchived. Note that this disables automatic detection of the
compression format, so it makes no sense to specify this in con-
junction with any other decompression option.
- archive_read_support_format_all(), archive_read_support_format_cpio(),
+ archive_read_support_compression_program_signature()
+ This feeds data through the specified external program but only
+ if the initial bytes of the data match the specified signature
+ value.
+ archive_read_support_format_all(), archive_read_support_format_ar(),
+ archive_read_support_format_cpio(),
archive_read_support_format_empty(),
archive_read_support_format_iso9660(),
- archive_read_support_format_tar,()
+ archive_read_support_format_mtree(),
+ archive_read_support_format_tar(),
archive_read_support_format_zip()
Enables support---including auto-detection code---for the speci-
fied archive format. For example,
@@ -154,6 +207,40 @@ DESCRIPTION
format, and many common variants. For convenience,
archive_read_support_format_all() enables support for all avail-
able formats. Only empty archives are supported by default.
+ archive_read_support_format_raw()
+ The ``raw'' format handler allows libarchive to be used to read
+ arbitrary data. It treats any data stream as an archive with a
+ single entry. The pathname of this entry is ``data''; all other
+ entry fields are unset. This is not enabled by
+ archive_read_support_format_all() in order to avoid erroneous
+ handling of damaged archives.
+ archive_read_set_filter_options(), archive_read_set_format_options(),
+ archive_read_set_options()
+ Specifies options that will be passed to currently-registered
+ filters (including decompression filters) and/or format readers.
+ The argument is a comma-separated list of individual options.
+ Individual options have one of the following forms:
+ option=value
+ The option/value pair will be provided to every module.
+ Modules that do not accept an option with this name will
+ ignore it.
+ option The option will be provided to every module with a value
+ of ``1''.
+ !option
+ The option will be provided to every module with a NULL
+ value.
+ module:option=value, module:option, module:!option
+ As above, but the corresponding option and value will be
+ provided only to modules whose name matches module.
+ The return value will be ARCHIVE_OK if any module accepts the
+ option, or ARCHIVE_WARN if no module accepted the option, or
+ ARCHIVE_FATAL if there was a fatal error while attempting to
+ process the option.
+
+ The currently supported options are:
+ Format iso9660
+ joliet Support Joliet extensions. Defaults to enabled,
+ use !joliet to disable.
archive_read_open()
The same as archive_read_open2(), except that the skip callback
is assumed to be NULL.
@@ -187,6 +274,11 @@ DESCRIPTION
size of a block of memory containing the archive data.
archive_read_next_header()
Read the header for the next entry and return a pointer to a
+ struct archive_entry. This is a convenience wrapper around
+ archive_read_next_header2() that reuses an internal struct
+ archive_entry object for each request.
+ archive_read_next_header2()
+ Read the header for the next entry and populate the provided
struct archive_entry.
archive_read_data()
Read data associated with the header just read. Internally, this
@@ -224,6 +316,15 @@ DESCRIPTION
archive_write_finish_entry(3) to create the entry on disk and
copy data into it. The flags argument is passed unmodified to
archive_write_disk_set_options(3).
+ archive_read_extract2()
+ This is another version of archive_read_extract() that allows you
+ to provide your own restore object. In particular, this allows
+ you to override the standard lookup functions using
+ archive_write_disk_set_group_lookup(3), and
+ archive_write_disk_set_user_lookup(3). Note that
+ archive_read_extract2() does not accept a flags argument; you
+ should use archive_write_disk_set_options() to set the restore
+ options yourself.
archive_read_extract_set_progress_callback()
Sets a pointer to a user-defined callback that can be used for
updating progress displays during extraction. The progress func-
@@ -254,11 +355,11 @@ DESCRIPTION
CLIENT CALLBACKS
The callback functions must match the following prototypes:
- typedef ssize_t archive_read_callback(struct archive *, void
- *client_data, const void **buffer)
+ typedef ssize_t archive_read_callback(struct archive *,
+ void *client_data, const void **buffer)
- typedef int archive_skip_callback(struct archive *, void
- *client_data, size_t request)
+ typedef int archive_skip_callback(struct archive *,
+ void *client_data, size_t request)
typedef int archive_open_callback(struct archive *, void
*client_data)
@@ -392,4 +493,4 @@ BUGS
format of an empty file by inspecting the contents, so this library
treats empty files as having a special ``empty'' format.
-FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
+FreeBSD 8.0 April 13, 2009 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/archive_read_disk.3.txt b/archivers/libarchive/files/doc/text/archive_read_disk.3.txt
new file mode 100644
index 00000000000..0522bf4f5e9
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_read_disk.3.txt
@@ -0,0 +1,204 @@
+archive_read_disk(3) FreeBSD Library Functions Manual archive_read_disk(3)
+
+NAME
+ archive_read_disk_new, archive_read_disk_set_symlink_logical,
+ archive_read_disk_set_symlink_physical,
+ archive_read_disk_set_symlink_hybrid, archive_read_disk_entry_from_file,
+ archive_read_disk_gname, archive_read_disk_uname,
+ archive_read_disk_set_uname_lookup, archive_read_disk_set_gname_lookup,
+ archive_read_disk_set_standard_lookup, archive_read_close,
+ archive_read_finish -- functions for reading objects from disk
+
+SYNOPSIS
+ #include <archive.h>
+
+ struct archive *
+ archive_read_disk_new(void);
+
+ int
+ archive_read_disk_set_symlink_logical(struct archive *);
+
+ int
+ archive_read_disk_set_symlink_physical(struct archive *);
+
+ int
+ archive_read_disk_set_symlink_hybrid(struct archive *);
+
+ int
+ archive_read_disk_gname(struct archive *, gid_t);
+
+ int
+ archive_read_disk_uname(struct archive *, uid_t);
+
+ int
+ archive_read_disk_set_gname_lookup(struct archive *, void *,
+ const char *(*lookup)(void *, gid_t), void (*cleanup)(void *));
+
+ int
+ archive_read_disk_set_uname_lookup(struct archive *, void *,
+ const char *(*lookup)(void *, uid_t), void (*cleanup)(void *));
+
+ int
+ archive_read_disk_set_standard_lookup(struct archive *);
+
+ int
+ archive_read_disk_entry_from_file(struct archive *,
+ struct archive_entry *, int fd, const struct stat *);
+
+ int
+ archive_read_close(struct archive *);
+
+ int
+ archive_read_finish(struct archive *);
+
+DESCRIPTION
+ These functions provide an API for reading information about objects on
+ disk. In particular, they provide an interface for populating struct
+ archive_entry objects.
+
+ archive_read_disk_new()
+ Allocates and initializes a struct archive object suitable for
+ reading object information from disk.
+
+ archive_read_disk_set_symlink_logical(),
+ archive_read_disk_set_symlink_physical(),
+ archive_read_disk_set_symlink_hybrid()
+ This sets the mode used for handling symbolic links. The
+ ``logical'' mode follows all symbolic links. The ``physical''
+ mode does not follow any symbolic links. The ``hybrid'' mode
+ currently behaves identically to the ``logical'' mode.
+
+ archive_read_disk_gname(), archive_read_disk_uname()
+ Returns a user or group name given a gid or uid value. By
+ default, these always return a NULL string.
+
+ archive_read_disk_set_gname_lookup(),
+ archive_read_disk_set_uname_lookup()
+ These allow you to override the functions used for user and group
+ name lookups. You may also provide a void * pointer to a private
+ data structure and a cleanup function for that data. The cleanup
+ function will be invoked when the struct archive object is
+ destroyed or when new lookup functions are registered.
+
+ archive_read_disk_set_standard_lookup()
+ This convenience function installs a standard set of user and
+ group name lookup functions. These functions use getpwid(3) and
+ getgrid(3) to convert ids to names, defaulting to NULL if the
+ names cannot be looked up. These functions also implement a sim-
+ ple memory cache to reduce the number of calls to getpwid(3) and
+ getgrid(3).
+
+ archive_read_disk_entry_from_file()
+ Populates a struct archive_entry object with information about a
+ particular file. The archive_entry object must have already been
+ created with archive_entry_new(3) and at least one of the source
+ path or path fields must already be set. (If both are set, the
+ source path will be used.)
+
+ Information is read from disk using the path name from the struct
+ archive_entry object. If a file descriptor is provided, some
+ information will be obtained using that file descriptor, on plat-
+ forms that support the appropriate system calls.
+
+ If a pointer to a struct stat is provided, information from that
+ structure will be used instead of reading from the disk where
+ appropriate. This can provide performance benefits in scenarios
+ where struct stat information has already been read from the disk
+ as a side effect of some other operation. (For example, direc-
+ tory traversal libraries often provide this information.)
+
+ Where necessary, user and group ids are converted to user and
+ group names using the currently registered lookup functions
+ above. This affects the file ownership fields and ACL values in
+ the struct archive_entry object.
+
+ archive_read_close()
+ This currently does nothing.
+
+ archive_write_finish()
+ Invokes archive_write_close() if it was not invoked manually,
+ then releases all resources.
+ More information about the struct archive object and the overall design
+ of the library can be found in the libarchive(3) overview.
+
+EXAMPLE
+ The following illustrates basic usage of the library by showing how to
+ use it to copy an item on disk into an archive.
+
+ void
+ file_to_archive(struct archive *a, const char *name)
+ {
+ char buff[8192];
+ size_t bytes_read;
+ struct archive *ard;
+ struct archive_entry *entry;
+ int fd;
+
+ ard = archive_read_disk_new();
+ archive_read_disk_set_standard_lookup(ard);
+ entry = archive_entry_new();
+ fd = open(name, O_RDONLY);
+ if (fd < 0)
+ return;
+ archive_entry_copy_sourcepath(entry, name);
+ archive_read_disk_entry_from_file(ard, entry, fd, NULL);
+ archive_write_header(a, entry);
+ while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
+ archive_write_data(a, buff, bytes_read);
+ archive_write_finish_entry(a);
+ archive_read_finish(ard);
+ archive_entry_free(entry);
+ }
+
+RETURN VALUES
+ Most functions return ARCHIVE_OK (zero) on success, or one of several
+ negative error codes for errors. Specific error codes include:
+ ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
+ for unusual conditions that do not prevent further operations, and
+ ARCHIVE_FATAL for serious errors that make remaining operations impossi-
+ ble. The archive_errno(3) and archive_error_string(3) functions can be
+ used to retrieve an appropriate error code and a textual error message.
+ (See archive_util(3) for details.)
+
+ archive_read_disk_new() returns a pointer to a newly-allocated struct
+ archive object or NULL if the allocation failed for any reason.
+
+ archive_read_disk_gname() and archive_read_disk_uname() return const char
+ * pointers to the textual name or NULL if the lookup failed for any rea-
+ son. The returned pointer points to internal storage that may be reused
+ on the next call to either of these functions; callers should copy the
+ string if they need to continue accessing it.
+
+SEE ALSO
+ archive_read(3), archive_write(3), archive_write_disk(3), tar(1),
+ libarchive(3)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3. The
+ archive_read_disk interface was added to libarchive 2.6 and first
+ appeared in FreeBSD 8.0.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle
+ <kientzle@freebsd.org>.
+
+BUGS
+ The ``standard'' user name and group name lookup functions are not the
+ defaults because getgrid(3) and getpwid(3) are sometimes too large for
+ particular applications. The current design allows the application
+ author to use a more compact implementation when appropriate.
+
+ The full list of metadata read from disk by
+ archive_read_disk_entry_from_file() is necessarily system-dependent.
+
+ The archive_read_disk_entry_from_file() function reads as much informa-
+ tion as it can from disk. Some method should be provided to limit this
+ so that clients who do not need ACLs, for instance, can avoid the extra
+ work needed to look up such information.
+
+ This API should provide a set of methods for walking a directory tree.
+ That would make it a direct parallel of the archive_read(3) API. When
+ such methods are implemented, the ``hybrid'' symbolic link mode will make
+ sense.
+
+FreeBSD 8.0 March 10, 2009 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/archive_util.3.txt b/archivers/libarchive/files/doc/text/archive_util.3.txt
index 28b688362ba..190fc26a05a 100644
--- a/archivers/libarchive/files/doc/text/archive_util.3.txt
+++ b/archivers/libarchive/files/doc/text/archive_util.3.txt
@@ -2,8 +2,9 @@ archive_util(3) FreeBSD Library Functions Manual archive_util(3)
NAME
archive_clear_error, archive_compression, archive_compression_name,
- archive_copy_error, archive_errno, archive_error_string, archive_format,
- archive_format_name, archive_set_error -- libarchive utility functions
+ archive_copy_error, archive_errno, archive_error_string,
+ archive_file_count, archive_format, archive_format_name,
+ archive_set_error -- libarchive utility functions
SYNOPSIS
#include <archive.h>
@@ -27,6 +28,9 @@ SYNOPSIS
archive_error_string(struct archive *);
int
+ archive_file_count(struct archive *);
+
+ int
archive_format(struct archive *);
const char *
@@ -57,6 +61,10 @@ DESCRIPTION
Returns a textual error message suitable for display. The error
message here is usually more specific than that obtained from
passing the result of archive_errno() to strerror(3).
+ archive_file_count()
+ Returns a count of the number of files processed by this archive
+ object. The count is incremented by calls to
+ archive_write_header or archive_read_next_header.
archive_format()
Returns a numeric code indicating the format of the current ar-
chive entry. This value is set by a successful call to
@@ -88,4 +96,4 @@ HISTORY
AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
-FreeBSD 6.0 January 8, 2005 FreeBSD 6.0
+FreeBSD 8.0 January 8, 2005 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/archive_write.3.txt b/archivers/libarchive/files/doc/text/archive_write.3.txt
index a16d36419bd..132289b30a1 100644
--- a/archivers/libarchive/files/doc/text/archive_write.3.txt
+++ b/archivers/libarchive/files/doc/text/archive_write.3.txt
@@ -6,14 +6,16 @@ NAME
archive_write_set_format_shar, archive_write_set_format_shar_binary,
archive_write_set_format_ustar, archive_write_get_bytes_per_block,
archive_write_set_bytes_per_block, archive_write_set_bytes_in_last_block,
- archive_write_set_compression_bzip2, archive_write_set_compression_gzip,
- archive_write_set_compression_none,
- archive_write_set_compression_program, archive_write_open,
- archive_write_open_fd, archive_write_open_FILE,
- archive_write_open_filename, archive_write_open_memory,
- archive_write_header, archive_write_data, archive_write_finish_entry,
- archive_write_close, archive_write_finish -- functions for creating ar-
- chives
+ archive_write_set_compression_bzip2,
+ archive_write_set_compression_compress,
+ archive_write_set_compression_gzip, archive_write_set_compression_none,
+ archive_write_set_compression_program,
+ archive_write_set_compressor_options, archive_write_set_format_options,
+ archive_write_set_options, archive_write_open, archive_write_open_fd,
+ archive_write_open_FILE, archive_write_open_filename,
+ archive_write_open_memory, archive_write_header, archive_write_data,
+ archive_write_finish_entry, archive_write_close, archive_write_finish --
+ functions for creating archives
SYNOPSIS
#include <archive.h>
@@ -34,6 +36,9 @@ SYNOPSIS
archive_write_set_compression_bzip2(struct archive *);
int
+ archive_write_set_compression_compress(struct archive *);
+
+ int
archive_write_set_compression_gzip(struct archive *);
int
@@ -62,6 +67,15 @@ SYNOPSIS
archive_write_set_format_ustar(struct archive *);
int
+ archive_write_set_format_options(struct archive *, const char *);
+
+ int
+ archive_write_set_compressor_options(struct archive *, const char *);
+
+ int
+ archive_write_set_options(struct archive *, const char *);
+
+ int
archive_write_open(struct archive *, void *client_data,
archive_open_callback *, archive_write_callback *,
archive_close_callback *);
@@ -159,6 +173,7 @@ DESCRIPTION
result in ordinary ustar archives.
archive_write_set_compression_bzip2(),
+ archive_write_set_compression_compress(),
archive_write_set_compression_gzip(),
archive_write_set_compression_none()
The resulting archive will be compressed as specified. Note that
@@ -169,6 +184,54 @@ DESCRIPTION
The output of that program is blocked and written to the client
write callbacks.
+ archive_write_set_compressor_options(),
+ archive_write_set_format_options(), archive_write_set_options()
+ Specifies options that will be passed to the currently-enabled
+ compressor and/or format writer. The argument is a comma-sepa-
+ rated list of individual options. Individual options have one of
+ the following forms:
+ option=value
+ The option/value pair will be provided to every module.
+ Modules that do not accept an option with this name will
+ ignore it.
+ option The option will be provided to every module with a value
+ of ``1''.
+ !option
+ The option will be provided to every module with a NULL
+ value.
+ module:option=value, module:option, module:!option
+ As above, but the corresponding option and value will be
+ provided only to modules whose name matches module.
+ The return value will be ARCHIVE_OK if any module accepts the
+ option, or ARCHIVE_WARN if no module accepted the option, or
+ ARCHIVE_FATAL if there was a fatal error while attempting to
+ process the option.
+
+ The currently supported options are:
+ Compressor gzip
+ compression-level
+ The value is interpreted as a decimal integer
+ specifying the gzip compression level.
+ Compressor xz
+ compression-level
+ The value is interpreted as a decimal integer
+ specifying the compression level.
+ Format mtree
+ cksum, device, flags, gid, gname, indent, link, md5,
+ mode, nlink, rmd160, sha1, sha256, sha384,
+ sha512, size, time, uid, uname
+ Enable a particular keyword in the mtree output.
+ Prefix with an exclamation mark to disable the
+ corresponding keyword. The default is equivalent
+ to ``device, flags, gid, gname, link, mode,
+ nlink, size, time, type, uid, uname''.
+ all Enables all of the above keywords.
+ use-set
+ Enables generation of /set lines that specify
+ default values for the following files and/or
+ directories.
+ indent XXX needs explanation XXX
+
archive_write_open()
Freeze the settings, open the archive, and prepare for writing
entries. This is the most generic form of this function, which
@@ -257,8 +320,8 @@ CLIENT CALLBACKS
If the open fails, it should call archive_set_error() to register an
error code and message and return ARCHIVE_FATAL.
- typedef ssize_t archive_write_callback(struct archive *, void
- *client_data, void *buffer, size_t length)
+ typedef ssize_t archive_write_callback(struct archive *,
+ void *client_data, const void *buffer, size_t length)
The write callback is invoked whenever the library needs to write raw
bytes to the archive. For correct blocking, each call to the write call-
@@ -281,6 +344,9 @@ EXAMPLE
example, the callback functions are simply wrappers around the standard
open(2), write(2), and close(2) system calls.
+ #ifdef __linux__
+ #define _FILE_OFFSET_BITS 64
+ #endif
#include <sys/stat.h>
#include <archive.h>
#include <archive_entry.h>
@@ -306,7 +372,7 @@ EXAMPLE
}
ssize_t
- mywrite(struct archive *a, void *client_data, void *buff, size_t n)
+ mywrite(struct archive *a, void *client_data, const void *buff, size_t n)
{
struct mydata *mydata = client_data;
@@ -417,4 +483,4 @@ BUGS
correctly restore device nodes with large device numbers from archives
created by this library.
-FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
+FreeBSD 8.0 May 11, 2008 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/archive_write_disk.3.txt b/archivers/libarchive/files/doc/text/archive_write_disk.3.txt
index 18e4e50c113..e63ec6174b6 100644
--- a/archivers/libarchive/files/doc/text/archive_write_disk.3.txt
+++ b/archivers/libarchive/files/doc/text/archive_write_disk.3.txt
@@ -128,6 +128,10 @@ DESCRIPTION
where within it. The default is to not refuse such
paths. Note that paths ending in .. always cause an
error, regardless of this flag.
+ ARCHIVE_EXTRACT_SPARSE
+ Scan data for blocks of NUL bytes and try to recreate
+ them with holes. This results in sparse files, indepen-
+ dent of whether the archive format supports or uses them.
archive_write_disk_set_group_lookup(),
archive_write_disk_set_user_lookup()
@@ -250,4 +254,4 @@ BUGS
There should be a corresponding archive_read_disk interface that walks a
directory heirarchy and returns archive entry objects.
-FreeBSD 6.0 March 2, 2007 FreeBSD 6.0
+FreeBSD 8.0 August 5, 2008 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/bsdcpio.1.txt b/archivers/libarchive/files/doc/text/bsdcpio.1.txt
index 75e097ea722..b8810a614b6 100644
--- a/archivers/libarchive/files/doc/text/bsdcpio.1.txt
+++ b/archivers/libarchive/files/doc/text/bsdcpio.1.txt
@@ -14,13 +14,14 @@ DESCRIPTION
and can create tar, pax, cpio, ar, and shar archives.
The first option to cpio is a mode indicator from the following list:
- -i Input. Read an archive from standard input and extract the con-
- tents to disk or (if the -t option is specified) list the con-
- tents to standard output.
+ -i Input. Read an archive from standard input (unless overriden)
+ and extract the contents to disk or (if the -t option is speci-
+ fied) list the contents to standard output. If one or more file
+ patterns are specified, only files matching one of the patterns
+ will be extracted.
-o Output. Read a list of filenames from standard input and produce
- a new archive on standard output containing the specified items.
- If one or more file patterns are specified, only files matching
- one of the patterns will be extracted.
+ a new archive on standard output (unless overriden) containing
+ the specified items.
-p Pass-through. Read a list of filenames from standard input and
copy the files to the specified directory.
@@ -28,19 +29,34 @@ OPTIONS
Unless specifically stated otherwise, options are applicable in all oper-
ating modes.
+ -0 Read filenames separated by NUL characters instead of newlines.
+ This is necessary if any of the filenames being read might con-
+ tain newlines.
+
+ -A (o mode only) Append to the specified archive. (Not yet imple-
+ mented.)
+
-a (o and p modes) Reset access times on files after they are read.
- (Not yet implemented)
-B (o mode only) Block output to records of 5120 bytes.
+ -C size
+ (o mode only) Block output to records of size bytes.
+
-c (o mode only) Use the old POSIX portable character format.
Equivalent to --format odc.
-d (i and p modes) Create directories as necessary.
+ -E file
+ (i mode only) Read list of file name patterns from file to list
+ and extract.
+
+ -F file
+ Read archive from or write archive to file.
+
-f pattern
- (i mode only) Ignore files that match pattern. (Not yet imple-
- mented.)
+ (i mode only) Ignore files that match pattern.
--format format
(o mode only) Produce the output archive in the specified format.
@@ -57,25 +73,65 @@ OPTIONS
complete information about the formats currently supported by the
underlying libarchive(3) library.
+ -H format
+ Synonym for --format.
+
+ -h, --help
+ Print usage information.
+
+ -I file
+ Read archive from file.
+
-i Input mode. See above for description.
+ --insecure
+ (i and p mode only) Disable security checks during extraction or
+ copying. This allows extraction via symbolic links and path
+ names containing `..' in the name.
+
+ -J (o mode only) Compress the file with xz-compatible compression
+ before writing it. In input mode, this option is ignored; xz
+ compression is recognized automatically on input.
+
+ -j Synonym for -y.
+
-L (o and p modes) All symbolic links will be followed. Normally,
symbolic links are archived and copied as symbolic links. With
this option, the target of the link will be archived or copied
- instead. (Not yet implemented.)
+ instead.
-l (p mode only) Create links from the target directory to the orig-
inal files, instead of copying.
+ -lzma (o mode only) Compress the file with lzma-compatible compression
+ before writing it. In input mode, this option is ignored; lzma
+ compression is recognized automatically on input.
+
-m (i and p modes) Set file modification time on created files to
match those in the source.
+ -n (i mode, only with -t) Display numeric uid and gid. By default,
+ cpio displays the user and group names when they are provided in
+ the archive, or looks up the user and group names in the system
+ password database.
+
+ -no-preserve-owner
+ (i mode only) Do not attempt to restore file ownership. This is
+ the default when run by non-root users.
+
+ -O file
+ Write archive to file.
+
-o Output mode. See above for description.
-p Pass-through mode. See above for description.
+ -preserve-owner
+ (i mode only) Restore file ownership. This is the default when
+ run by the root user.
+
--quiet
- (Not yet implemented.)
+ Suppress unnecessary messages.
-R [user][:][group]
Set the owner and/or group on files in the output. If group is
@@ -108,12 +164,16 @@ OPTIONS
Print the program version information and exit.
-y (o mode only) Compress the archive with bzip2-compatible compres-
- sion before writing to stdout. In input mode, this option is
- ignored; bzip2 compression is recognized automatically on input.
+ sion before writing it. In input mode, this option is ignored;
+ bzip2 compression is recognized automatically on input.
+
+ -Z (o mode only) Compress the archive with compress-compatible com-
+ pression before writing it. In input mode, this option is
+ ignored; compression is recognized automatically on input.
-z (o mode only) Compress the archive with gzip-compatible compres-
- sion before writing it to stdout. In input mode, this option is
- ignored; gzip compression is recognized automatically on input.
+ sion before writing it. In input mode, this option is ignored;
+ gzip compression is recognized automatically on input.
ENVIRONMENT
The following environment variables affect the execution of cpio:
@@ -170,13 +230,11 @@ STANDARDS
HISTORY
The original cpio and find utilities were written by Dick Haight while
- working in AT&T's Unix Support Group. They first appeared in PWB/UNIX
- 1.0, the ``Programmer's Work Bench'' system developed for use within AT&T
- and released in 1977. XXX It was first released outside of AT&T as part
- of System III Unix in 1981. XXX XXX Need to verify the previous state-
- ment. XXX As a result, cpio actually predates tar, even though it was not
- well-known outside of AT&T until some time later. XXX When did cpio
- first appear in BSD? XXX
+ working in AT&T's Unix Support Group. They first appeared in 1977 in
+ PWB/UNIX 1.0, the ``Programmer's Work Bench'' system developed for use
+ within AT&T. They were first released outside of AT&T as part of System
+ III Unix in 1981. As a result, cpio actually predates tar, even though
+ it was not well-known outside of AT&T until some time later.
This is a complete re-implementation based on the libarchive(3) library.
@@ -189,11 +247,4 @@ BUGS
mats cannot support files over 4 gigabytes, except for the ``odc'' vari-
ant, which can support files up to 8 gigabytes.
- This is an early alpha version of cpio. The underlying libarchive
- library is quite mature, so the archive format support and creation of
- objects on disk should be robust. However, the cpio-specific options and
- features are still very new. Known issues that will be fixed soon:
- o Options documented above as ``Not yet implemented''.
- o Filter arguments to -i, and -it.
-
-FreeBSD 6.0 August 05, 2007 FreeBSD 6.0
+FreeBSD 8.0 December 21, 2007 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/bsdtar.1.txt b/archivers/libarchive/files/doc/text/bsdtar.1.txt
index 0340a12af81..b5d2148ed08 100644
--- a/archivers/libarchive/files/doc/text/bsdtar.1.txt
+++ b/archivers/libarchive/files/doc/text/bsdtar.1.txt
@@ -73,21 +73,27 @@ OPTIONS
following files. In x mode, change directories after opening the
archive but before extracting entries from the archive.
- --check-links (-W check-links)
+ --check-links
(c and r modes only) Issue a warning message unless all links to
each file are archived.
- --exclude pattern (-W exclude=pattern)
+ --chroot
+ (x mode only) chroot() to the current directory after processing
+ any -C options and before extracting any files.
+
+ --exclude pattern
Do not process files or directories that match the specified pat-
tern. Note that exclusions take precedence over patterns or
filenames specified on the command line.
- --format format (-W format=format)
- (c mode only) Use the specified format for the created archive.
- Supported formats include ``cpio'', ``pax'', ``shar'', and
- ``ustar''. Other formats may also be supported; see
+ --format format
+ (c, r, u mode only) Use the specified format for the created ar-
+ chive. Supported formats include ``cpio'', ``pax'', ``shar'',
+ and ``ustar''. Other formats may also be supported; see
libarchive-formats(5) for more information about currently-sup-
- ported formats.
+ ported formats. In r and u modes, when extending an existing ar-
+ chive, the format specified here must be compatible with the for-
+ mat of the existing archive on disk.
-f file
Read the archive from or write the archive to the specified file.
@@ -95,15 +101,6 @@ OPTIONS
not specified, the default tape device will be used. (On
FreeBSD, the default tape device is /dev/sa0.)
- --fast-read (-W fast-read)
- (x and t mode only) Extract or list only the first archive entry
- that matches each pattern or filename operand. Exit as soon as
- each specified pattern or filename has been matched. By default,
- the archive is always read to the very end, since there can be
- multiple entries with the same name and, by convention, later
- entries overwrite earlier entries. This option is provided as a
- performance optimization.
-
-H (c and r mode only) Symbolic links named on the command line will
be followed; the target of the link will be archived, not the
link itself.
@@ -112,7 +109,7 @@ OPTIONS
-I Synonym for -T.
- --include pattern (-W include=pattern)
+ --include pattern
Process only files or directories that match the specified pat-
tern. Note that exclusions specified with --exclude take prece-
dence over inclusions. If no inclusions are explicitly speci-
@@ -132,14 +129,15 @@ OPTIONS
a file appears more than once in an archive, later copies will
not overwrite earlier copies.
+ --keep-newer-files
+ (x mode only) Do not overwrite existing files that are newer than
+ the versions appearing in the archive being extracted.
+
-L (c and r mode only) All symbolic links will be followed. Nor-
mally, symbolic links are archived as such. With this option,
the target of the link will be archived instead.
- -l If POSIXLY_CORRECT is specified in the environment, this is a
- synonym for the --check-links option. Otherwise, an error will
- be displayed. Users who desire behavior compatible with GNU tar
- should use the --one-file-system option instead.
+ -l This is a synonym for the --check-links option.
-m (x mode only) Do not extract modification time. By default, the
modification time is set to the time stored in the archive.
@@ -147,46 +145,103 @@ OPTIONS
-n (c, r, u modes only) Do not recursively archive the contents of
directories.
- --newer date (-W newer=date)
+ --newer date
(c, r, u modes only) Only include files and directories newer
than the specified date. This compares ctime entries.
- --newer-mtime date (-W newer-mtime=date)
+ --newer-mtime date
(c, r, u modes only) Like --newer, except it compares mtime
entries instead of ctime entries.
- --newer-than file (-W newer-than=file)
+ --newer-than file
(c, r, u modes only) Only include files and directories newer
than the specified file. This compares ctime entries.
- --newer-mtime-than file (-W newer-mtime-than=file)
+ --newer-mtime-than file
(c, r, u modes only) Like --newer-than, except it compares mtime
entries instead of ctime entries.
- --nodump (-W nodump)
+ --nodump
(c and r modes only) Honor the nodump file flag by skipping this
file.
- --null (-W null)
- (use with -I, -T, or -X) Filenames or patterns are separated by
+ --null (use with -I, -T, or -X) Filenames or patterns are separated by
null characters, not by newlines. This is often used to read
filenames output by the -print0 option to find(1).
+ --numeric-owner
+ (x mode only) Ignore symbolic user and group names when restoring
+ archives to disk, only numeric uid and gid values will be obeyed.
+
-O (x, t modes only) In extract (-x) mode, files will be written to
standard out rather than being extracted to disk. In list (-t)
mode, the file listing will be written to stderr rather than the
usual stdout.
- -o (x mode only) Use the user and group of the user running the pro-
- gram rather than those specified in the archive. Note that this
- has no significance unless -p is specified, and the program is
- being run by the root user. In this case, the file modes and
- flags from the archive will be restored, but ACLs or owner infor-
- mation in the archive will be discarded.
+ -o (x mode) Use the user and group of the user running the program
+ rather than those specified in the archive. Note that this has
+ no significance unless -p is specified, and the program is being
+ run by the root user. In this case, the file modes and flags
+ from the archive will be restored, but ACLs or owner information
+ in the archive will be discarded.
+
+ -o (c, r, u mode) A synonym for --format ustar
- --one-file-system (-W one-file-system)
+ --one-file-system
(c, r, and u modes) Do not cross mount points.
+ --options options
+ Select optional behaviors for particular modules. The argument
+ is a text string containing comma-separated keywords and values.
+ These are passed to the modules that handle particular formats to
+ control how those formats will behave. Each option has one of
+ the following forms:
+ key=value
+ The key will be set to the specified value in every mod-
+ ule that supports it. Modules that do not support this
+ key will ignore it.
+ key The key will be enabled in every module that supports it.
+ This is equivalent to key=1.
+ !key The key will be disabled in every module that supports
+ it.
+ module:key=value, module:key, module:!key
+ As above, but the corresponding key and value will be
+ provided only to modules whose name matches module.
+ The currently supported modules and keys are:
+ iso9660:joliet
+ Support Joliet extensions. This is enabled by default,
+ use !joliet or iso9660:!joliet to disable.
+ iso9660:rockridge
+ Support Rock Ridge extensions. This is enabled by
+ default, use !rockridge or iso9660:!rockridge to disable.
+ gzip:compression-level
+ A decimal integer from 0 to 9 specifying the gzip com-
+ pression level.
+ xz:compression-level
+ A decimal integer from 0 to 9 specifying the xz compres-
+ sion level.
+ mtree:keyword
+ The mtree writer module allows you to specify which mtree
+ keywords will be included in the output. Supported key-
+ words include: cksum, device, flags, gid, gname, indent,
+ link, md5, mode, nlink, rmd160, sha1, sha256, sha384,
+ sha512, size, time, uid, uname. The default is equiva-
+ lent to: ``device, flags, gid, gname, link, mode, nlink,
+ size, time, type, uid, uname''.
+ mtree:all
+ Enables all of the above keywords. You can also use
+ mtree:!all to disable all keywords.
+ mtree:use-set
+ Enable generation of /set lines in the output.
+ mtree:indent
+ Produce human-readable output by indenting options and
+ splitting lines to fit into 80 columns.
+ zip:compression=type
+ Use type as compression method. Supported values are
+ store (uncompressed) and deflate (gzip algorithm).
+ If a provided option is not supported by any module, that is a
+ fatal error.
+
-P Preserve pathnames. By default, absolute pathnames (those that
begin with a / character) have the leading slash removed both
when creating archives and extracting from them. Also, tar will
@@ -203,11 +258,39 @@ OPTIONS
is being run by root, the default is to restore the owner unless
the -o option is also specified.
- --strip-components count (-W strip-components=count)
- (x and t mode only) Remove the specified number of leading path
- elements. Pathnames with fewer elements will be silently
- skipped. Note that the pathname is edited after checking inclu-
- sion/exclusion patterns but before security checks.
+ -q (--fast-read)
+ (x and t mode only) Extract or list only the first archive entry
+ that matches each pattern or filename operand. Exit as soon as
+ each specified pattern or filename has been matched. By default,
+ the archive is always read to the very end, since there can be
+ multiple entries with the same name and, by convention, later
+ entries overwrite earlier entries. This option is provided as a
+ performance optimization.
+
+ -S (x mode only) Extract files as sparse files. For every block on
+ disk, check first if it contains only NULL bytes and seek over it
+ otherwise. This works similiar to the conv=sparse option of dd.
+
+ --strip-components count
+ (x mode only) Remove the specified number of leading path ele-
+ ments. Pathnames with fewer elements will be silently skipped.
+ Note that the pathname is edited after checking inclusion/exclu-
+ sion patterns but before security checks.
+
+ -s pattern
+ Modify file or archive member names according to pattern. The
+ pattern has the format /old/new/[gps] where old is a basic regu-
+ lar expression, new is the replacement string of the matched
+ part, and the optional trailing letters modify how the replace-
+ ment is handled. If old is not matched, the pattern is skipped.
+ Within new, ~ is substituted with the match, 1 to 9 with the con-
+ tent of the corresponding captured group. The optional trailing
+ g specifies that matching should continue after the matched part
+ and stopped on the first unmatched pattern. The optional trail-
+ ing s specifies that the pattern applies to the value of symbolic
+ links. The optional trailing p specifies that after a successful
+ substitution the original path name and the new path name should
+ be printed to standard error.
-T filename
In x or t mode, tar will read the list of names to be extracted
@@ -233,11 +316,8 @@ OPTIONS
In list mode, tar will produce output similar to that of ls(1).
Additional -v options will provide additional detail.
- -W longopt=value
- Long options (preceded by --) are only supported directly on sys-
- tems that have the getopt_long(3) function. The -W option can be
- used to access long options on systems that do not support this
- function.
+ --version
+ Print version of tar and libarchive, and exit.
-w Ask for confirmation for every action.
@@ -255,16 +335,16 @@ OPTIONS
other tar implementations, this implementation recognizes gzip
compression automatically when reading archives.
+ -Z (c mode only) Compress the resulting archive with compress(1).
+ In extract or list modes, this option is ignored. Note that,
+ unlike other tar implementations, this implementation recognizes
+ compress compression automatically when reading archives.
+
ENVIRONMENT
The following environment variables affect the execution of tar:
LANG The locale to use. See environ(7) for more information.
- POSIXLY_CORRECT
- If this environment variable is defined, the -l option will be
- interpreted in accordance with ISO/IEC 9945-1:1996
- (``POSIX.1'').
-
TAPE The default tape device. The -f option overrides this.
TZ The timezone to use when displaying dates. See environ(7) for
@@ -306,10 +386,30 @@ EXAMPLES
Finally, it will switch to the /tmp directory and add foo2 to the output
archive.
+ An input file in mtree(5) format can be used to create an output archive
+ with arbitrary ownership, permissions, or names that differ from existing
+ data on disk:
+
+ $ cat input.mtree
+ #mtree
+ usr/bin uid=0 gid=0 mode=0755 type=dir
+ usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
+ $ tar -cvf output.tar @input.mtree
+
The --newer and --newer-mtime switches accept a variety of common date
and time specifications, including ``12 Mar 2005 7:14:29pm'',
``2005-03-12 19:14'', ``5 minutes ago'', and ``19:14 PST May 1''.
+ The --options argument can be used to control various details of archive
+ generation or reading. For example, you can generate mtree output which
+ only contains type, time, and uid keywords:
+ tar -cf file.tar --format=mtree --options='!all,type,time,uid' dir
+ or you can set the compression level used by gzip or xz compression:
+ tar -czf file.tar --options='compression-level=9'.
+ For more details, see the explanation of the archive_read_set_options()
+ and archive_write_set_options() API calls that are described in
+ archive_read(3) and archive_write(3).
+
COMPATIBILITY
The bundled-arguments format is supported for compatibility with historic
implementations. It consists of an initial word (with no leading - char-
@@ -329,8 +429,8 @@ COMPATIBILITY
argument format above, should limit themselves to the c, t, and x modes,
and the b, f, m, v, and w options.
- On systems that support getopt_long(), additional long options are avail-
- able to improve compatibility with other tar implementations.
+ Additional long options are provided to improve compatibility with other
+ tar implementations.
SECURITY
Certain security issues are common to many archiving programs, including
@@ -371,8 +471,8 @@ SECURITY
ries.
SEE ALSO
- bzip2(1), cpio(1), gzip(1), mt(1), pax(1), shar(1), libarchive(3),
- libarchive-formats(5), tar(5)
+ bzip2(1), compress(1), cpio(1), gzip(1), mt(1), pax(1), shar(1),
+ libarchive(3), libarchive-formats(5), tar(5)
STANDARDS
There is no current POSIX standard for the tar command; it appeared in
@@ -396,10 +496,9 @@ HISTORY
This is a complete re-implementation based on the libarchive(3) library.
BUGS
- POSIX and GNU violently disagree about the meaning of the -l option.
- Because of the potential for disaster if someone expects one behavior and
- gets the other, the -l option is deliberately broken in this implementa-
- tion.
+ This program follows ISO/IEC 9945-1:1996 (``POSIX.1'') for the definition
+ of the -l option. Note that GNU tar prior to version 1.15 treated -l as
+ a synonym for the --one-file-system option.
The -C dir option may differ from historic implementations.
@@ -447,4 +546,4 @@ BUGS
There are alternative long options for many of the short options that are
deliberately not documented.
-FreeBSD 6.0 April 13, 2004 FreeBSD 6.0
+FreeBSD 8.0 Oct 12, 2009 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/cpio.5.txt b/archivers/libarchive/files/doc/text/cpio.5.txt
index db5da1e9c9b..5ece811eda3 100644
--- a/archivers/libarchive/files/doc/text/cpio.5.txt
+++ b/archivers/libarchive/files/doc/text/cpio.5.txt
@@ -91,7 +91,7 @@ DESCRIPTION
namesize
The number of bytes in the pathname that follows the header.
- This count includes the trailing NULL byte.
+ This count includes the trailing NUL byte.
filesize
The size of the file. Note that this archive format is limited
@@ -99,8 +99,8 @@ DESCRIPTION
of the storage of four-byte integers.
The pathname immediately follows the fixed header. If the namesize is
- odd, an additional NULL byte is added after the pathname. The file data
- is then appended, padded with NULL bytes to an even length.
+ odd, an additional NUL byte is added after the pathname. The file data
+ is then appended, padded with NUL bytes to an even length.
Hardlinked files are not given special treatment; the full file contents
are included with each copy of the file.
@@ -130,7 +130,7 @@ DESCRIPTION
file body follow the fixed header. Unlike the old binary format, there
is no additional padding after the pathname or file contents. If the
files being archived are themselves entirely ASCII, then the resulting
- archive will be entirely ASCII, except for the NULL byte that terminates
+ archive will be entirely ASCII, except for the NUL byte that terminates
the name field.
New ASCII Format
@@ -163,11 +163,11 @@ DESCRIPTION
check This field is always set to zero by writers and ignored by read-
ers. See the next section for more details.
- The pathname is followed by NULL bytes so that the total size of the
- fixed header plus pathname is a multiple of four. Likewise, the file
- data is padded to a multiple of four bytes. Note that this format sup-
- ports only 4 gigabyte files (unlike the older ASCII format, which sup-
- ports 8 gigabyte files).
+ The pathname is followed by NUL bytes so that the total size of the fixed
+ header plus pathname is a multiple of four. Likewise, the file data is
+ padded to a multiple of four bytes. Note that this format supports only
+ 4 gigabyte files (unlike the older ASCII format, which supports 8 giga-
+ byte files).
In this format, hardlinked files are handled by setting the filesize to
zero for each entry except the last one that appears in the archive.
@@ -232,4 +232,4 @@ HISTORY
appear? Who invented it? When did HP come out with their variant? When
did Sun introduce ACLs and extended attributes? XXX
-FreeBSD 6.0 October 5, 2007 FreeBSD 6.0
+FreeBSD 8.0 October 5, 2007 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/libarchive-formats.5.txt b/archivers/libarchive/files/doc/text/libarchive-formats.5.txt
index 35eb2783bab..9e6523db230 100644
--- a/archivers/libarchive/files/doc/text/libarchive-formats.5.txt
+++ b/archivers/libarchive/files/doc/text/libarchive-formats.5.txt
@@ -1,4 +1,4 @@
-libarchive-formats(3) FreeBSD Library Functions Manual libarchive-formats(3)
+libarchive-formats(5) FreeBSD File Formats Manual libarchive-formats(5)
NAME
libarchive-formats -- archive formats supported by the libarchive library
@@ -14,7 +14,8 @@ DESCRIPTION
tions of the current library support. Note that just because a format is
supported by libarchive does not imply that a program that uses
libarchive will support that format. Applications that use libarchive
- specify which formats they wish to support.
+ specify which formats they wish to support, though many programs do use
+ libarchive convenience functions to enable all supported formats.
Tar Formats
The libarchive(3) library can read most tar archives. However, it only
@@ -39,17 +40,19 @@ DESCRIPTION
pax The libarchive(3) library can read and write POSIX-compliant pax
interchange format archives. Pax interchange format archives are
an extension of the older ustar format that adds a separate entry
- with additional attributes stored as key/value pairs. The pres-
- ence of this additional entry is the only difference between pax
- interchange format and the older ustar format. The extended
- attributes are of unlimited length and are stored as UTF-8 Uni-
- code strings. Keywords defined in the standard are in all lower-
- case; vendors are allowed to define custom keys by preceding them
- with the vendor name in all uppercase. When writing pax ar-
- chives, libarchive uses many of the SCHILY keys defined by Joerg
- Schilling's ``star'' archiver. The libarchive library can read
- most of the SCHILY keys. It silently ignores any keywords that
- it does not understand.
+ with additional attributes stored as key/value pairs immediately
+ before each regular entry. The presence of these additional
+ entries is the only difference between pax interchange format and
+ the older ustar format. The extended attributes are of unlimited
+ length and are stored as UTF-8 Unicode strings. Keywords defined
+ in the standard are in all lowercase; vendors are allowed to
+ define custom keys by preceding them with the vendor name in all
+ uppercase. When writing pax archives, libarchive uses many of
+ the SCHILY keys defined by Joerg Schilling's ``star'' archiver
+ and a few LIBARCHIVE keys. The libarchive library can read most
+ of the SCHILY keys and most of the GNU keys introduced by GNU
+ tar. It silently ignores any keywords that it does not under-
+ stand.
restricted pax
The libarchive library can also write pax archives in which it
@@ -76,14 +79,28 @@ DESCRIPTION
bytes.
o Extended attributes, file flags, and other extended security
information cannot be stored.
- o Archive entries are limited to 2 gigabytes in size.
+ o Archive entries are limited to 8 gigabytes in size.
Note that the pax interchange format has none of these restric-
tions.
- The libarchive library can also read a variety of commonly-used exten-
- sions to the basic tar format. In particular, it supports base-256 val-
- ues in certain numeric fields. This essentially removes the limitations
- on file size, modification time, and device numbers.
+ The libarchive library also reads a variety of commonly-used extensions
+ to the basic tar format. These extensions are recognized automatically
+ whenever they appear.
+
+ Numeric extensions.
+ The POSIX standards require fixed-length numeric fields to be
+ written with some character position reserved for terminators.
+ Libarchive allows these fields to be written without terminator
+ characters. This extends the allowable range; in particular,
+ ustar archives with this extension can support entries up to 64
+ gigabytes in size. Libarchive also recognizes base-256 values in
+ most numeric fields. This essentially removes all limitations on
+ file size, modification time, and device numbers.
+
+ Solaris extensions
+ Libarchive recognizes ACL and extended attribute records written
+ by Solaris tar. Currently, libarchive only has support for old-
+ style ACLs; the newer NFSv4 ACLs are recognized but discarded.
The first tar program appeared in Seventh Edition Unix in 1979. The
first official standard for the tar file format was the ``ustar'' (Unix
@@ -94,22 +111,25 @@ DESCRIPTION
The libarchive library can read a number of common cpio variants and can
write ``odc'' and ``newc'' format archives. A cpio archive stores each
entry as a fixed-size header followed by a variable-length filename and
- variable-length data. Unlike tar, cpio does only minimal padding of the
- header or file data. There are a variety of cpio formats, which differ
- primarily in how they store the initial header: some store the values as
- octal or hexadecimal numbers in ASCII, others as binary values of varying
- byte order and length.
+ variable-length data. Unlike the tar format, the cpio format does only
+ minimal padding of the header or file data. There are several cpio vari-
+ ants, which differ primarily in how they store the initial header: some
+ store the values as octal or hexadecimal numbers in ASCII, others as
+ binary values of varying byte order and length.
- binary The libarchive library can read both big-endian and little-endian
- variants of the original binary cpio format. This format used
- 32-bit binary values for file size and mtime, and 16-bit binary
- values for the other fields.
+ binary The libarchive library transparently reads both big-endian and
+ little-endian variants of the original binary cpio format. This
+ format used 32-bit binary values for file size and mtime, and
+ 16-bit binary values for the other fields.
odc The libarchive library can both read and write this POSIX-stan-
- dard format. This format stores the header contents as octal
- values in ASCII. It is standard, portable, and immune from byte-
- order confusion. File sizes and mtime are limited to 33 bits
- (8GB file size), other fields are limited to 18 bits.
+ dard format, which is officially known as the ``cpio interchange
+ format'' or the ``octet-oriented cpio archive format'' and some-
+ times unofficially referred to as the ``old character format''.
+ This format stores the header contents as octal values in ASCII.
+ It is standard, portable, and immune from byte-order confusion.
+ File sizes and mtime are limited to 33 bits (8GB file size),
+ other fields are limited to 18 bits.
SVR4 The libarchive library can read both CRC and non-CRC variants of
this format. The SVR4 format uses eight-digit hexadecimal values
@@ -155,26 +175,67 @@ DESCRIPTION
ISO9660 format
Libarchive can read and extract from files containing ISO9660-compliant
- CDROM images. It also has partial support for Rockridge extensions. In
- many cases, this can remove the need to burn a physical CDROM. It also
- avoids security and complexity issues that come with virtual mounts and
- loopback devices.
+ CDROM images. In many cases, this can remove the need to burn a physical
+ CDROM just in order to read the files contained in an ISO9660 image. It
+ also avoids security and complexity issues that come with virtual mounts
+ and loopback devices. Libarchive supports the most common Rockridge
+ extensions and has partial support for Joliet extensions. If both exten-
+ sions are present, the Joliet extensions will be used and the Rockridge
+ extensions will be ignored. In particular, this can create problems with
+ hardlinks and symlinks, which are supported by Rockridge but not by
+ Joliet.
Zip format
- Libarchive can extract from most zip format archives. It currently only
- supports uncompressed entries and entries compressed with the ``deflate''
- algorithm. Older zip compression algorithms are not supported.
+ Libarchive can read and write zip format archives that have uncompressed
+ entries and entries compressed with the ``deflate'' algorithm. Older zip
+ compression algorithms are not supported. It can extract jar archives,
+ archives that use Zip64 extensions and many self-extracting zip archives.
+ Libarchive reads Zip archives as they are being streamed, which allows it
+ to read archives of arbitrary size. It currently does not use the cen-
+ tral directory; this limits libarchive's ability to support some self-
+ extracting archives and ones that have been modified in certain ways.
Archive (library) file format
The Unix archive format (commonly created by the ar(1) archiver) is a
general-purpose format which is used almost exclusively for object files
to be read by the link editor ld(1). The ar format has never been stan-
dardised. There are two common variants: the GNU format derived from
- SVR4, and the BSD format, which first appeared in 4.4BSD. Libarchive
- provides read and write support for both variants.
+ SVR4, and the BSD format, which first appeared in 4.4BSD. The two differ
+ primarily in their handling of filenames longer than 15 characters: the
+ GNU/SVR4 variant writes a filename table at the beginning of the archive;
+ the BSD format stores each long filename in an extension area adjacent to
+ the entry. Libarchive can read both extensions, including archives that
+ may include both types of long filenames. Programs using libarchive can
+ write GNU/SVR4 format if they provide a filename table to be written into
+ the archive before any of the entries. Any entries whose names are not
+ in the filename table will be written using BSD-style long filenames.
+ This can cause problems for programs such as GNU ld that do not support
+ the BSD-style long filenames.
+
+ mtree
+ Libarchive can read and write files in mtree(5) format. This format is
+ not a true archive format, but rather a textual description of a file
+ hierarchy in which each line specifies the name of a file and provides
+ specific metadata about that file. Libarchive can read all of the key-
+ words supported by both the NetBSD and FreeBSD versions of mtree(1),
+ although many of the keywords cannot currently be stored in an
+ archive_entry object. When writing, libarchive supports use of the
+ archive_write_set_options(3) interface to specify which keywords should
+ be included in the output. If libarchive was compiled with access to
+ suitable cryptographic libraries (such as the OpenSSL libraries), it can
+ compute hash entries such as sha512 or md5 from file data being written
+ to the mtree writer.
+
+ When reading an mtree file, libarchive will locate the corresponding
+ files on disk using the contents keyword if present or the regular file-
+ name. If it can locate and open the file on disk, it will use that to
+ fill in any metadata that is missing from the mtree file and will read
+ the file contents and return those to the program using libarchive. If
+ it cannot locate and open the file on disk, libarchive will return an
+ error for any attempt to read the entry body.
SEE ALSO
ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5),
mtree(5), tar(5)
-FreeBSD 6.0 April 27, 2004 FreeBSD 6.0
+FreeBSD 8.0 December 27, 2009 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/libarchive.3.txt b/archivers/libarchive/files/doc/text/libarchive.3.txt
index f4925f08ae8..f00d9778372 100644
--- a/archivers/libarchive/files/doc/text/libarchive.3.txt
+++ b/archivers/libarchive/files/doc/text/libarchive.3.txt
@@ -182,4 +182,4 @@ BUGS
formats do not support nanosecond timestamps; old tar formats do not sup-
port large device numbers.
-FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
+FreeBSD 8.0 August 19, 2006 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/libarchive_internals.3.txt b/archivers/libarchive/files/doc/text/libarchive_internals.3.txt
index 4e398a1b3dc..e5e65bdcb8c 100644
--- a/archivers/libarchive/files/doc/text/libarchive_internals.3.txt
+++ b/archivers/libarchive/files/doc/text/libarchive_internals.3.txt
@@ -245,4 +245,4 @@ AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
BUGS
-FreeBSD 6.0 April 16, 2007 FreeBSD 6.0
+FreeBSD 8.0 April 16, 2007 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/mtree.5.txt b/archivers/libarchive/files/doc/text/mtree.5.txt
index 1e5eb4f42b0..375e4a2bfeb 100644
--- a/archivers/libarchive/files/doc/text/mtree.5.txt
+++ b/archivers/libarchive/files/doc/text/mtree.5.txt
@@ -1,12 +1,12 @@
MTREE(5) FreeBSD File Formats Manual MTREE(5)
NAME
- mtree -- format of mtree dir heirarchy files
+ mtree -- format of mtree dir hierarchy files
DESCRIPTION
The mtree format is a textual format that describes a collection of
filesystem objects. Such files are typically used to create or verify
- directory heirarchies.
+ directory hierarchies.
General Format
An mtree file consists of a series of lines, each providing information
@@ -66,7 +66,7 @@ DESCRIPTION
Keywords
After the filename, a full or relative entry consists of zero or more
- whitespace-separated keyword definitions. Each such definitions consists
+ whitespace-separated keyword definitions. Each such definition consists
of a key from the following list immediately followed by an '=' sign and
a value. Software programs reading mtree files should warn about unrec-
ognized keywords.
@@ -76,31 +76,32 @@ DESCRIPTION
cksum The checksum of the file using the default algorithm speci-
fied by the cksum(1) utility.
- contents The full pathname of a file whose contents should be compared
- to the contents of this file.
+ contents The full pathname of a file that holds the contents of this
+ file.
flags The file flags as a symbolic name. See chflags(1) for infor-
mation on these names. If no flags are to be set the string
``none'' may be used to override the current default.
- ignore Ignore any file hierarchy below this file.
-
gid The file group as a numeric value.
gname The file group as a symbolic name.
+ ignore Ignore any file hierarchy below this file.
+
+ link The target of the symbolic link when type=link.
+
md5 The MD5 message digest of the file.
md5digest A synonym for md5.
- sha1 The FIPS 160-1 (``SHA-1'') message digest of the file.
-
- sha1digest A synonym for sha1.
+ mode The current file's permissions as a numeric (octal) or sym-
+ bolic value.
- sha256 The FIPS 180-2 (``SHA-256'') message digest of the file.
+ nlink The number of hard links the file is expected to have.
- sha256digest
- A synonym for sha256.
+ nochange Make sure this file or directory exists but otherwise ignore
+ all attributes.
ripemd160digest
The RIPEMD160 message digest of the file.
@@ -110,22 +111,17 @@ DESCRIPTION
rmd160digest
A synonym for ripemd160digest.
- mode The current file's permissions as a numeric (octal) or sym-
- bolic value.
-
- nlink The number of hard links the file is expected to have.
+ sha1 The FIPS 160-1 (``SHA-1'') message digest of the file.
- nochange Make sure this file or directory exists but otherwise ignore
- all attributes.
+ sha1digest A synonym for sha1.
- uid The file owner as a numeric value.
+ sha256 The FIPS 180-2 (``SHA-256'') message digest of the file.
- uname The file owner as a symbolic name.
+ sha256digest
+ A synonym for sha256.
size The size, in bytes, of the file.
- link The file the symbolic link is expected to reference.
-
time The last modification time of the file.
type The type of the file; may be set to any one of the following:
@@ -138,6 +134,10 @@ DESCRIPTION
link symbolic link
socket socket
+ uid The file owner as a numeric value.
+
+ uname The file owner as a symbolic name.
+
SEE ALSO
cksum(1), find(1), mtree(8)
@@ -155,4 +155,4 @@ HISTORY
added in FreeBSD 4.0, and mostly comes from NetBSD. The ``full'' entry
format was added by NetBSD.
-FreeBSD 6.0 August 20, 2007 FreeBSD 6.0
+FreeBSD 8.0 August 20, 2007 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/text/tar.5.txt b/archivers/libarchive/files/doc/text/tar.5.txt
index 24b77e15984..d110436fd34 100644
--- a/archivers/libarchive/files/doc/text/tar.5.txt
+++ b/archivers/libarchive/files/doc/text/tar.5.txt
@@ -1,4 +1,4 @@
-TAR(5) FreeBSD File Formats Manual TAR(5)
+tar(5) FreeBSD File Formats Manual tar(5)
NAME
tar -- format of tape archive files
@@ -20,18 +20,20 @@ DESCRIPTION
For compatibility with tape drives that use fixed block sizes, programs
that read or write tar files always read or write a fixed number of
records with each I/O operation. These ``blocks'' are always a multiple
- of the record size. The most common block size--and the maximum sup-
- ported by historic implementations--is 10240 bytes or 20 records. (Note:
- the terms ``block'' and ``record'' here are not entirely standard; this
- document follows the convention established by John Gilmore in document-
- ing pdtar.)
+ of the record size. The maximum block size supported by early implemen-
+ tations was 10240 bytes or 20 records. This is still the default for
+ most implementations although block sizes of 1MiB (2048 records) or
+ larger are commonly used with modern high-speed tape drives. (Note: the
+ terms ``block'' and ``record'' here are not entirely standard; this docu-
+ ment follows the convention established by John Gilmore in documenting
+ pdtar.)
Old-Style Archive Format
The original tar archive format has been extended many times to include
additional information that various implementors found necessary. This
section describes the variant implemented by the tar command included in
- Version 7 AT&T UNIX, which is one of the earliest widely-used versions of
- the tar program.
+ Version 7 AT&T UNIX, which seems to be the earliest widely-used version
+ of the tar program.
The header record for an old-style tar archive consists of the following:
@@ -143,7 +145,7 @@ DESCRIPTION
typeflag
Type of entry. POSIX extended the earlier linkflag field with
several new type values:
- ``0'' Regular file. NULL should be treated as a synonym, for
+ ``0'' Regular file. NUL should be treated as a synonym, for
compatibility purposes.
``1'' Hard link.
``2'' Symbolic link.
@@ -167,7 +169,7 @@ DESCRIPTION
allocate directory space. For all other types, it should be set
to zero by writers and ignored by readers.
- magic Contains the magic value ``ustar'' followed by a NULL byte to
+ magic Contains the magic value ``ustar'' followed by a NUL byte to
indicate that this is a POSIX standard archive. Full compliance
requires the uname and gname fields be properly set.
@@ -184,22 +186,25 @@ DESCRIPTION
Major and minor numbers for character device or block device
entry.
- prefix First part of pathname. If the pathname is too long to fit in
- the 100 bytes provided by the standard format, it can be split at
- any / character with the first portion going here. If the prefix
- field is not empty, the reader will prepend the prefix value and
- a / character to the regular name field to obtain the full path-
- name.
+ name, prefix
+ If the pathname is too long to fit in the 100 bytes provided by
+ the standard format, it can be split at any / character with the
+ first portion going into the prefix field. If the prefix field
+ is not empty, the reader will prepend the prefix value and a /
+ character to the regular name field to obtain the full pathname.
+ The standard does not require a trailing / character on directory
+ names, though most implementations still include this for compat-
+ ibility reasons.
- Note that all unused bytes must be set to NULL.
+ Note that all unused bytes must be set to NUL.
Field termination is specified slightly differently by POSIX than by pre-
vious implementations. The magic, uname, and gname fields must have a
- trailing NULL. The pathname, linkname, and prefix fields must have a
- trailing NULL unless they fill the entire field. (In particular, it is
+ trailing NUL. The pathname, linkname, and prefix fields must have a
+ trailing NUL unless they fill the entire field. (In particular, it is
possible to store a 256-character pathname if it happens to have a / as
the 156th character.) POSIX requires numeric fields to be zero-padded in
- the front, and allows them to be terminated with either space or NULL
+ the front, and requires them to be terminated with either space or NUL
characters.
Currently, most tar implementations comply with the ustar format, occa-
@@ -276,6 +281,12 @@ DESCRIPTION
SCHILY.devminor, SCHILY.devmajor
The full minor and major numbers for device nodes.
+ SCHILY.fflags
+ The file flags.
+
+ SCHILY.realsize
+ The full size of the file on disk. XXX explain? XXX
+
SCHILY.dev, SCHILY.ino, SCHILY.nlinks
The device number, inode number, and link count for the entry.
In particular, note that a pax interchange format archive using
@@ -408,9 +419,7 @@ DESCRIPTION
extracting, GNU tar checks that the header file name is
the one it is expecting, that the header offset is in the
correct sequence, and that the sum of offset and size is
- equal to realsize. FreeBSD's version of GNU tar does not
- handle the corner case of an archive's being continued in
- the middle of a long name or other extension header.
+ equal to realsize.
N Type "N" records are no longer generated by GNU tar.
They contained a list of files to be renamed or symlinked
@@ -419,7 +428,8 @@ DESCRIPTION
description of the operations to be done, in the form
``Rename %s to %s\n'' or ``Symlink %s to %s\n''; in
either case, both filenames are escaped using K&R C syn-
- tax.
+ tax. Due to security concerns, "N" records are now gen-
+ erally ignored when reading archives.
S This is a ``sparse'' regular file. Sparse files are
stored as a series of fragments. The header contains a
@@ -478,6 +488,43 @@ DESCRIPTION
entry; the realsize field will indicate the total size of the
file.
+ GNU tar pax archives
+ GNU tar 1.14 (XXX check this XXX) and later will write pax interchange
+ format archives when you specify the --posix flag. This format uses cus-
+ tom keywords to store sparse file information. There have been three
+ iterations of this support, referred to as ``0.0'', ``0.1'', and ``1.0''.
+
+ GNU.sparse.numblocks, GNU.sparse.offset, GNU.sparse.numbytes,
+ GNU.sparse.size
+ The ``0.0'' format used an initial GNU.sparse.numblocks attribute
+ to indicate the number of blocks in the file, a pair of
+ GNU.sparse.offset and GNU.sparse.numbytes to indicate the offset
+ and size of each block, and a single GNU.sparse.size to indicate
+ the full size of the file. This is not the same as the size in
+ the tar header because the latter value does not include the size
+ of any holes. This format required that the order of attributes
+ be preserved and relied on readers accepting multiple appearances
+ of the same attribute names, which is not officially permitted by
+ the standards.
+
+ GNU.sparse.map
+ The ``0.1'' format used a single attribute that stored a comma-
+ separated list of decimal numbers. Each pair of numbers indi-
+ cated the offset and size, respectively, of a block of data.
+ This does not work well if the archive is extracted by an
+ archiver that does not recognize this extension, since many pax
+ implementations simply discard unrecognized attributes.
+
+ GNU.sparse.major, GNU.sparse.minor, GNU.sparse.name, GNU.sparse.realsize
+ The ``1.0'' format stores the sparse block map in one or more
+ 512-byte blocks prepended to the file data in the entry body.
+ The pax attributes indicate the existence of this map (via the
+ GNU.sparse.major and GNU.sparse.minor fields) and the full size
+ of the file. The GNU.sparse.name holds the true name of the
+ file. To avoid confusion, the name stored in the regular tar
+ header is a modified name so that extraction errors will be
+ apparent to users.
+
Solaris Tar
XXX More Details Needed XXX
@@ -490,26 +537,43 @@ DESCRIPTION
entry.
o An additional A entry is used to store an ACL for the following
regular entry. The body of this entry contains a seven-digit
- octal number (whose value is 01000000 plus the number of ACL
- entries) followed by a zero byte, followed by the textual ACL
- description.
+ octal number followed by a zero byte, followed by the textual ACL
+ description. The octal value is the number of ACL entries plus a
+ constant that indicates the ACL type: 01000000 for POSIX.1e ACLs
+ and 03000000 for NFSv4 ACLs.
+
+ AIX Tar
+ XXX More details needed XXX
+
+ Mac OS X Tar
+ The tar distributed with Apple's Mac OS X stores most regular files as
+ two separate entries in the tar archive. The two entries have the same
+ name except that the first one has ``._'' added to the beginning of the
+ name. This first entry stores the ``resource fork'' with additional
+ attributes for the file. The Mac OS X CopyFile() API is used to separate
+ a file on disk into separate resource and data streams and to reassemble
+ those separate streams when the file is restored to disk.
Other Extensions
- One common extension, utilized by GNU tar, star, and other newer tar
- implementations, permits binary numbers in the standard numeric fields.
- This is flagged by setting the high bit of the first character. This
- permits 95-bit values for the length and time fields and 63-bit values
- for the uid, gid, and device numbers. GNU tar supports this extension
- for the length, mtime, ctime, and atime fields. Joerg Schilling's star
- program supports this extension for all numeric fields. Note that this
- extension is largely obsoleted by the extended attribute record provided
- by the pax interchange format.
+ One obvious extension to increase the size of files is to eliminate the
+ terminating characters from the various numeric fields. For example, the
+ standard only allows the size field to contain 11 octal digits, reserving
+ the twelfth byte for a trailing NUL character. Allowing 12 octal digits
+ allows file sizes up to 64 GB.
+
+ Another extension, utilized by GNU tar, star, and other newer tar imple-
+ mentations, permits binary numbers in the standard numeric fields. This
+ is flagged by setting the high bit of the first byte. This permits
+ 95-bit values for the length and time fields and 63-bit values for the
+ uid, gid, and device numbers. GNU tar supports this extension for the
+ length, mtime, ctime, and atime fields. Joerg Schilling's star program
+ supports this extension for all numeric fields. Note that this extension
+ is largely obsoleted by the extended attribute record provided by the pax
+ interchange format.
Another early GNU extension allowed base-64 values rather than octal.
- This extension was short-lived and such archives are almost never seen.
- However, there is still code in GNU tar to support them; this code is
- responsible for a very cryptic warning message that is sometimes seen
- when GNU tar encounters a damaged archive.
+ This extension was short-lived and is no longer supported by any imple-
+ mentation.
SEE ALSO
ar(1), pax(1), tar(1)
@@ -527,8 +591,11 @@ HISTORY
January, 1979. It replaced the tp program from Fourth Edition Unix which
in turn replaced the tap program from First Edition Unix. John Gilmore's
pdtar public-domain implementation (circa 1987) was highly influential
- and formed the basis of GNU tar. Joerg Shilling's star archiver is
- another open-source (GPL) archiver (originally developed circa 1985)
- which features complete support for pax interchange format.
+ and formed the basis of GNU tar (circa 1988). Joerg Shilling's star
+ archiver is another open-source (GPL) archiver (originally developed
+ circa 1985) which features complete support for pax interchange format.
+
+ This documentation was written as part of the libarchive and bsdtar
+ project by Tim Kientzle <kientzle@FreeBSD.org>.
-FreeBSD 6.0 May 20, 2004 FreeBSD 6.0
+FreeBSD 8.0 December 27, 2009 FreeBSD 8.0
diff --git a/archivers/libarchive/files/doc/update.sh b/archivers/libarchive/files/doc/update.sh
index 644b90a9a2d..1427d70e560 100755
--- a/archivers/libarchive/files/doc/update.sh
+++ b/archivers/libarchive/files/doc/update.sh
@@ -5,43 +5,103 @@
# the mdoc man pages stored in each project.
#
-# Remove existing manpages from the doc tree
-chmod -R +w man text
-rm -f man/*.[135]
-rm -f text/*.[135]
+# Collect list of man pages, relative to my subdirs
+cd man
+MANPAGES=`for d in libarchive tar cpio;do ls ../../$d/*.[135];done | grep -v '\.so\.'`
+cd ..
# Build Makefile in 'man' directory
cd man
+rm -f *.[135]
echo > Makefile
echo "default: all" >>Makefile
echo >>Makefile
all="all:"
-for d in libarchive tar cpio; do
- for f in ../../$d/*.[135]; do
- echo >> Makefile
- echo `basename $f`: ../mdoc2man.awk $f >> Makefile
- echo " awk -f ../mdoc2man.awk < $f > `basename $f`" >> Makefile
- all="$all `basename $f`"
- done
+for f in $MANPAGES; do
+ outname="`basename $f`"
+ echo >> Makefile
+ echo $outname: ../mdoc2man.awk $f >> Makefile
+ echo " awk -f ../mdoc2man.awk < $f > $outname" >> Makefile
+ all="$all $outname"
done
echo $all >>Makefile
cd ..
# Rebuild Makefile in 'text' directory
cd text
+rm -f *.txt
echo > Makefile
-echo "$all" >>Makefile
+echo "default: all" >>Makefile
echo >>Makefile
-for d in libarchive tar cpio; do
- for f in ../../$d/*.[135]; do
- echo >> Makefile
- echo `basename $f`: $f >> Makefile
- echo " nroff -mdoc $f | col -b > `basename $f`" >> Makefile
- done
+all="all:"
+for f in $MANPAGES; do
+ outname="`basename $f`.txt"
+ echo >> Makefile
+ echo $outname: $f >> Makefile
+ echo " nroff -mdoc $f | col -b > $outname" >> Makefile
+ all="$all $outname"
done
+echo $all >>Makefile
+cd ..
+
+# Rebuild Makefile in 'pdf' directory
+cd pdf
+rm -f *.pdf
+echo > Makefile
+echo "default: all" >>Makefile
+echo >>Makefile
+all="all:"
+for f in $MANPAGES; do
+ outname="`basename $f`.pdf"
+ echo >> Makefile
+ echo $outname: $f >> Makefile
+ echo " groff -mdoc -T ps $f | ps2pdf - - > $outname" >> Makefile
+ all="$all $outname"
+done
+echo $all >>Makefile
+cd ..
+
+# Build Makefile in 'html' directory
+cd html
+rm -f *.html
+echo > Makefile
+echo "default: all" >>Makefile
+echo >>Makefile
+all="all:"
+for f in $MANPAGES; do
+ outname="`basename $f`.html"
+ echo >> Makefile
+ echo $outname: ../mdoc2man.awk $f >> Makefile
+ echo " groff -mdoc -T html $f > $outname" >> Makefile
+ all="$all $outname"
+done
+echo $all >>Makefile
+cd ..
+
+# Build Makefile in 'wiki' directory
+cd wiki
+rm -f *.wiki
+echo > Makefile
+echo "default: all" >>Makefile
+echo >>Makefile
+all="all:"
+for f in $MANPAGES; do
+ outname="`basename $f | awk '{ac=split($0,a,"[_.-]");o="ManPage";for(w=0;w<=ac;++w){o=o toupper(substr(a[w],1,1)) substr(a[w],2)};print o}'`.wiki"
+ echo >> Makefile
+ echo $outname: ../mdoc2wiki.awk $f >> Makefile
+ echo " awk -f ../mdoc2wiki.awk < $f > $outname" >> Makefile
+ all="$all $outname"
+done
+echo $all >>Makefile
cd ..
-# Convert all of the manpages to -man format.
+# Convert all of the manpages to -man format
(cd man && make)
# Format all of the manpages to text
(cd text && make)
+# Format all of the manpages to PDF
+(cd pdf && make)
+# Format all of the manpages to HTML
+(cd html && make)
+# Format all of the manpages to Google Wiki syntax
+(cd wiki && make)
diff --git a/archivers/libarchive/files/doc/wiki/Makefile b/archivers/libarchive/files/doc/wiki/Makefile
new file mode 100644
index 00000000000..e6d60387882
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/Makefile
@@ -0,0 +1,46 @@
+
+default: all
+
+
+ManPageArchiveEntry3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_entry.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_entry.3 > ManPageArchiveEntry3.wiki
+
+ManPageArchiveRead3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_read.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_read.3 > ManPageArchiveRead3.wiki
+
+ManPageArchiveReadDisk3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_read_disk.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_read_disk.3 > ManPageArchiveReadDisk3.wiki
+
+ManPageArchiveUtil3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_util.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_util.3 > ManPageArchiveUtil3.wiki
+
+ManPageArchiveWrite3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_write.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_write.3 > ManPageArchiveWrite3.wiki
+
+ManPageArchiveWriteDisk3.wiki: ../mdoc2wiki.awk ../../libarchive/archive_write_disk.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/archive_write_disk.3 > ManPageArchiveWriteDisk3.wiki
+
+ManPageCpio5.wiki: ../mdoc2wiki.awk ../../libarchive/cpio.5
+ awk -f ../mdoc2wiki.awk < ../../libarchive/cpio.5 > ManPageCpio5.wiki
+
+ManPageLibarchiveFormats5.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive-formats.5
+ awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive-formats.5 > ManPageLibarchiveFormats5.wiki
+
+ManPageLibarchive3.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive.3 > ManPageLibarchive3.wiki
+
+ManPageLibarchiveInternals3.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive_internals.3
+ awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive_internals.3 > ManPageLibarchiveInternals3.wiki
+
+ManPageMtree5.wiki: ../mdoc2wiki.awk ../../libarchive/mtree.5
+ awk -f ../mdoc2wiki.awk < ../../libarchive/mtree.5 > ManPageMtree5.wiki
+
+ManPageTar5.wiki: ../mdoc2wiki.awk ../../libarchive/tar.5
+ awk -f ../mdoc2wiki.awk < ../../libarchive/tar.5 > ManPageTar5.wiki
+
+ManPageBsdtar1.wiki: ../mdoc2wiki.awk ../../tar/bsdtar.1
+ awk -f ../mdoc2wiki.awk < ../../tar/bsdtar.1 > ManPageBsdtar1.wiki
+
+ManPageBsdcpio1.wiki: ../mdoc2wiki.awk ../../cpio/bsdcpio.1
+ awk -f ../mdoc2wiki.awk < ../../cpio/bsdcpio.1 > ManPageBsdcpio1.wiki
+all: ManPageArchiveEntry3.wiki ManPageArchiveRead3.wiki ManPageArchiveReadDisk3.wiki ManPageArchiveUtil3.wiki ManPageArchiveWrite3.wiki ManPageArchiveWriteDisk3.wiki ManPageCpio5.wiki ManPageLibarchiveFormats5.wiki ManPageLibarchive3.wiki ManPageLibarchiveInternals3.wiki ManPageMtree5.wiki ManPageTar5.wiki ManPageBsdtar1.wiki ManPageBsdcpio1.wiki
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveEntry3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveEntry3.wiki
new file mode 100644
index 00000000000..d4109a8b275
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveEntry3.wiki
@@ -0,0 +1,504 @@
+#summary archive_entry 3 manual page
+== NAME ==
+*archive_entry_acl_add_entry*,
+*archive_entry_acl_add_entry_w*,
+*archive_entry_acl_clear*,
+*archive_entry_acl_count*,
+*archive_entry_acl_next*,
+*archive_entry_acl_next_w*,
+*archive_entry_acl_reset*,
+*archive_entry_acl_text_w*,
+*archive_entry_atime*,
+*archive_entry_atime_nsec*,
+*archive_entry_clear*,
+*archive_entry_clone*,
+*archive_entry_copy_fflags_text*,
+*archive_entry_copy_fflags_text_w*,
+*archive_entry_copy_gname*,
+*archive_entry_copy_gname_w*,
+*archive_entry_copy_hardlink*,
+*archive_entry_copy_hardlink_w*,
+*archive_entry_copy_link*,
+*archive_entry_copy_link_w*,
+*archive_entry_copy_pathname_w*,
+*archive_entry_copy_sourcepath*,
+*archive_entry_copy_stat*,
+*archive_entry_copy_symlink*,
+*archive_entry_copy_symlink_w*,
+*archive_entry_copy_uname*,
+*archive_entry_copy_uname_w*,
+*archive_entry_dev*,
+*archive_entry_devmajor*,
+*archive_entry_devminor*,
+*archive_entry_filetype*,
+*archive_entry_fflags*,
+*archive_entry_fflags_text*,
+*archive_entry_free*,
+*archive_entry_gid*,
+*archive_entry_gname*,
+*archive_entry_hardlink*,
+*archive_entry_ino*,
+*archive_entry_mode*,
+*archive_entry_mtime*,
+*archive_entry_mtime_nsec*,
+*archive_entry_nlink*,
+*archive_entry_new*,
+*archive_entry_pathname*,
+*archive_entry_pathname_w*,
+*archive_entry_rdev*,
+*archive_entry_rdevmajor*,
+*archive_entry_rdevminor*,
+*archive_entry_set_atime*,
+*archive_entry_set_ctime*,
+*archive_entry_set_dev*,
+*archive_entry_set_devmajor*,
+*archive_entry_set_devminor*,
+*archive_entry_set_filetype*,
+*archive_entry_set_fflags*,
+*archive_entry_set_gid*,
+*archive_entry_set_gname*,
+*archive_entry_set_hardlink*,
+*archive_entry_set_link*,
+*archive_entry_set_mode*,
+*archive_entry_set_mtime*,
+*archive_entry_set_pathname*,
+*archive_entry_set_rdevmajor*,
+*archive_entry_set_rdevminor*,
+*archive_entry_set_size*,
+*archive_entry_set_symlink*,
+*archive_entry_set_uid*,
+*archive_entry_set_uname*,
+*archive_entry_size*,
+*archive_entry_sourcepath*,
+*archive_entry_stat*,
+*archive_entry_symlink*,
+*archive_entry_uid*,
+*archive_entry_uname*
+- functions for manipulating archive entry descriptions
+== SYNOPSIS ==
+*#include <archive_entry.h>*
+<br>
+*void*
+<br>
+*archive_entry_acl_add_entry*(_struct archive_entry `*`_, _int type_, _int permset_, _int tag_, _int qual_, _const char `*`name_);
+<br>
+*void*
+<br>
+*archive_entry_acl_add_entry_w*(_struct archive_entry `*`_, _int type_, _int permset_, _int tag_, _int qual_, _const wchar_t `*`name_);
+<br>
+*void*
+<br>
+*archive_entry_acl_clear*(_struct archive_entry `*`_);
+<br>
+*int*
+<br>
+*archive_entry_acl_count*(_struct archive_entry `*`_, _int type_);
+<br>
+*int*
+<br>
+*archive_entry_acl_next*(_struct archive_entry `*`_, _int want_type_, _int `*`type_, _int `*`permset_, _int `*`tag_, _int `*`qual_, _const char `*``*`name_);
+<br>
+*int*
+<br>
+*archive_entry_acl_next_w*(_struct archive_entry `*`_, _int want_type_, _int `*`type_, _int `*`permset_, _int `*`tag_, _int `*`qual_, _const wchar_t `*``*`name_);
+<br>
+*int*
+<br>
+*archive_entry_acl_reset*(_struct archive_entry `*`_, _int want_type_);
+<br>
+*const wchar_t `*`*
+<br>
+*archive_entry_acl_text_w*(_struct archive_entry `*`_, _int flags_);
+<br>
+*time_t*
+<br>
+*archive_entry_atime*(_struct archive_entry `*`_);
+<br>
+*long*
+<br>
+*archive_entry_atime_nsec*(_struct archive_entry `*`_);
+<br>
+*struct archive_entry `*`*
+<br>
+*archive_entry_clear*(_struct archive_entry `*`_);
+<br>
+*struct archive_entry `*`*
+<br>
+*archive_entry_clone*(_struct archive_entry `*`_);
+<br>
+*const char `*` `*`*
+<br>
+*archive_entry_copy_fflags_text_w*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*const wchar_t `*`*
+<br>
+*archive_entry_copy_fflags_text_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_gname*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_gname_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_hardlink*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_hardlink_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_sourcepath*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_pathname_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_stat*(_struct archive_entry `*`_, _const struct stat `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_symlink*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_symlink_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_uname*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_copy_uname_w*(_struct archive_entry `*`_, _const wchar_t `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_dev*(_struct archive_entry `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_devmajor*(_struct archive_entry `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_devminor*(_struct archive_entry `*`_);
+<br>
+*mode_t*
+<br>
+*archive_entry_filetype*(_struct archive_entry `*`_);
+<br>
+*void*
+<br>
+*archive_entry_fflags*(_struct archive_entry `*`_, _unsigned long `*`set_, _unsigned long `*`clear_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_fflags_text*(_struct archive_entry `*`_);
+<br>
+*void*
+<br>
+*archive_entry_free*(_struct archive_entry `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_gname*(_struct archive_entry `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_hardlink*(_struct archive_entry `*`_);
+<br>
+*ino_t*
+<br>
+*archive_entry_ino*(_struct archive_entry `*`_);
+<br>
+*mode_t*
+<br>
+*archive_entry_mode*(_struct archive_entry `*`_);
+<br>
+*time_t*
+<br>
+*archive_entry_mtime*(_struct archive_entry `*`_);
+<br>
+*long*
+<br>
+*archive_entry_mtime_nsec*(_struct archive_entry `*`_);
+<br>
+*unsigned int*
+<br>
+*archive_entry_nlink*(_struct archive_entry `*`_);
+<br>
+*struct archive_entry `*`*
+<br>
+*archive_entry_new*(_void_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_pathname*(_struct archive_entry `*`_);
+<br>
+*const wchar_t `*`*
+<br>
+*archive_entry_pathname_w*(_struct archive_entry `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_rdev*(_struct archive_entry `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_rdevmajor*(_struct archive_entry `*`_);
+<br>
+*dev_t*
+<br>
+*archive_entry_rdevminor*(_struct archive_entry `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_dev*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_devmajor*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_devminor*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_filetype*(_struct archive_entry `*`_, _unsigned int_);
+<br>
+*void*
+<br>
+*archive_entry_set_fflags*(_struct archive_entry `*`_, _unsigned long set_, _unsigned long clear_);
+<br>
+*void*
+<br>
+*archive_entry_set_gid*(_struct archive_entry `*`_, _gid_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_gname*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_hardlink*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_ino*(_struct archive_entry `*`_, _unsigned long_);
+<br>
+*void*
+<br>
+*archive_entry_set_link*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_mode*(_struct archive_entry `*`_, _mode_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_mtime*(_struct archive_entry `*`_, _time_t_, _long nanos_);
+<br>
+*void*
+<br>
+*archive_entry_set_nlink*(_struct archive_entry `*`_, _unsigned int_);
+<br>
+*void*
+<br>
+*archive_entry_set_pathname*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_rdev*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_rdevmajor*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_rdevminor*(_struct archive_entry `*`_, _dev_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_size*(_struct archive_entry `*`_, _int64_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_symlink*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*void*
+<br>
+*archive_entry_set_uid*(_struct archive_entry `*`_, _uid_t_);
+<br>
+*void*
+<br>
+*archive_entry_set_uname*(_struct archive_entry `*`_, _const char `*`_);
+<br>
+*int64_t*
+<br>
+*archive_entry_size*(_struct archive_entry `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_sourcepath*(_struct archive_entry `*`_);
+<br>
+*const struct stat `*`*
+<br>
+*archive_entry_stat*(_struct archive_entry `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_symlink*(_struct archive_entry `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_entry_uname*(_struct archive_entry `*`_);
+== DESCRIPTION ==
+These functions create and manipulate data objects that
+represent entries within an archive.
+You can think of a
+*struct archive_entry*
+as a heavy-duty version of
+*struct stat :*
+it includes everything from
+*struct stat*
+plus associated pathname, textual group and user names, etc.
+These objects are used by
+*libarchive*(3)
+to represent the metadata associated with a particular
+entry in an archive.
+=== Create and Destroy===
+There are functions to allocate, destroy, clear, and copy
+_archive_entry_
+objects:
+<dl>
+<dt>*archive_entry_clear*()</dt><dd>
+Erases the object, resetting all internal fields to the
+same state as a newly-created object.
+This is provided to allow you to quickly recycle objects
+without thrashing the heap.
+</dd><dt>*archive_entry_clone*()</dt><dd>
+A deep copy operation; all text fields are duplicated.
+</dd><dt>*archive_entry_free*()</dt><dd>
+Releases the
+*struct archive_entry*
+object.
+</dd><dt>*archive_entry_new*()</dt><dd>
+Allocate and return a blank
+*struct archive_entry*
+object.
+</dd></dl>
+=== Set and Get Functions===
+Most of the functions here set or read entries in an object.
+Such functions have one of the following forms:
+<dl>
+<dt>*archive_entry_set_XXXX*()</dt><dd>
+Stores the provided data in the object.
+In particular, for strings, the pointer is stored,
+not the referenced string.
+</dd><dt>*archive_entry_copy_XXXX*()</dt><dd>
+As above, except that the referenced data is copied
+into the object.
+</dd><dt>*archive_entry_XXXX*()</dt><dd>
+Returns the specified data.
+In the case of strings, a const-qualified pointer to
+the string is returned.
+</dd></dl>
+String data can be set or accessed as wide character strings
+or normal
+_char_
+strings.
+The functions that use wide character strings are suffixed with
+*`_`w*.
+Note that these are different representations of the same data:
+For example, if you store a narrow string and read the corresponding
+wide string, the object will transparently convert formats
+using the current locale.
+Similarly, if you store a wide string and then store a
+narrow string for the same data, the previously-set wide string will
+be discarded in favor of the new data.
+
+There are a few set/get functions that merit additional description:
+<dl>
+<dt>*archive_entry_set_link*()</dt><dd>
+This function sets the symlink field if it is already set.
+Otherwise, it sets the hardlink field.
+</dd></dl>
+=== File Flags===
+File flags are transparently converted between a bitmap
+representation and a textual format.
+For example, if you set the bitmap and ask for text, the library
+will build a canonical text format.
+However, if you set a text format and request a text format,
+you will get back the same text, even if it is ill-formed.
+If you need to canonicalize a textual flags string, you should first set the
+text form, then request the bitmap form, then use that to set the bitmap form.
+Setting the bitmap format will clear the internal text representation
+and force it to be reconstructed when you next request the text form.
+
+The bitmap format consists of two integers, one containing bits
+that should be set, the other specifying bits that should be
+cleared.
+Bits not mentioned in either bitmap will be ignored.
+Usually, the bitmap of bits to be cleared will be set to zero.
+In unusual circumstances, you can force a fully-specified set
+of file flags by setting the bitmap of flags to clear to the complement
+of the bitmap of flags to set.
+(This differs from
+*fflagstostr*(3),
+which only includes names for set bits.)
+Converting a bitmap to a textual string is a platform-specific
+operation; bits that are not meaningful on the current platform
+will be ignored.
+
+The canonical text format is a comma-separated list of flag names.
+The
+*archive_entry_copy_fflags_text*()
+and
+*archive_entry_copy_fflags_text_w*()
+functions parse the provided text and sets the internal bitmap values.
+This is a platform-specific operation; names that are not meaningful
+on the current platform will be ignored.
+The function returns a pointer to the start of the first name that was not
+recognized, or NULL if every name was recognized.
+Note that every name--including names that follow an unrecognized name--will
+be evaluated, and the bitmaps will be set to reflect every name that is
+recognized.
+(In particular, this differs from
+*strtofflags*(3),
+which stops parsing at the first unrecognized name.)
+=== ACL Handling===
+XXX This needs serious help.
+XXX
+
+An
+"Access Control List"
+(ACL) is a list of permissions that grant access to particular users or
+groups beyond what would normally be provided by standard POSIX mode bits.
+The ACL handling here addresses some deficiencies in the POSIX.1e draft 17 ACL
+specification.
+In particular, POSIX.1e draft 17 specifies several different formats, but
+none of those formats include both textual user/group names and numeric
+UIDs/GIDs.
+
+XXX explain ACL stuff XXX
+== SEE ALSO ==
+*archive*(3)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveRead3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveRead3.wiki
new file mode 100644
index 00000000000..9d3f62cb9b6
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveRead3.wiki
@@ -0,0 +1,694 @@
+#summary archive_read 3 manual page
+== NAME ==
+*archive_read_new*,
+*archive_read_set_filter_options*,
+*archive_read_set_format_options*,
+*archive_read_set_options*,
+*archive_read_support_compression_all*,
+*archive_read_support_compression_bzip2*,
+*archive_read_support_compression_compress*,
+*archive_read_support_compression_gzip*,
+*archive_read_support_compression_lzma*,
+*archive_read_support_compression_none*,
+*archive_read_support_compression_xz*,
+*archive_read_support_compression_program*,
+*archive_read_support_compression_program_signature*,
+*archive_read_support_format_all*,
+*archive_read_support_format_ar*,
+*archive_read_support_format_cpio*,
+*archive_read_support_format_empty*,
+*archive_read_support_format_iso9660*,
+*archive_read_support_format_mtree,*
+*archive_read_support_format_raw,*
+*archive_read_support_format_tar*,
+*archive_read_support_format_zip*,
+*archive_read_open*,
+*archive_read_open2*,
+*archive_read_open_fd*,
+*archive_read_open_FILE*,
+*archive_read_open_filename*,
+*archive_read_open_memory*,
+*archive_read_next_header*,
+*archive_read_next_header2*,
+*archive_read_data*,
+*archive_read_data_block*,
+*archive_read_data_skip*,
+*archive_read_data_into_buffer*,
+*archive_read_data_into_fd*,
+*archive_read_extract*,
+*archive_read_extract2*,
+*archive_read_extract_set_progress_callback*,
+*archive_read_close*,
+*archive_read_finish*
+- functions for reading streaming archives
+== SYNOPSIS ==
+*#include <archive.h>*
+<br>
+*struct archive `*`*
+<br>
+*archive_read_new*(_void_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_all*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_bzip2*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_compress*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_gzip*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_lzma*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_none*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_xz*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_program*(_struct archive `*`_, _const char `*`cmd_);
+<br>
+*int*
+<br>
+*archive_read_support_compression_program_signature*(_struct archive `*`_, _const char `*`cmd_, _const void `*`signature_, _size_t signature_length_);
+<br>
+*int*
+<br>
+*archive_read_support_format_all*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_ar*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_cpio*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_empty*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_iso9660*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_mtree*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_raw*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_tar*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_support_format_zip*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_set_filter_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_read_set_format_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_read_set_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_read_open*(_struct archive `*`_, _void `*`client_data_, _archive_open_callback `*`_, _archive_read_callback `*`_, _archive_close_callback `*`_);
+<br>
+*int*
+<br>
+*archive_read_open2*(_struct archive `*`_, _void `*`client_data_, _archive_open_callback `*`_, _archive_read_callback `*`_, _archive_skip_callback `*`_, _archive_close_callback `*`_);
+<br>
+*int*
+<br>
+*archive_read_open_FILE*(_struct archive `*`_, _FILE `*`file_);
+<br>
+*int*
+<br>
+*archive_read_open_fd*(_struct archive `*`_, _int fd_, _size_t block_size_);
+<br>
+*int*
+<br>
+*archive_read_open_filename*(_struct archive `*`_, _const char `*`filename_, _size_t block_size_);
+<br>
+*int*
+<br>
+*archive_read_open_memory*(_struct archive `*`_, _void `*`buff_, _size_t size_);
+<br>
+*int*
+<br>
+*archive_read_next_header*(_struct archive `*`_, _struct archive_entry `*``*`_);
+<br>
+*int*
+<br>
+*archive_read_next_header2*(_struct archive `*`_, _struct archive_entry `*`_);
+<br>
+*ssize_t*
+<br>
+*archive_read_data*(_struct archive `*`_, _void `*`buff_, _size_t len_);
+<br>
+*int*
+<br>
+*archive_read_data_block*(_struct archive `*`_, _const void `*``*`buff_, _size_t `*`len_, _off_t `*`offset_);
+<br>
+*int*
+<br>
+*archive_read_data_skip*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_data_into_buffer*(_struct archive `*`_, _void `*`_, _ssize_t len_);
+<br>
+*int*
+<br>
+*archive_read_data_into_fd*(_struct archive `*`_, _int fd_);
+<br>
+*int*
+<br>
+*archive_read_extract*(_struct archive `*`_, _struct archive_entry `*`_, _int flags_);
+<br>
+*int*
+<br>
+*archive_read_extract2*(_struct archive `*`src_, _struct archive_entry `*`_, _struct archive `*`dest_);
+<br>
+*void*
+<br>
+*archive_read_extract_set_progress_callback*(_struct archive `*`_, _void (`*`func)(void `*`)_, _void `*`user_data_);
+<br>
+*int*
+<br>
+*archive_read_close*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_finish*(_struct archive `*`_);
+== DESCRIPTION ==
+These functions provide a complete API for reading streaming archives.
+The general process is to first create the
+*struct archive*
+object, set options, initialize the reader, iterate over the archive
+headers and associated data, then close the archive and release all
+resources.
+The following summary describes the functions in approximately the
+order they would be used:
+<dl>
+<dt>*archive_read_new*()</dt><dd>
+Allocates and initializes a
+*struct archive*
+object suitable for reading from an archive.
+</dd><dt>
+*archive_read_support_compression_bzip2*(),
+*archive_read_support_compression_compress*(),
+*archive_read_support_compression_gzip*(),
+*archive_read_support_compression_lzma*(),
+*archive_read_support_compression_none*(),
+*archive_read_support_compression_xz*()
+</dt> <dd>
+Enables auto-detection code and decompression support for the
+specified compression.
+Returns
+*ARCHIVE_OK*
+if the compression is fully supported, or
+*ARCHIVE_WARN*
+if the compression is supported only through an external program.
+Note that decompression using an external program is usually slower than
+decompression through built-in libraries.
+Note that
+"none"
+is always enabled by default.
+</dd><dt>*archive_read_support_compression_all*()</dt><dd>
+Enables all available decompression filters.
+</dd><dt>*archive_read_support_compression_program*()</dt><dd>
+Data is fed through the specified external program before being dearchived.
+Note that this disables automatic detection of the compression format,
+so it makes no sense to specify this in conjunction with any other
+decompression option.
+</dd><dt>*archive_read_support_compression_program_signature*()</dt><dd>
+This feeds data through the specified external program
+but only if the initial bytes of the data match the specified
+signature value.
+</dd><dt>
+*archive_read_support_format_all*(),
+*archive_read_support_format_ar*(),
+*archive_read_support_format_cpio*(),
+*archive_read_support_format_empty*(),
+*archive_read_support_format_iso9660*(),
+*archive_read_support_format_mtree*(),
+*archive_read_support_format_tar*(),
+*archive_read_support_format_zip*()
+</dt> <dd>
+Enables support---including auto-detection code---for the
+specified archive format.
+For example,
+*archive_read_support_format_tar*()
+enables support for a variety of standard tar formats, old-style tar,
+ustar, pax interchange format, and many common variants.
+For convenience,
+*archive_read_support_format_all*()
+enables support for all available formats.
+Only empty archives are supported by default.
+</dd><dt>*archive_read_support_format_raw*()</dt><dd>
+The
+"raw"
+format handler allows libarchive to be used to read arbitrary data.
+It treats any data stream as an archive with a single entry.
+The pathname of this entry is
+"data ;"
+all other entry fields are unset.
+This is not enabled by
+*archive_read_support_format_all*()
+in order to avoid erroneous handling of damaged archives.
+</dd><dt>
+*archive_read_set_filter_options*(),
+*archive_read_set_format_options*(),
+*archive_read_set_options*()
+</dt> <dd>
+Specifies options that will be passed to currently-registered
+filters (including decompression filters) and/or format readers.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+<dl>
+<dt>_option=value_</dt><dd>
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+</dd><dt>_option_</dt><dd>
+The option will be provided to every module with a value of
+"1".
+</dd><dt>_!option_</dt><dd>
+The option will be provided to every module with a NULL value.
+</dd><dt>_module:option=value_, _module:option_, _module:!option_</dt><dd>
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+_module_.
+</dd></dl>
+The return value will be
+*ARCHIVE_OK*
+if any module accepts the option, or
+*ARCHIVE_WARN*
+if no module accepted the option, or
+*ARCHIVE_FATAL*
+if there was a fatal error while attempting to process the option.
+
+The currently supported options are:
+<dl>
+<dt>Format iso9660</dt><dd>
+<dl>
+<dt>*joliet*</dt><dd>
+Support Joliet extensions.
+Defaults to enabled, use
+*!joliet*
+to disable.
+</dd></dl>
+</dd></dl>
+</dd><dt>*archive_read_open*()</dt><dd>
+The same as
+*archive_read_open2*(),
+except that the skip callback is assumed to be
+NULL.
+</dd><dt>*archive_read_open2*()</dt><dd>
+Freeze the settings, open the archive, and prepare for reading entries.
+This is the most generic version of this call, which accepts
+four callback functions.
+Most clients will want to use
+*archive_read_open_filename*(),
+*archive_read_open_FILE*(),
+*archive_read_open_fd*(),
+or
+*archive_read_open_memory*()
+instead.
+The library invokes the client-provided functions to obtain
+raw bytes from the archive.
+</dd><dt>*archive_read_open_FILE*()</dt><dd>
+Like
+*archive_read_open*(),
+except that it accepts a
+*FILE `*`*
+pointer.
+This function should not be used with tape drives or other devices
+that require strict I/O blocking.
+</dd><dt>*archive_read_open_fd*()</dt><dd>
+Like
+*archive_read_open*(),
+except that it accepts a file descriptor and block size rather than
+a set of function pointers.
+Note that the file descriptor will not be automatically closed at
+end-of-archive.
+This function is safe for use with tape drives or other blocked devices.
+</dd><dt>*archive_read_open_file*()</dt><dd>
+This is a deprecated synonym for
+*archive_read_open_filename*().
+</dd><dt>*archive_read_open_filename*()</dt><dd>
+Like
+*archive_read_open*(),
+except that it accepts a simple filename and a block size.
+A NULL filename represents standard input.
+This function is safe for use with tape drives or other blocked devices.
+</dd><dt>*archive_read_open_memory*()</dt><dd>
+Like
+*archive_read_open*(),
+except that it accepts a pointer and size of a block of
+memory containing the archive data.
+</dd><dt>*archive_read_next_header*()</dt><dd>
+Read the header for the next entry and return a pointer to
+a
+*struct archive_entry .*
+This is a convenience wrapper around
+*archive_read_next_header2*()
+that reuses an internal
+*struct archive_entry*
+object for each request.
+</dd><dt>*archive_read_next_header2*()</dt><dd>
+Read the header for the next entry and populate the provided
+*struct archive_entry .*
+</dd><dt>*archive_read_data*()</dt><dd>
+Read data associated with the header just read.
+Internally, this is a convenience function that calls
+*archive_read_data_block*()
+and fills any gaps with nulls so that callers see a single
+continuous stream of data.
+</dd><dt>*archive_read_data_block*()</dt><dd>
+Return the next available block of data for this entry.
+Unlike
+*archive_read_data*(),
+the
+*archive_read_data_block*()
+function avoids copying data and allows you to correctly handle
+sparse files, as supported by some archive formats.
+The library guarantees that offsets will increase and that blocks
+will not overlap.
+Note that the blocks returned from this function can be much larger
+than the block size read from disk, due to compression
+and internal buffer optimizations.
+</dd><dt>*archive_read_data_skip*()</dt><dd>
+A convenience function that repeatedly calls
+*archive_read_data_block*()
+to skip all of the data for this archive entry.
+</dd><dt>*archive_read_data_into_buffer*()</dt><dd>
+This function is deprecated and will be removed.
+Use
+*archive_read_data*()
+instead.
+</dd><dt>*archive_read_data_into_fd*()</dt><dd>
+A convenience function that repeatedly calls
+*archive_read_data_block*()
+to copy the entire entry to the provided file descriptor.
+</dd><dt>*archive_read_extract*(), *archive_read_extract_set_skip_file*()</dt><dd>
+A convenience function that wraps the corresponding
+*archive_write_disk*(3)
+interfaces.
+The first call to
+*archive_read_extract*()
+creates a restore object using
+*archive_write_disk_new*(3)
+and
+*archive_write_disk_set_standard_lookup*(3),
+then transparently invokes
+*archive_write_disk_set_options*(3),
+*archive_write_header*(3),
+*archive_write_data*(3),
+and
+*archive_write_finish_entry*(3)
+to create the entry on disk and copy data into it.
+The
+_flags_
+argument is passed unmodified to
+*archive_write_disk_set_options*(3).
+</dd><dt>*archive_read_extract2*()</dt><dd>
+This is another version of
+*archive_read_extract*()
+that allows you to provide your own restore object.
+In particular, this allows you to override the standard lookup functions
+using
+*archive_write_disk_set_group_lookup*(3),
+and
+*archive_write_disk_set_user_lookup*(3).
+Note that
+*archive_read_extract2*()
+does not accept a
+_flags_
+argument; you should use
+*archive_write_disk_set_options*()
+to set the restore options yourself.
+</dd><dt>*archive_read_extract_set_progress_callback*()</dt><dd>
+Sets a pointer to a user-defined callback that can be used
+for updating progress displays during extraction.
+The progress function will be invoked during the extraction of large
+regular files.
+The progress function will be invoked with the pointer provided to this call.
+Generally, the data pointed to should include a reference to the archive
+object and the archive_entry object so that various statistics
+can be retrieved for the progress display.
+</dd><dt>*archive_read_close*()</dt><dd>
+Complete the archive and invoke the close callback.
+</dd><dt>*archive_read_finish*()</dt><dd>
+Invokes
+*archive_read_close*()
+if it was not invoked manually, then release all resources.
+Note: In libarchive 1.x, this function was declared to return
+*void ,*
+which made it impossible to detect certain errors when
+*archive_read_close*()
+was invoked implicitly from this function.
+The declaration is corrected beginning with libarchive 2.0.
+</dd></dl>
+
+Note that the library determines most of the relevant information about
+the archive by inspection.
+In particular, it automatically detects
+*gzip*(1)
+or
+*bzip2*(1)
+compression and transparently performs the appropriate decompression.
+It also automatically detects the archive format.
+
+A complete description of the
+*struct archive*
+and
+*struct archive_entry*
+objects can be found in the overview manual page for
+*libarchive*(3).
+== CLIENT CALLBACKS ==
+The callback functions must match the following prototypes:
+<ul>
+<li>
+*typedef ssize_t*
+*archive_read_callback*(_struct archive `*`_, _void `*`client_data_, _const void `*``*`buffer_)
+</li><li>
+*typedef int*
+*archive_skip_callback*(_struct archive `*`_, _void `*`client_data_, _size_t request_)
+</li><li>
+*typedef int*
+*archive_open_callback*(_struct archive `*`_, _void `*`client_data_)
+</li><li>
+*typedef int*
+*archive_close_callback*(_struct archive `*`_, _void `*`client_data_)
+</li></ul>
+
+The open callback is invoked by
+*archive_open*().
+It should return
+*ARCHIVE_OK*
+if the underlying file or data source is successfully
+opened.
+If the open fails, it should call
+*archive_set_error*()
+to register an error code and message and return
+*ARCHIVE_FATAL*.
+
+The read callback is invoked whenever the library
+requires raw bytes from the archive.
+The read callback should read data into a buffer,
+set the
+{{{
+const void **buffer
+}}}
+argument to point to the available data, and
+return a count of the number of bytes available.
+The library will invoke the read callback again
+only after it has consumed this data.
+The library imposes no constraints on the size
+of the data blocks returned.
+On end-of-file, the read callback should
+return zero.
+On error, the read callback should invoke
+*archive_set_error*()
+to register an error code and message and
+return -1.
+
+The skip callback is invoked when the
+library wants to ignore a block of data.
+The return value is the number of bytes actually
+skipped, which may differ from the request.
+If the callback cannot skip data, it should return
+zero.
+If the skip callback is not provided (the
+function pointer is
+NULL ),
+the library will invoke the read function
+instead and simply discard the result.
+A skip callback can provide significant
+performance gains when reading uncompressed
+archives from slow disk drives or other media
+that can skip quickly.
+
+The close callback is invoked by archive_close when
+the archive processing is complete.
+The callback should return
+*ARCHIVE_OK*
+on success.
+On failure, the callback should invoke
+*archive_set_error*()
+to register an error code and message and
+return
+*ARCHIVE_FATAL.*
+== EXAMPLE ==
+The following illustrates basic usage of the library.
+In this example,
+the callback functions are simply wrappers around the standard
+*open*(2),
+*read*(2),
+and
+*close*(2)
+system calls.
+{{{
+void
+list_archive(const char *name)
+{
+ struct mydata *mydata;
+ struct archive *a;
+ struct archive_entry *entry;
+ mydata = malloc(sizeof(struct mydata));
+ a = archive_read_new();
+ mydata->name = name;
+ archive_read_support_compression_all(a);
+ archive_read_support_format_all(a);
+ archive_read_open(a, mydata, myopen, myread, myclose);
+ while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
+ printf("%s\\n",archive_entry_pathname(entry));
+ archive_read_data_skip(a);
+ }
+ archive_read_finish(a);
+ free(mydata);
+}
+ssize_t
+myread(struct archive *a, void *client_data, const void **buff)
+{
+ struct mydata *mydata = client_data;
+ *buff = mydata->buff;
+ return (read(mydata->fd, mydata->buff, 10240));
+}
+int
+myopen(struct archive *a, void *client_data)
+{
+ struct mydata *mydata = client_data;
+ mydata->fd = open(mydata->name, O_RDONLY);
+ return (mydata->fd >= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
+}
+int
+myclose(struct archive *a, void *client_data)
+{
+ struct mydata *mydata = client_data;
+ if (mydata->fd > 0)
+ close(mydata->fd);
+ return (ARCHIVE_OK);
+}
+}}}
+== RETURN VALUES ==
+Most functions return zero on success, non-zero on error.
+The possible return codes include:
+*ARCHIVE_OK*
+(the operation succeeded),
+*ARCHIVE_WARN*
+(the operation succeeded but a non-critical error was encountered),
+*ARCHIVE_EOF*
+(end-of-archive was encountered),
+*ARCHIVE_RETRY*
+(the operation failed but can be retried),
+and
+*ARCHIVE_FATAL*
+(there was a fatal error; the archive should be closed immediately).
+Detailed error codes and textual descriptions are available from the
+*archive_errno*()
+and
+*archive_error_string*()
+functions.
+
+*archive_read_new*()
+returns a pointer to a freshly allocated
+*struct archive*
+object.
+It returns
+NULL
+on error.
+
+*archive_read_data*()
+returns a count of bytes actually read or zero at the end of the entry.
+On error, a value of
+*ARCHIVE_FATAL*,
+*ARCHIVE_WARN*,
+or
+*ARCHIVE_RETRY*
+is returned and an error code and textual description can be retrieved from the
+*archive_errno*()
+and
+*archive_error_string*()
+functions.
+
+The library expects the client callbacks to behave similarly.
+If there is an error, you can use
+*archive_set_error*()
+to set an appropriate error code and description,
+then return one of the non-zero values above.
+(Note that the value eventually returned to the client may
+not be the same; many errors that are not critical at the level
+of basic I/O can prevent the archive from being properly read,
+thus most I/O errors eventually cause
+*ARCHIVE_FATAL*
+to be returned.)
+== SEE ALSO ==
+*tar*(1),
+*archive*(3),
+*archive_util*(3),
+*tar*(5)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
+== BUGS ==
+Many traditional archiver programs treat
+empty files as valid empty archives.
+For example, many implementations of
+*tar*(1)
+allow you to append entries to an empty file.
+Of course, it is impossible to determine the format of an empty file
+by inspecting the contents, so this library treats empty files as
+having a special
+"empty"
+format.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveReadDisk3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveReadDisk3.wiki
new file mode 100644
index 00000000000..4135470e704
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveReadDisk3.wiki
@@ -0,0 +1,287 @@
+#summary archive_read_disk 3 manual page
+== NAME ==
+*archive_read_disk_new*,
+*archive_read_disk_set_symlink_logical*,
+*archive_read_disk_set_symlink_physical*,
+*archive_read_disk_set_symlink_hybrid*,
+*archive_read_disk_entry_from_file*,
+*archive_read_disk_gname*,
+*archive_read_disk_uname*,
+*archive_read_disk_set_uname_lookup*,
+*archive_read_disk_set_gname_lookup*,
+*archive_read_disk_set_standard_lookup*,
+*archive_read_close*,
+*archive_read_finish*
+- functions for reading objects from disk
+== SYNOPSIS ==
+*#include <archive.h>*
+<br>
+*struct archive `*`*
+<br>
+*archive_read_disk_new*(_void_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_symlink_logical*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_symlink_physical*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_symlink_hybrid*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_disk_gname*(_struct archive `*`_, _gid_t_);
+<br>
+*int*
+<br>
+*archive_read_disk_uname*(_struct archive `*`_, _uid_t_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_gname_lookup*(_struct archive `*`_, _void `*`_, _const char `*`(`*`lookup)(void `*`, gid_t)_, _void (`*`cleanup)(void `*`)_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_uname_lookup*(_struct archive `*`_, _void `*`_, _const char `*`(`*`lookup)(void `*`, uid_t)_, _void (`*`cleanup)(void `*`)_);
+<br>
+*int*
+<br>
+*archive_read_disk_set_standard_lookup*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_disk_entry_from_file*(_struct archive `*`_, _struct archive_entry `*`_, _int fd_, _const struct stat `*`_);
+<br>
+*int*
+<br>
+*archive_read_close*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_read_finish*(_struct archive `*`_);
+== DESCRIPTION ==
+These functions provide an API for reading information about
+objects on disk.
+In particular, they provide an interface for populating
+*struct archive_entry*
+objects.
+<dl>
+<dt>*archive_read_disk_new*()</dt><dd>
+Allocates and initializes a
+*struct archive*
+object suitable for reading object information from disk.
+</dd><dt>
+*archive_read_disk_set_symlink_logical*(),
+*archive_read_disk_set_symlink_physical*(),
+*archive_read_disk_set_symlink_hybrid*()
+</dt> <dd>
+This sets the mode used for handling symbolic links.
+The
+"logical"
+mode follows all symbolic links.
+The
+"physical"
+mode does not follow any symbolic links.
+The
+"hybrid"
+mode currently behaves identically to the
+"logical"
+mode.
+</dd><dt>
+*archive_read_disk_gname*(),
+*archive_read_disk_uname*()
+</dt> <dd>
+Returns a user or group name given a gid or uid value.
+By default, these always return a NULL string.
+</dd><dt>
+*archive_read_disk_set_gname_lookup*(),
+*archive_read_disk_set_uname_lookup*()
+</dt> <dd>
+These allow you to override the functions used for
+user and group name lookups.
+You may also provide a
+*void `*`*
+pointer to a private data structure and a cleanup function for
+that data.
+The cleanup function will be invoked when the
+*struct archive*
+object is destroyed or when new lookup functions are registered.
+</dd><dt>*archive_read_disk_set_standard_lookup*()</dt><dd>
+This convenience function installs a standard set of user
+and group name lookup functions.
+These functions use
+*getpwid*(3)
+and
+*getgrid*(3)
+to convert ids to names, defaulting to NULL if the names cannot
+be looked up.
+These functions also implement a simple memory cache to reduce
+the number of calls to
+*getpwid*(3)
+and
+*getgrid*(3).
+</dd><dt>*archive_read_disk_entry_from_file*()</dt><dd>
+Populates a
+*struct archive_entry*
+object with information about a particular file.
+The
+*archive_entry*
+object must have already been created with
+*archive_entry_new*(3)
+and at least one of the source path or path fields must already be set.
+(If both are set, the source path will be used.)
+
+Information is read from disk using the path name from the
+*struct archive_entry*
+object.
+If a file descriptor is provided, some information will be obtained using
+that file descriptor, on platforms that support the appropriate
+system calls.
+
+If a pointer to a
+*struct stat*
+is provided, information from that structure will be used instead
+of reading from the disk where appropriate.
+This can provide performance benefits in scenarios where
+*struct stat*
+information has already been read from the disk as a side effect
+of some other operation.
+(For example, directory traversal libraries often provide this information.)
+
+Where necessary, user and group ids are converted to user and group names
+using the currently registered lookup functions above.
+This affects the file ownership fields and ACL values in the
+*struct archive_entry*
+object.
+</dd><dt>*archive_read_close*()</dt><dd>
+This currently does nothing.
+</dd><dt>*archive_write_finish*()</dt><dd>
+Invokes
+*archive_write_close*()
+if it was not invoked manually, then releases all resources.
+</dd></dl>
+More information about the
+_struct_ archive
+object and the overall design of the library can be found in the
+*libarchive*(3)
+overview.
+== EXAMPLE ==
+The following illustrates basic usage of the library by
+showing how to use it to copy an item on disk into an archive.
+{{{
+void
+file_to_archive(struct archive *a, const char *name)
+{
+ char buff[8192];
+ size_t bytes_read;
+ struct archive *ard;
+ struct archive_entry *entry;
+ int fd;
+ ard = archive_read_disk_new();
+ archive_read_disk_set_standard_lookup(ard);
+ entry = archive_entry_new();
+ fd = open(name, O_RDONLY);
+ if (fd < 0)
+ return;
+ archive_entry_copy_sourcepath(entry, name);
+ archive_read_disk_entry_from_file(ard, entry, fd, NULL);
+ archive_write_header(a, entry);
+ while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
+ archive_write_data(a, buff, bytes_read);
+ archive_write_finish_entry(a);
+ archive_read_finish(ard);
+ archive_entry_free(entry);
+}
+}}}
+== RETURN VALUES ==
+Most functions return
+*ARCHIVE_OK*
+(zero) on success, or one of several negative
+error codes for errors.
+Specific error codes include:
+*ARCHIVE_RETRY*
+for operations that might succeed if retried,
+*ARCHIVE_WARN*
+for unusual conditions that do not prevent further operations, and
+*ARCHIVE_FATAL*
+for serious errors that make remaining operations impossible.
+The
+*archive_errno*(3)
+and
+*archive_error_string*(3)
+functions can be used to retrieve an appropriate error code and a
+textual error message.
+(See
+*archive_util*(3)
+for details.)
+
+*archive_read_disk_new*()
+returns a pointer to a newly-allocated
+*struct archive*
+object or NULL if the allocation failed for any reason.
+
+*archive_read_disk_gname*()
+and
+*archive_read_disk_uname*()
+return
+*const char `*`*
+pointers to the textual name or NULL if the lookup failed for any reason.
+The returned pointer points to internal storage that
+may be reused on the next call to either of these functions;
+callers should copy the string if they need to continue accessing it.
+
+== SEE ALSO ==
+*archive_read*(3),
+*archive_write*(3),
+*archive_write_disk*(3),
+*tar*(1),
+*libarchive*(3)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+The
+*archive_read_disk*
+interface was added to
+*libarchive* 2.6
+and first appeared in
+FreeBSD 8.0.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@freebsd.org.>
+== BUGS ==
+The
+"standard"
+user name and group name lookup functions are not the defaults because
+*getgrid*(3)
+and
+*getpwid*(3)
+are sometimes too large for particular applications.
+The current design allows the application author to use a more
+compact implementation when appropriate.
+
+The full list of metadata read from disk by
+*archive_read_disk_entry_from_file*()
+is necessarily system-dependent.
+
+The
+*archive_read_disk_entry_from_file*()
+function reads as much information as it can from disk.
+Some method should be provided to limit this so that clients who
+do not need ACLs, for instance, can avoid the extra work needed
+to look up such information.
+
+This API should provide a set of methods for walking a directory tree.
+That would make it a direct parallel of the
+*archive_read*(3)
+API.
+When such methods are implemented, the
+"hybrid"
+symbolic link mode will make sense.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveUtil3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveUtil3.wiki
new file mode 100644
index 00000000000..e33b0076935
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveUtil3.wiki
@@ -0,0 +1,146 @@
+#summary archive_util 3 manual page
+== NAME ==
+*archive_clear_error*,
+*archive_compression*,
+*archive_compression_name*,
+*archive_copy_error*,
+*archive_errno*,
+*archive_error_string*,
+*archive_file_count*,
+*archive_format*,
+*archive_format_name*,
+*archive_set_error*
+- libarchive utility functions
+== SYNOPSIS ==
+*#include <archive.h>*
+<br>
+*void*
+<br>
+*archive_clear_error*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_compression*(_struct archive `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_compression_name*(_struct archive `*`_);
+<br>
+*void*
+<br>
+*archive_copy_error*(_struct archive `*`_, _struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_errno*(_struct archive `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_error_string*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_file_count*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_format*(_struct archive `*`_);
+<br>
+*const char `*`*
+<br>
+*archive_format_name*(_struct archive `*`_);
+<br>
+*void*
+<br>
+*archive_set_error*(_struct archive `*`_, _int error_code_, _const char `*`fmt_, _..._);
+== DESCRIPTION ==
+These functions provide access to various information about the
+*struct archive*
+object used in the
+*libarchive*(3)
+library.
+<dl>
+<dt>*archive_clear_error*()</dt><dd>
+Clears any error information left over from a previous call.
+Not generally used in client code.
+</dd><dt>*archive_compression*()</dt><dd>
+Returns a numeric code indicating the current compression.
+This value is set by
+*archive_read_open*().
+</dd><dt>*archive_compression_name*()</dt><dd>
+Returns a text description of the current compression suitable for display.
+</dd><dt>*archive_copy_error*()</dt><dd>
+Copies error information from one archive to another.
+</dd><dt>*archive_errno*()</dt><dd>
+Returns a numeric error code (see
+*errno*(2))
+indicating the reason for the most recent error return.
+</dd><dt>*archive_error_string*()</dt><dd>
+Returns a textual error message suitable for display.
+The error message here is usually more specific than that
+obtained from passing the result of
+*archive_errno*()
+to
+*strerror*(3).
+</dd><dt>*archive_file_count*()</dt><dd>
+Returns a count of the number of files processed by this archive object.
+The count is incremented by calls to
+*archive_write_header*()
+or
+*archive_read_next_header*(.)
+</dd><dt>*archive_format*()</dt><dd>
+Returns a numeric code indicating the format of the current
+archive entry.
+This value is set by a successful call to
+*archive_read_next_header*().
+Note that it is common for this value to change from
+entry to entry.
+For example, a tar archive might have several entries that
+utilize GNU tar extensions and several entries that do not.
+These entries will have different format codes.
+</dd><dt>*archive_format_name*()</dt><dd>
+A textual description of the format of the current entry.
+</dd><dt>*archive_set_error*()</dt><dd>
+Sets the numeric error code and error description that will be returned
+by
+*archive_errno*()
+and
+*archive_error_string*().
+This function should be used within I/O callbacks to set system-specific
+error codes and error descriptions.
+This function accepts a printf-like format string and arguments.
+However, you should be careful to use only the following printf
+format specifiers:
+"%c",
+"%d",
+"%jd",
+"%jo",
+"%ju",
+"%jx",
+"%ld",
+"%lo",
+"%lu",
+"%lx",
+"%o",
+"%u",
+"%s",
+"%x",
+"%%".
+Field-width specifiers and other printf features are
+not uniformly supported and should not be used.
+</dd></dl>
+== SEE ALSO ==
+*archive_read*(3),
+*archive_write*(3),
+*libarchive*(3),
+*printf*(3)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveWrite3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveWrite3.wiki
new file mode 100644
index 00000000000..30ccd8f36c4
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveWrite3.wiki
@@ -0,0 +1,630 @@
+#summary archive_write 3 manual page
+== NAME ==
+*archive_write_new*,
+*archive_write_set_format_cpio*,
+*archive_write_set_format_pax*,
+*archive_write_set_format_pax_restricted*,
+*archive_write_set_format_shar*,
+*archive_write_set_format_shar_binary*,
+*archive_write_set_format_ustar*,
+*archive_write_get_bytes_per_block*,
+*archive_write_set_bytes_per_block*,
+*archive_write_set_bytes_in_last_block*,
+*archive_write_set_compression_bzip2*,
+*archive_write_set_compression_compress*,
+*archive_write_set_compression_gzip*,
+*archive_write_set_compression_none*,
+*archive_write_set_compression_program*,
+*archive_write_set_compressor_options*,
+*archive_write_set_format_options*,
+*archive_write_set_options*,
+*archive_write_open*,
+*archive_write_open_fd*,
+*archive_write_open_FILE*,
+*archive_write_open_filename*,
+*archive_write_open_memory*,
+*archive_write_header*,
+*archive_write_data*,
+*archive_write_finish_entry*,
+*archive_write_close*,
+*archive_write_finish*
+- functions for creating archives
+== SYNOPSIS ==
+*#include <archive.h>*
+<br>
+*struct archive `*`*
+<br>
+*archive_write_new*(_void_);
+<br>
+*int*
+<br>
+*archive_write_get_bytes_per_block*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_bytes_per_block*(_struct archive `*`_, _int bytes_per_block_);
+<br>
+*int*
+<br>
+*archive_write_set_bytes_in_last_block*(_struct archive `*`_, _int_);
+<br>
+*int*
+<br>
+*archive_write_set_compression_bzip2*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_compression_compress*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_compression_gzip*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_compression_none*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_compression_program*(_struct archive `*`_, _const char `*` cmd_);
+<br>
+*int*
+<br>
+*archive_write_set_format_cpio*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_pax*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_pax_restricted*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_shar*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_shar_binary*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_ustar*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_format_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_compressor_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_write_set_options*(_struct archive `*`_, _const char `*`_);
+<br>
+*int*
+<br>
+*archive_write_open*(_struct archive `*`_, _void `*`client_data_, _archive_open_callback `*`_, _archive_write_callback `*`_, _archive_close_callback `*`_);
+<br>
+*int*
+<br>
+*archive_write_open_fd*(_struct archive `*`_, _int fd_);
+<br>
+*int*
+<br>
+*archive_write_open_FILE*(_struct archive `*`_, _FILE `*`file_);
+<br>
+*int*
+<br>
+*archive_write_open_filename*(_struct archive `*`_, _const char `*`filename_);
+<br>
+*int*
+<br>
+*archive_write_open_memory*(_struct archive `*`_, _void `*`buffer_, _size_t bufferSize_, _size_t `*`outUsed_);
+<br>
+*int*
+<br>
+*archive_write_header*(_struct archive `*`_, _struct archive_entry `*`_);
+<br>
+*ssize_t*
+<br>
+*archive_write_data*(_struct archive `*`_, _const void `*`_, _size_t_);
+<br>
+*int*
+<br>
+*archive_write_finish_entry*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_close*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_finish*(_struct archive `*`_);
+== DESCRIPTION ==
+These functions provide a complete API for creating streaming
+archive files.
+The general process is to first create the
+*struct archive*
+object, set any desired options, initialize the archive, append entries, then
+close the archive and release all resources.
+The following summary describes the functions in approximately
+the order they are ordinarily used:
+<dl>
+<dt>*archive_write_new*()</dt><dd>
+Allocates and initializes a
+*struct archive*
+object suitable for writing a tar archive.
+</dd><dt>*archive_write_set_bytes_per_block*()</dt><dd>
+Sets the block size used for writing the archive data.
+Every call to the write callback function, except possibly the last one, will
+use this value for the length.
+The third parameter is a boolean that specifies whether or not the final block
+written will be padded to the full block size.
+If it is zero, the last block will not be padded.
+If it is non-zero, padding will be added both before and after compression.
+The default is to use a block size of 10240 bytes and to pad the last block.
+Note that a block size of zero will suppress internal blocking
+and cause writes to be sent directly to the write callback as they occur.
+</dd><dt>*archive_write_get_bytes_per_block*()</dt><dd>
+Retrieve the block size to be used for writing.
+A value of -1 here indicates that the library should use default values.
+A value of zero indicates that internal blocking is suppressed.
+</dd><dt>*archive_write_set_bytes_in_last_block*()</dt><dd>
+Sets the block size used for writing the last block.
+If this value is zero, the last block will be padded to the same size
+as the other blocks.
+Otherwise, the final block will be padded to a multiple of this size.
+In particular, setting it to 1 will cause the final block to not be padded.
+For compressed output, any padding generated by this option
+is applied only after the compression.
+The uncompressed data is always unpadded.
+The default is to pad the last block to the full block size (note that
+*archive_write_open_filename*()
+will set this based on the file type).
+Unlike the other
+"set"
+functions, this function can be called after the archive is opened.
+</dd><dt>*archive_write_get_bytes_in_last_block*()</dt><dd>
+Retrieve the currently-set value for last block size.
+A value of -1 here indicates that the library should use default values.
+</dd><dt>
+*archive_write_set_format_cpio*(),
+*archive_write_set_format_pax*(),
+*archive_write_set_format_pax_restricted*(),
+*archive_write_set_format_shar*(),
+*archive_write_set_format_shar_binary*(),
+*archive_write_set_format_ustar*()
+</dt> <dd>
+Sets the format that will be used for the archive.
+The library can write
+POSIX octet-oriented cpio format archives,
+POSIX-standard
+"pax interchange"
+format archives,
+traditional
+"shar"
+archives,
+enhanced
+"binary"
+shar archives that store a variety of file attributes and handle binary files,
+and
+POSIX-standard
+"ustar"
+archives.
+The pax interchange format is a backwards-compatible tar format that
+adds key/value attributes to each entry and supports arbitrary
+filenames, linknames, uids, sizes, etc.
+"Restricted pax interchange format"
+is the library default; this is the same as pax format, but suppresses
+the pax extended header for most normal files.
+In most cases, this will result in ordinary ustar archives.
+</dd><dt>
+*archive_write_set_compression_bzip2*(),
+*archive_write_set_compression_compress*(),
+*archive_write_set_compression_gzip*(),
+*archive_write_set_compression_none*()
+</dt> <dd>
+The resulting archive will be compressed as specified.
+Note that the compressed output is always properly blocked.
+</dd><dt>*archive_write_set_compression_program*()</dt><dd>
+The archive will be fed into the specified compression program.
+The output of that program is blocked and written to the client
+write callbacks.
+</dd><dt>
+*archive_write_set_compressor_options*(),
+*archive_write_set_format_options*(),
+*archive_write_set_options*()
+</dt> <dd>
+Specifies options that will be passed to the currently-enabled
+compressor and/or format writer.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+<dl>
+<dt>_option=value_</dt><dd>
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+</dd><dt>_option_</dt><dd>
+The option will be provided to every module with a value of
+"1".
+</dd><dt>_!option_</dt><dd>
+The option will be provided to every module with a NULL value.
+</dd><dt>_module:option=value_, _module:option_, _module:!option_</dt><dd>
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+_module_.
+</dd></dl>
+The return value will be
+*ARCHIVE_OK*
+if any module accepts the option, or
+*ARCHIVE_WARN*
+if no module accepted the option, or
+*ARCHIVE_FATAL*
+if there was a fatal error while attempting to process the option.
+
+The currently supported options are:
+<dl>
+<dt>Compressor gzip</dt><dd>
+<dl>
+<dt>*compression-level*</dt><dd>
+The value is interpreted as a decimal integer specifying the
+gzip compression level.
+</dd></dl>
+</dd><dt>Compressor xz</dt><dd>
+<dl>
+<dt>*compression-level*</dt><dd>
+The value is interpreted as a decimal integer specifying the
+compression level.
+</dd></dl>
+</dd><dt>Format mtree</dt><dd>
+<dl>
+<dt>*cksum*, *device*, *flags*, *gid*, *gname*, *indent*, *link*, *md5*, *mode*, *nlink*, *rmd160*, *sha1*, *sha256*, *sha384*, *sha512*, *size*, *time*, *uid*, *uname*</dt><dd>
+Enable a particular keyword in the mtree output.
+Prefix with an exclamation mark to disable the corresponding keyword.
+The default is equivalent to
+"device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname".
+</dd><dt>*all*</dt><dd>
+Enables all of the above keywords.
+</dd><dt>*use-set*</dt><dd>
+Enables generation of
+*/set*
+lines that specify default values for the following files and/or directories.
+</dd><dt>*indent*</dt><dd>
+XXX needs explanation XXX
+</dd></dl>
+</dd></dl>
+</dd><dt>*archive_write_open*()</dt><dd>
+Freeze the settings, open the archive, and prepare for writing entries.
+This is the most generic form of this function, which accepts
+pointers to three callback functions which will be invoked by
+the compression layer to write the constructed archive.
+</dd><dt>*archive_write_open_fd*()</dt><dd>
+A convenience form of
+*archive_write_open*()
+that accepts a file descriptor.
+The
+*archive_write_open_fd*()
+function is safe for use with tape drives or other
+block-oriented devices.
+</dd><dt>*archive_write_open_FILE*()</dt><dd>
+A convenience form of
+*archive_write_open*()
+that accepts a
+*FILE `*`*
+pointer.
+Note that
+*archive_write_open_FILE*()
+is not safe for writing to tape drives or other devices
+that require correct blocking.
+</dd><dt>*archive_write_open_file*()</dt><dd>
+A deprecated synonym for
+*archive_write_open_filename*().
+</dd><dt>*archive_write_open_filename*()</dt><dd>
+A convenience form of
+*archive_write_open*()
+that accepts a filename.
+A NULL argument indicates that the output should be written to standard output;
+an argument of
+"-"
+will open a file with that name.
+If you have not invoked
+*archive_write_set_bytes_in_last_block*(),
+then
+*archive_write_open_filename*()
+will adjust the last-block padding depending on the file:
+it will enable padding when writing to standard output or
+to a character or block device node, it will disable padding otherwise.
+You can override this by manually invoking
+*archive_write_set_bytes_in_last_block*()
+before calling
+*archive_write_open*().
+The
+*archive_write_open_filename*()
+function is safe for use with tape drives or other
+block-oriented devices.
+</dd><dt>*archive_write_open_memory*()</dt><dd>
+A convenience form of
+*archive_write_open*()
+that accepts a pointer to a block of memory that will receive
+the archive.
+The final
+*size_t `*`*
+argument points to a variable that will be updated
+after each write to reflect how much of the buffer
+is currently in use.
+You should be careful to ensure that this variable
+remains allocated until after the archive is
+closed.
+</dd><dt>*archive_write_header*()</dt><dd>
+Build and write a header using the data in the provided
+*struct archive_entry*
+structure.
+See
+*archive_entry*(3)
+for information on creating and populating
+*struct archive_entry*
+objects.
+</dd><dt>*archive_write_data*()</dt><dd>
+Write data corresponding to the header just written.
+Returns number of bytes written or -1 on error.
+</dd><dt>*archive_write_finish_entry*()</dt><dd>
+Close out the entry just written.
+In particular, this writes out the final padding required by some formats.
+Ordinarily, clients never need to call this, as it
+is called automatically by
+*archive_write_next_header*()
+and
+*archive_write_close*()
+as needed.
+</dd><dt>*archive_write_close*()</dt><dd>
+Complete the archive and invoke the close callback.
+</dd><dt>*archive_write_finish*()</dt><dd>
+Invokes
+*archive_write_close*()
+if it was not invoked manually, then releases all resources.
+Note that this function was declared to return
+*void*
+in libarchive 1.x, which made it impossible to detect errors when
+*archive_write_close*()
+was invoked implicitly from this function.
+This is corrected beginning with libarchive 2.0.
+</dd></dl>
+More information about the
+_struct_ archive
+object and the overall design of the library can be found in the
+*libarchive*(3)
+overview.
+== IMPLEMENTATION ==
+Compression support is built-in to libarchive, which uses zlib and bzlib
+to handle gzip and bzip2 compression, respectively.
+== CLIENT CALLBACKS ==
+To use this library, you will need to define and register
+callback functions that will be invoked to write data to the
+resulting archive.
+These functions are registered by calling
+*archive_write_open*():
+<ul>
+<li>
+*typedef int*
+*archive_open_callback*(_struct archive `*`_, _void `*`client_data_)
+</li></ul>
+
+The open callback is invoked by
+*archive_write_open*().
+It should return
+*ARCHIVE_OK*
+if the underlying file or data source is successfully
+opened.
+If the open fails, it should call
+*archive_set_error*()
+to register an error code and message and return
+*ARCHIVE_FATAL*.
+<ul>
+<li>
+*typedef ssize_t*
+*archive_write_callback*(_struct archive `*`_, _void `*`client_data_, _const void `*`buffer_, _size_t length_)
+</li></ul>
+
+The write callback is invoked whenever the library
+needs to write raw bytes to the archive.
+For correct blocking, each call to the write callback function
+should translate into a single
+*write*(2)
+system call.
+This is especially critical when writing archives to tape drives.
+On success, the write callback should return the
+number of bytes actually written.
+On error, the callback should invoke
+*archive_set_error*()
+to register an error code and message and return -1.
+<ul>
+<li>
+*typedef int*
+*archive_close_callback*(_struct archive `*`_, _void `*`client_data_)
+</li></ul>
+
+The close callback is invoked by archive_close when
+the archive processing is complete.
+The callback should return
+*ARCHIVE_OK*
+on success.
+On failure, the callback should invoke
+*archive_set_error*()
+to register an error code and message and
+return
+*ARCHIVE_FATAL.*
+== EXAMPLE ==
+The following sketch illustrates basic usage of the library.
+In this example,
+the callback functions are simply wrappers around the standard
+*open*(2),
+*write*(2),
+and
+*close*(2)
+system calls.
+{{{
+#ifdef __linux__
+#define _FILE_OFFSET_BITS 64
+#endif
+#include <sys/stat.h>
+#include <archive.h>
+#include <archive_entry.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+struct mydata {
+ const char *name;
+ int fd;
+};
+int
+myopen(struct archive *a, void *client_data)
+{
+ struct mydata *mydata = client_data;
+ mydata->fd = open(mydata->name, O_WRONLY | O_CREAT, 0644);
+ if (mydata->fd >= 0)
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+}
+ssize_t
+mywrite(struct archive *a, void *client_data, const void *buff, size_t n)
+{
+ struct mydata *mydata = client_data;
+ return (write(mydata->fd, buff, n));
+}
+int
+myclose(struct archive *a, void *client_data)
+{
+ struct mydata *mydata = client_data;
+ if (mydata->fd > 0)
+ close(mydata->fd);
+ return (0);
+}
+void
+write_archive(const char *outname, const char **filename)
+{
+ struct mydata *mydata = malloc(sizeof(struct mydata));
+ struct archive *a;
+ struct archive_entry *entry;
+ struct stat st;
+ char buff[8192];
+ int len;
+ int fd;
+ a = archive_write_new();
+ mydata->name = outname;
+ archive_write_set_compression_gzip(a);
+ archive_write_set_format_ustar(a);
+ archive_write_open(a, mydata, myopen, mywrite, myclose);
+ while (*filename) {
+ stat(*filename, &st);
+ entry = archive_entry_new();
+ archive_entry_copy_stat(entry, &st);
+ archive_entry_set_pathname(entry, *filename);
+ archive_write_header(a, entry);
+ fd = open(*filename, O_RDONLY);
+ len = read(fd, buff, sizeof(buff));
+ while ( len > 0 ) {
+ archive_write_data(a, buff, len);
+ len = read(fd, buff, sizeof(buff));
+ }
+ archive_entry_free(entry);
+ filename++;
+ }
+ archive_write_finish(a);
+}
+int main(int argc, const char **argv)
+{
+ const char *outname;
+ argv++;
+ outname = argv++;
+ write_archive(outname, argv);
+ return 0;
+}
+}}}
+== RETURN VALUES ==
+Most functions return
+*ARCHIVE_OK*
+(zero) on success, or one of several non-zero
+error codes for errors.
+Specific error codes include:
+*ARCHIVE_RETRY*
+for operations that might succeed if retried,
+*ARCHIVE_WARN*
+for unusual conditions that do not prevent further operations, and
+*ARCHIVE_FATAL*
+for serious errors that make remaining operations impossible.
+The
+*archive_errno*()
+and
+*archive_error_string*()
+functions can be used to retrieve an appropriate error code and a
+textual error message.
+
+*archive_write_new*()
+returns a pointer to a newly-allocated
+*struct archive*
+object.
+
+*archive_write_data*()
+returns a count of the number of bytes actually written.
+On error, -1 is returned and the
+*archive_errno*()
+and
+*archive_error_string*()
+functions will return appropriate values.
+Note that if the client-provided write callback function
+returns a non-zero value, that error will be propagated back to the caller
+through whatever API function resulted in that call, which
+may include
+*archive_write_header*(),
+*archive_write_data*(),
+*archive_write_close*(),
+or
+*archive_write_finish*().
+The client callback can call
+*archive_set_error*()
+to provide values that can then be retrieved by
+*archive_errno*()
+and
+*archive_error_string*().
+== SEE ALSO ==
+*tar*(1),
+*libarchive*(3),
+*tar*(5)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
+== BUGS ==
+There are many peculiar bugs in historic tar implementations that may cause
+certain programs to reject archives written by this library.
+For example, several historic implementations calculated header checksums
+incorrectly and will thus reject valid archives; GNU tar does not fully support
+pax interchange format; some old tar implementations required specific
+field terminations.
+
+The default pax interchange format eliminates most of the historic
+tar limitations and provides a generic key/value attribute facility
+for vendor-defined extensions.
+One oversight in POSIX is the failure to provide a standard attribute
+for large device numbers.
+This library uses
+"SCHILY.devminor"
+and
+"SCHILY.devmajor"
+for device numbers that exceed the range supported by the backwards-compatible
+ustar header.
+These keys are compatible with Joerg Schilling's
+*star*
+archiver.
+Other implementations may not recognize these keys and will thus be unable
+to correctly restore device nodes with large device numbers from archives
+created by this library.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageArchiveWriteDisk3.wiki b/archivers/libarchive/files/doc/wiki/ManPageArchiveWriteDisk3.wiki
new file mode 100644
index 00000000000..f71f85fc0ca
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageArchiveWriteDisk3.wiki
@@ -0,0 +1,358 @@
+#summary archive_write_disk 3 manual page
+== NAME ==
+*archive_write_disk_new*,
+*archive_write_disk_set_options*,
+*archive_write_disk_set_skip_file*,
+*archive_write_disk_set_group_lookup*,
+*archive_write_disk_set_standard_lookup*,
+*archive_write_disk_set_user_lookup*,
+*archive_write_header*,
+*archive_write_data*,
+*archive_write_finish_entry*,
+*archive_write_close*,
+*archive_write_finish*
+- functions for creating objects on disk
+== SYNOPSIS ==
+*#include <archive.h>*
+<br>
+*struct archive `*`*
+<br>
+*archive_write_disk_new*(_void_);
+<br>
+*int*
+<br>
+*archive_write_disk_set_options*(_struct archive `*`_, _int flags_);
+<br>
+*int*
+<br>
+*archive_write_disk_set_skip_file*(_struct archive `*`_, _dev_t_, _ino_t_);
+<br>
+*int*
+<br>
+*archive_write_disk_set_group_lookup*(_struct archive `*`_, _void `*`_, _gid_t (`*`)(void `*`, const char `*`gname, gid_t gid)_, _void (`*`cleanup)(void `*`)_);
+<br>
+*int*
+<br>
+*archive_write_disk_set_standard_lookup*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_disk_set_user_lookup*(_struct archive `*`_, _void `*`_, _uid_t (`*`)(void `*`, const char `*`uname, uid_t uid)_, _void (`*`cleanup)(void `*`)_);
+<br>
+*int*
+<br>
+*archive_write_header*(_struct archive `*`_, _struct archive_entry `*`_);
+<br>
+*ssize_t*
+<br>
+*archive_write_data*(_struct archive `*`_, _const void `*`_, _size_t_);
+<br>
+*int*
+<br>
+*archive_write_finish_entry*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_close*(_struct archive `*`_);
+<br>
+*int*
+<br>
+*archive_write_finish*(_struct archive `*`_);
+== DESCRIPTION ==
+These functions provide a complete API for creating objects on
+disk from
+*struct archive_entry*
+descriptions.
+They are most naturally used when extracting objects from an archive
+using the
+*archive_read*()
+interface.
+The general process is to read
+*struct archive_entry*
+objects from an archive, then write those objects to a
+*struct archive*
+object created using the
+*archive_write_disk*()
+family functions.
+This interface is deliberately very similar to the
+*archive_write*()
+interface used to write objects to a streaming archive.
+<dl>
+<dt>*archive_write_disk_new*()</dt><dd>
+Allocates and initializes a
+*struct archive*
+object suitable for writing objects to disk.
+</dd><dt>*archive_write_disk_set_skip_file*()</dt><dd>
+Records the device and inode numbers of a file that should not be
+overwritten.
+This is typically used to ensure that an extraction process does not
+overwrite the archive from which objects are being read.
+This capability is technically unnecessary but can be a significant
+performance optimization in practice.
+</dd><dt>*archive_write_disk_set_options*()</dt><dd>
+The options field consists of a bitwise OR of one or more of the
+following values:
+<dl>
+<dt>*ARCHIVE_EXTRACT_OWNER*</dt><dd>
+The user and group IDs should be set on the restored file.
+By default, the user and group IDs are not restored.
+</dd><dt>*ARCHIVE_EXTRACT_PERM*</dt><dd>
+Full permissions (including SGID, SUID, and sticky bits) should
+be restored exactly as specified, without obeying the
+current umask.
+Note that SUID and SGID bits can only be restored if the
+user and group ID of the object on disk are correct.
+If
+*ARCHIVE_EXTRACT_OWNER*
+is not specified, then SUID and SGID bits will only be restored
+if the default user and group IDs of newly-created objects on disk
+happen to match those specified in the archive entry.
+By default, only basic permissions are restored, and umask is obeyed.
+</dd><dt>*ARCHIVE_EXTRACT_TIME*</dt><dd>
+The timestamps (mtime, ctime, and atime) should be restored.
+By default, they are ignored.
+Note that restoring of atime is not currently supported.
+</dd><dt>*ARCHIVE_EXTRACT_NO_OVERWRITE*</dt><dd>
+Existing files on disk will not be overwritten.
+By default, existing regular files are truncated and overwritten;
+existing directories will have their permissions updated;
+other pre-existing objects are unlinked and recreated from scratch.
+</dd><dt>*ARCHIVE_EXTRACT_UNLINK*</dt><dd>
+Existing files on disk will be unlinked before any attempt to
+create them.
+In some cases, this can prove to be a significant performance improvement.
+By default, existing files are truncated and rewritten, but
+the file is not recreated.
+In particular, the default behavior does not break existing hard links.
+</dd><dt>*ARCHIVE_EXTRACT_ACL*</dt><dd>
+Attempt to restore ACLs.
+By default, extended ACLs are ignored.
+</dd><dt>*ARCHIVE_EXTRACT_FFLAGS*</dt><dd>
+Attempt to restore extended file flags.
+By default, file flags are ignored.
+</dd><dt>*ARCHIVE_EXTRACT_XATTR*</dt><dd>
+Attempt to restore POSIX.1e extended attributes.
+By default, they are ignored.
+</dd><dt>*ARCHIVE_EXTRACT_SECURE_SYMLINKS*</dt><dd>
+Refuse to extract any object whose final location would be altered
+by a symlink on disk.
+This is intended to help guard against a variety of mischief
+caused by archives that (deliberately or otherwise) extract
+files outside of the current directory.
+The default is not to perform this check.
+If
+*ARCHIVE_EXTRACT_UNLINK*
+is specified together with this option, the library will
+remove any intermediate symlinks it finds and return an
+error only if such symlink could not be removed.
+</dd><dt>*ARCHIVE_EXTRACT_SECURE_NODOTDOT*</dt><dd>
+Refuse to extract a path that contains a
+_.._
+element anywhere within it.
+The default is to not refuse such paths.
+Note that paths ending in
+_.._
+always cause an error, regardless of this flag.
+</dd><dt>*ARCHIVE_EXTRACT_SPARSE*</dt><dd>
+Scan data for blocks of NUL bytes and try to recreate them with holes.
+This results in sparse files, independent of whether the archive format
+supports or uses them.
+</dd></dl>
+</dd><dt>
+*archive_write_disk_set_group_lookup*(),
+*archive_write_disk_set_user_lookup*()
+</dt> <dd>
+The
+*struct archive_entry*
+objects contain both names and ids that can be used to identify users
+and groups.
+These names and ids describe the ownership of the file itself and
+also appear in ACL lists.
+By default, the library uses the ids and ignores the names, but
+this can be overridden by registering user and group lookup functions.
+To register, you must provide a lookup function which
+accepts both a name and id and returns a suitable id.
+You may also provide a
+*void `*`*
+pointer to a private data structure and a cleanup function for
+that data.
+The cleanup function will be invoked when the
+*struct archive*
+object is destroyed.
+</dd><dt>*archive_write_disk_set_standard_lookup*()</dt><dd>
+This convenience function installs a standard set of user
+and group lookup functions.
+These functions use
+*getpwnam*(3)
+and
+*getgrnam*(3)
+to convert names to ids, defaulting to the ids if the names cannot
+be looked up.
+These functions also implement a simple memory cache to reduce
+the number of calls to
+*getpwnam*(3)
+and
+*getgrnam*(3).
+</dd><dt>*archive_write_header*()</dt><dd>
+Build and write a header using the data in the provided
+*struct archive_entry*
+structure.
+See
+*archive_entry*(3)
+for information on creating and populating
+*struct archive_entry*
+objects.
+</dd><dt>*archive_write_data*()</dt><dd>
+Write data corresponding to the header just written.
+Returns number of bytes written or -1 on error.
+</dd><dt>*archive_write_finish_entry*()</dt><dd>
+Close out the entry just written.
+Ordinarily, clients never need to call this, as it
+is called automatically by
+*archive_write_next_header*()
+and
+*archive_write_close*()
+as needed.
+</dd><dt>*archive_write_close*()</dt><dd>
+Set any attributes that could not be set during the initial restore.
+For example, directory timestamps are not restored initially because
+restoring a subsequent file would alter that timestamp.
+Similarly, non-writable directories are initially created with
+write permissions (so that their contents can be restored).
+The
+*archive_write_disk_new*
+library maintains a list of all such deferred attributes and
+sets them when this function is invoked.
+</dd><dt>*archive_write_finish*()</dt><dd>
+Invokes
+*archive_write_close*()
+if it was not invoked manually, then releases all resources.
+</dd></dl>
+More information about the
+_struct_ archive
+object and the overall design of the library can be found in the
+*libarchive*(3)
+overview.
+Many of these functions are also documented under
+*archive_write*(3).
+== RETURN VALUES ==
+Most functions return
+*ARCHIVE_OK*
+(zero) on success, or one of several non-zero
+error codes for errors.
+Specific error codes include:
+*ARCHIVE_RETRY*
+for operations that might succeed if retried,
+*ARCHIVE_WARN*
+for unusual conditions that do not prevent further operations, and
+*ARCHIVE_FATAL*
+for serious errors that make remaining operations impossible.
+The
+*archive_errno*()
+and
+*archive_error_string*()
+functions can be used to retrieve an appropriate error code and a
+textual error message.
+
+*archive_write_disk_new*()
+returns a pointer to a newly-allocated
+*struct archive*
+object.
+
+*archive_write_data*()
+returns a count of the number of bytes actually written.
+On error, -1 is returned and the
+*archive_errno*()
+and
+*archive_error_string*()
+functions will return appropriate values.
+== SEE ALSO ==
+*archive_read*(3),
+*archive_write*(3),
+*tar*(1),
+*libarchive*(3)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+The
+*archive_write_disk*
+interface was added to
+*libarchive* 2.0
+and first appeared in
+FreeBSD 6.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
+== BUGS ==
+Directories are actually extracted in two distinct phases.
+Directories are created during
+*archive_write_header*(),
+but final permissions are not set until
+*archive_write_close*().
+This separation is necessary to correctly handle borderline
+cases such as a non-writable directory containing
+files, but can cause unexpected results.
+In particular, directory permissions are not fully
+restored until the archive is closed.
+If you use
+*chdir*(2)
+to change the current directory between calls to
+*archive_read_extract*()
+or before calling
+*archive_read_close*(),
+you may confuse the permission-setting logic with
+the result that directory permissions are restored
+incorrectly.
+
+The library attempts to create objects with filenames longer than
+*PATH_MAX*
+by creating prefixes of the full path and changing the current directory.
+Currently, this logic is limited in scope; the fixup pass does
+not work correctly for such objects and the symlink security check
+option disables the support for very long pathnames.
+
+Restoring the path
+_aa/../bb_
+does create each intermediate directory.
+In particular, the directory
+_aa_
+is created as well as the final object
+_bb_.
+In theory, this can be exploited to create an entire directory heirarchy
+with a single request.
+Of course, this does not work if the
+*ARCHIVE_EXTRACT_NODOTDOT*
+option is specified.
+
+Implicit directories are always created obeying the current umask.
+Explicit objects are created obeying the current umask unless
+*ARCHIVE_EXTRACT_PERM*
+is specified, in which case they current umask is ignored.
+
+SGID and SUID bits are restored only if the correct user and
+group could be set.
+If
+*ARCHIVE_EXTRACT_OWNER*
+is not specified, then no attempt is made to set the ownership.
+In this case, SGID and SUID bits are restored only if the
+user and group of the final object happen to match those specified
+in the entry.
+
+The
+"standard"
+user-id and group-id lookup functions are not the defaults because
+*getgrnam*(3)
+and
+*getpwnam*(3)
+are sometimes too large for particular applications.
+The current design allows the application author to use a more
+compact implementation when appropriate.
+
+There should be a corresponding
+*archive_read_disk*
+interface that walks a directory heirarchy and returns archive
+entry objects.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageBsdcpio1.wiki b/archivers/libarchive/files/doc/wiki/ManPageBsdcpio1.wiki
new file mode 100644
index 00000000000..d3c24f5b66a
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageBsdcpio1.wiki
@@ -0,0 +1,386 @@
+#summary BSDCPIO 1 manual page
+== NAME ==
+*cpio*
+- copy files to and from archives
+== SYNOPSIS ==
+<br>
+*cpio*
+{*-i*}
+`[`_options_`]`
+`[`_pattern_ ...`]`
+`[`_`<`_ archive`]`
+<br>
+*cpio*
+{*-o*}
+`[`_options_`]`
+_`<`_ name-list
+`[`_>_ archive`]`
+<br>
+*cpio*
+{*-p*}
+`[`_options_`]`
+_dest-dir_
+_`<`_ name-list
+== DESCRIPTION ==
+*cpio*
+copies files between archives and directories.
+This implementation can extract from tar, pax, cpio, zip, jar, ar,
+and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
+and shar archives.
+
+The first option to
+*cpio*
+is a mode indicator from the following list:
+<dl>
+<dt>*-i*</dt><dd>
+Input.
+Read an archive from standard input (unless overriden) and extract the
+contents to disk or (if the
+*-t*
+option is specified)
+list the contents to standard output.
+If one or more file patterns are specified, only files matching
+one of the patterns will be extracted.
+</dd><dt>*-o*</dt><dd>
+Output.
+Read a list of filenames from standard input and produce a new archive
+on standard output (unless overriden) containing the specified items.
+</dd><dt>*-p*</dt><dd>
+Pass-through.
+Read a list of filenames from standard input and copy the files to the
+specified directory.
+</dd></dl>
+
+== OPTIONS ==
+Unless specifically stated otherwise, options are applicable in
+all operating modes.
+<dl>
+<dt>*-0*</dt><dd>
+Read filenames separated by NUL characters instead of newlines.
+This is necessary if any of the filenames being read might contain newlines.
+</dd><dt>*-A*</dt><dd>
+(o mode only)
+Append to the specified archive.
+(Not yet implemented.)
+</dd><dt>*-a*</dt><dd>
+(o and p modes)
+Reset access times on files after they are read.
+</dd><dt>*-B*</dt><dd>
+(o mode only)
+Block output to records of 5120 bytes.
+</dd><dt>*-C* _size_</dt><dd>
+(o mode only)
+Block output to records of
+_size_
+bytes.
+</dd><dt>*-c*</dt><dd>
+(o mode only)
+Use the old POSIX portable character format.
+Equivalent to
+*--format* _odc_.
+</dd><dt>*-d*</dt><dd>
+(i and p modes)
+Create directories as necessary.
+</dd><dt>*-E* _file_</dt><dd>
+(i mode only)
+Read list of file name patterns from
+_file_
+to list and extract.
+</dd><dt>*-F* _file_</dt><dd>
+Read archive from or write archive to
+_file_.
+</dd><dt>*-f* _pattern_</dt><dd>
+(i mode only)
+Ignore files that match
+_pattern_.
+</dd><dt>*--format* _format_</dt><dd>
+(o mode only)
+Produce the output archive in the specified format.
+Supported formats include:
+
+<dl>
+<dt>_cpio_</dt><dd>
+Synonym for
+_odc_.
+</dd><dt>_newc_</dt><dd>
+The SVR4 portable cpio format.
+</dd><dt>_odc_</dt><dd>
+The old POSIX.1 portable octet-oriented cpio format.
+</dd><dt>_pax_</dt><dd>
+The POSIX.1 pax format, an extension of the ustar format.
+</dd><dt>_ustar_</dt><dd>
+The POSIX.1 tar format.
+</dd></dl>
+
+The default format is
+_odc_.
+See
+*libarchive_formats*(5)
+for more complete information about the
+formats currently supported by the underlying
+*libarchive*(3)
+library.
+</dd><dt>*-H* _format_</dt><dd>
+Synonym for
+*--format*.
+</dd><dt>*-h*, *--help*</dt><dd>
+Print usage information.
+</dd><dt>*-I* _file_</dt><dd>
+Read archive from
+_file_.
+</dd><dt>*-i*</dt><dd>
+Input mode.
+See above for description.
+</dd><dt>*--insecure*</dt><dd>
+(i and p mode only)
+Disable security checks during extraction or copying.
+This allows extraction via symbolic links and path names containing
+Sq ..
+in the name.
+</dd><dt>*-J*</dt><dd>
+(o mode only)
+Compress the file with xz-compatible compression before writing it.
+In input mode, this option is ignored; xz compression is recognized
+automatically on input.
+</dd><dt>*-j*</dt><dd>
+Synonym for
+*-y*.
+</dd><dt>*-L*</dt><dd>
+(o and p modes)
+All symbolic links will be followed.
+Normally, symbolic links are archived and copied as symbolic links.
+With this option, the target of the link will be archived or copied instead.
+</dd><dt>*-l*</dt><dd>
+(p mode only)
+Create links from the target directory to the original files,
+instead of copying.
+</dd><dt>*-lzma*</dt><dd>
+(o mode only)
+Compress the file with lzma-compatible compression before writing it.
+In input mode, this option is ignored; lzma compression is recognized
+automatically on input.
+</dd><dt>*-m*</dt><dd>
+(i and p modes)
+Set file modification time on created files to match
+those in the source.
+</dd><dt>*-n*</dt><dd>
+(i mode, only with
+*-t*)
+Display numeric uid and gid.
+By default,
+*cpio*
+displays the user and group names when they are provided in the
+archive, or looks up the user and group names in the system
+password database.
+</dd><dt>*-no-preserve-owner*</dt><dd>
+(i mode only)
+Do not attempt to restore file ownership.
+This is the default when run by non-root users.
+</dd><dt>*-O* _file_</dt><dd>
+Write archive to
+_file_.
+</dd><dt>*-o*</dt><dd>
+Output mode.
+See above for description.
+</dd><dt>*-p*</dt><dd>
+Pass-through mode.
+See above for description.
+</dd><dt>*-preserve-owner*</dt><dd>
+(i mode only)
+Restore file ownership.
+This is the default when run by the root user.
+</dd><dt>*--quiet*</dt><dd>
+Suppress unnecessary messages.
+</dd><dt>*-R* `[`user`]``[`:`]``[`group`]`</dt><dd>
+Set the owner and/or group on files in the output.
+If group is specified with no user
+(for example,
+*-R* _:wheel_)
+then the group will be set but not the user.
+If the user is specified with a trailing colon and no group
+(for example,
+*-R* _root:_)
+then the group will be set to the user's default group.
+If the user is specified with no trailing colon, then
+the user will be set but not the group.
+In
+*-i*
+and
+*-p*
+modes, this option can only be used by the super-user.
+(For compatibility, a period can be used in place of the colon.)
+</dd><dt>*-r*</dt><dd>
+(All modes.)
+Rename files interactively.
+For each file, a prompt is written to
+_/dev/tty_
+containing the name of the file and a line is read from
+_/dev/tty_.
+If the line read is blank, the file is skipped.
+If the line contains a single period, the file is processed normally.
+Otherwise, the line is taken to be the new name of the file.
+</dd><dt>*-t*</dt><dd>
+(i mode only)
+List the contents of the archive to stdout;
+do not restore the contents to disk.
+</dd><dt>*-u*</dt><dd>
+(i and p modes)
+Unconditionally overwrite existing files.
+Ordinarily, an older file will not overwrite a newer file on disk.
+</dd><dt>*-v*</dt><dd>
+Print the name of each file to stderr as it is processed.
+With
+*-t*,
+provide a detailed listing of each file.
+</dd><dt>*--version*</dt><dd>
+Print the program version information and exit.
+</dd><dt>*-y*</dt><dd>
+(o mode only)
+Compress the archive with bzip2-compatible compression before writing it.
+In input mode, this option is ignored;
+bzip2 compression is recognized automatically on input.
+</dd><dt>*-Z*</dt><dd>
+(o mode only)
+Compress the archive with compress-compatible compression before writing it.
+In input mode, this option is ignored;
+compression is recognized automatically on input.
+</dd><dt>*-z*</dt><dd>
+(o mode only)
+Compress the archive with gzip-compatible compression before writing it.
+In input mode, this option is ignored;
+gzip compression is recognized automatically on input.
+</dd></dl>
+== ENVIRONMENT ==
+The following environment variables affect the execution of
+*cpio*:
+<dl>
+<dt>*LANG*
+The locale to use.
+See
+*environ*(7)
+for more information.
+</dt><dt>*TZ*
+The timezone to use when displaying dates.
+See
+*environ*(7)
+for more information.
+</dt></dl>
+== EXIT STATUS ==
+The *cpio* utility exits 0 on success, and >0 if an error occurs.
+== EXAMPLES ==
+The
+*cpio*
+command is traditionally used to copy file heirarchies in conjunction
+with the
+*find*(1)
+command.
+The first example here simply copies all files from
+_src_
+to
+_dest_:
+{{{
+find src | cpio -pmud dest
+}}}
+
+By carefully selecting options to the
+*find*(1)
+command and combining it with other standard utilities,
+it is possible to exercise very fine control over which files are copied.
+This next example copies files from
+_src_
+to
+_dest_
+that are more than 2 days old and whose names match a particular pattern:
+{{{
+find src -mtime _+2_ | grep foo[bar] | cpio -pdmu dest
+}}}
+
+This example copies files from
+_src_
+to
+_dest_
+that are more than 2 days old and which contain the word
+"foobar":
+{{{
+find src -mtime _+2_ | xargs grep -l foobar | cpio -pdmu dest
+}}}
+== COMPATIBILITY ==
+The mode options i, o, and p and the options
+a, B, c, d, f, l, m, r, t, u, and v comply with SUSv2.
+
+The old POSIX.1 standard specified that only
+*-i*,
+*-o*,
+and
+*-p*
+were interpreted as command-line options.
+Each took a single argument of a list of modifier
+characters.
+For example, the standard syntax allows
+*-imu*
+but does not support
+*-miu*
+or
+*-i* *-m* *-u*,
+since
+_m_
+and
+_u_
+are only modifiers to
+*-i*,
+they are not command-line options in their own right.
+The syntax supported by this implementation is backwards-compatible
+with the standard.
+For best compatibility, scripts should limit themselves to the
+standard syntax.
+== SEE ALSO ==
+*bzip2*(1),
+*tar*(1),
+*gzip*(1),
+*mt*(1),
+*pax*(1),
+*libarchive*(3),
+*cpio*(5),
+*libarchive-formats*(5),
+*tar*(5)
+== STANDARDS ==
+There is no current POSIX standard for the cpio command; it appeared
+in
+ISO/IEC 9945-1:1996 (``POSIX.1'')
+but was dropped from
+IEEE Std 1003.1-2001 (``POSIX.1'').
+
+The cpio, ustar, and pax interchange file formats are defined by
+IEEE Std 1003.1-2001 (``POSIX.1'')
+for the pax command.
+== HISTORY ==
+The original
+*cpio*
+and
+*find*
+utilities were written by Dick Haight
+while working in AT&T's Unix Support Group.
+They first appeared in 1977 in PWB/UNIX 1.0, the
+"Programmer's Work Bench"
+system developed for use within AT&T.
+They were first released outside of AT&T as part of System III Unix in 1981.
+As a result,
+*cpio*
+actually predates
+*tar*,
+even though it was not well-known outside of AT&T until some time later.
+
+This is a complete re-implementation based on the
+*libarchive*(3)
+library.
+== BUGS ==
+The cpio archive format has several basic limitations:
+It does not store user and group names, only numbers.
+As a result, it cannot be reliably used to transfer
+files between systems with dissimilar user and group numbering.
+Older cpio formats limit the user and group numbers to
+16 or 18 bits, which is insufficient for modern systems.
+The cpio archive formats cannot support files over 4 gigabytes,
+except for the
+"odc"
+variant, which can support files up to 8 gigabytes.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageBsdtar1.wiki b/archivers/libarchive/files/doc/wiki/ManPageBsdtar1.wiki
new file mode 100644
index 00000000000..c1fedb14e1e
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageBsdtar1.wiki
@@ -0,0 +1,941 @@
+#summary BSDTAR 1 manual page
+== NAME ==
+*tar*
+- manipulate tape archives
+== SYNOPSIS ==
+<br>
+*tar*
+`[`_bundled-flags_ `<`args`>``]`
+`[``<`_file_`>` | `<`_pattern_`>` ...`]`
+<br>
+*tar*
+{*-c*}
+`[`_options_`]`
+`[`_files_ | _directories_`]`
+<br>
+*tar*
+{*-r* | *-u*}
+*-f* _archive-file_
+`[`_options_`]`
+`[`_files_ | _directories_`]`
+<br>
+*tar*
+{*-t* | *-x*}
+`[`_options_`]`
+`[`_patterns_`]`
+== DESCRIPTION ==
+*tar*
+creates and manipulates streaming archive files.
+This implementation can extract from tar, pax, cpio, zip, jar, ar,
+and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
+and shar archives.
+
+The first synopsis form shows a
+"bundled"
+option word.
+This usage is provided for compatibility with historical implementations.
+See COMPATIBILITY below for details.
+
+The other synopsis forms show the preferred usage.
+The first option to
+*tar*
+is a mode indicator from the following list:
+<dl>
+<dt>*-c*</dt><dd>
+Create a new archive containing the specified items.
+</dd><dt>*-r*</dt><dd>
+Like
+*-c*,
+but new entries are appended to the archive.
+Note that this only works on uncompressed archives stored in regular files.
+The
+*-f*
+option is required.
+</dd><dt>*-t*</dt><dd>
+List archive contents to stdout.
+</dd><dt>*-u*</dt><dd>
+Like
+*-r*,
+but new entries are added only if they have a modification date
+newer than the corresponding entry in the archive.
+Note that this only works on uncompressed archives stored in regular files.
+The
+*-f*
+option is required.
+</dd><dt>*-x*</dt><dd>
+Extract to disk from the archive.
+If a file with the same name appears more than once in the archive,
+each copy will be extracted, with later copies overwriting (replacing)
+earlier copies.
+</dd></dl>
+
+In
+*-c*,
+*-r*,
+or
+*-u*
+mode, each specified file or directory is added to the
+archive in the order specified on the command line.
+By default, the contents of each directory are also archived.
+
+In extract or list mode, the entire command line
+is read and parsed before the archive is opened.
+The pathnames or patterns on the command line indicate
+which items in the archive should be processed.
+Patterns are shell-style globbing patterns as
+documented in
+*tcsh*(1).
+== OPTIONS ==
+Unless specifically stated otherwise, options are applicable in
+all operating modes.
+<dl>
+<dt>*@*_archive_</dt><dd>
+(c and r mode only)
+The specified archive is opened and the entries
+in it will be appended to the current archive.
+As a simple example,
+{{{
+tar -c -f - newfile @original.tar
+}}}
+writes a new archive to standard output containing a file
+_newfile_
+and all of the entries from
+_original.tar_.
+In contrast,
+{{{
+tar -c -f - newfile original.tar
+}}}
+creates a new archive with only two entries.
+Similarly,
+{{{
+tar -czf - --format pax @-
+}}}
+reads an archive from standard input (whose format will be determined
+automatically) and converts it into a gzip-compressed
+pax-format archive on stdout.
+In this way,
+*tar*
+can be used to convert archives from one format to another.
+</dd><dt>*-b* _blocksize_</dt><dd>
+Specify the block size, in 512-byte records, for tape drive I/O.
+As a rule, this argument is only needed when reading from or writing
+to tape drives, and usually not even then as the default block size of
+20 records (10240 bytes) is very common.
+</dd><dt>*-C* _directory_</dt><dd>
+In c and r mode, this changes the directory before adding
+the following files.
+In x mode, change directories after opening the archive
+but before extracting entries from the archive.
+</dd><dt>*--check-links*</dt><dd>
+(c and r modes only)
+Issue a warning message unless all links to each file are archived.
+</dd><dt>*--chroot*</dt><dd>
+(x mode only)
+*chroot*()
+to the current directory after processing any
+*-C*
+options and before extracting any files.
+</dd><dt>*--exclude* _pattern_</dt><dd>
+Do not process files or directories that match the
+specified pattern.
+Note that exclusions take precedence over patterns or filenames
+specified on the command line.
+</dd><dt>*--format* _format_</dt><dd>
+(c, r, u mode only)
+Use the specified format for the created archive.
+Supported formats include
+"cpio",
+"pax",
+"shar",
+and
+"ustar".
+Other formats may also be supported; see
+*libarchive-formats*(5)
+for more information about currently-supported formats.
+In r and u modes, when extending an existing archive, the format specified
+here must be compatible with the format of the existing archive on disk.
+</dd><dt>*-f* _file_</dt><dd>
+Read the archive from or write the archive to the specified file.
+The filename can be
+_-_
+for standard input or standard output.
+If not specified, the default tape device will be used.
+(On
+FreeBSD,
+the default tape device is
+_/dev/sa0_.)
+</dd><dt>*-H*</dt><dd>
+(c and r mode only)
+Symbolic links named on the command line will be followed; the
+target of the link will be archived, not the link itself.
+</dd><dt>*-h*</dt><dd>
+(c and r mode only)
+Synonym for
+*-L*.
+</dd><dt>*-I*</dt><dd>
+Synonym for
+*-T*.
+</dd><dt>*--include* _pattern_</dt><dd>
+Process only files or directories that match the specified pattern.
+Note that exclusions specified with
+*--exclude*
+take precedence over inclusions.
+If no inclusions are explicitly specified, all entries are processed by
+default.
+The
+*--include*
+option is especially useful when filtering archives.
+For example, the command
+{{{
+tar -c -f new.tar --include='*foo*' @old.tgz
+}}}
+creates a new archive
+_new.tar_
+containing only the entries from
+_old.tgz_
+containing the string
+Sq foo.
+</dd><dt>*-j*</dt><dd>
+(c mode only)
+Compress the resulting archive with
+*bzip2*(1).
+In extract or list modes, this option is ignored.
+Note that, unlike other
+*tar*
+implementations, this implementation recognizes bzip2 compression
+automatically when reading archives.
+</dd><dt>*-k*</dt><dd>
+(x mode only)
+Do not overwrite existing files.
+In particular, if a file appears more than once in an archive,
+later copies will not overwrite earlier copies.
+</dd><dt>*--keep-newer-files*</dt><dd>
+(x mode only)
+Do not overwrite existing files that are newer than the
+versions appearing in the archive being extracted.
+</dd><dt>*-L*</dt><dd>
+(c and r mode only)
+All symbolic links will be followed.
+Normally, symbolic links are archived as such.
+With this option, the target of the link will be archived instead.
+</dd><dt>*-l*</dt><dd>
+This is a synonym for the
+*--check-links*
+option.
+</dd><dt>*-m*</dt><dd>
+(x mode only)
+Do not extract modification time.
+By default, the modification time is set to the time stored in the archive.
+</dd><dt>*-n*</dt><dd>
+(c, r, u modes only)
+Do not recursively archive the contents of directories.
+</dd><dt>*--newer* _date_</dt><dd>
+(c, r, u modes only)
+Only include files and directories newer than the specified date.
+This compares ctime entries.
+</dd><dt>*--newer-mtime* _date_</dt><dd>
+(c, r, u modes only)
+Like
+*--newer*,
+except it compares mtime entries instead of ctime entries.
+</dd><dt>*--newer-than* _file_</dt><dd>
+(c, r, u modes only)
+Only include files and directories newer than the specified file.
+This compares ctime entries.
+</dd><dt>*--newer-mtime-than* _file_</dt><dd>
+(c, r, u modes only)
+Like
+*--newer-than*,
+except it compares mtime entries instead of ctime entries.
+</dd><dt>*--nodump*</dt><dd>
+(c and r modes only)
+Honor the nodump file flag by skipping this file.
+</dd><dt>*--null*</dt><dd>
+(use with
+*-I*,
+*-T*,
+or
+*-X*)
+Filenames or patterns are separated by null characters,
+not by newlines.
+This is often used to read filenames output by the
+*-print0*
+option to
+*find*(1).
+</dd><dt>*--numeric-owner*</dt><dd>
+(x mode only)
+Ignore symbolic user and group names when restoring archives to disk,
+only numeric uid and gid values will be obeyed.
+</dd><dt>*-O*</dt><dd>
+(x, t modes only)
+In extract (-x) mode, files will be written to standard out rather than
+being extracted to disk.
+In list (-t) mode, the file listing will be written to stderr rather than
+the usual stdout.
+</dd><dt>*-o*</dt><dd>
+(x mode)
+Use the user and group of the user running the program rather
+than those specified in the archive.
+Note that this has no significance unless
+*-p*
+is specified, and the program is being run by the root user.
+In this case, the file modes and flags from
+the archive will be restored, but ACLs or owner information in
+the archive will be discarded.
+</dd><dt>*-o*</dt><dd>
+(c, r, u mode)
+A synonym for
+*--format* _ustar_
+</dd><dt>*--one-file-system*</dt><dd>
+(c, r, and u modes)
+Do not cross mount points.
+</dd><dt>*--options* _options_</dt><dd>
+Select optional behaviors for particular modules.
+The argument is a text string containing comma-separated
+keywords and values.
+These are passed to the modules that handle particular
+formats to control how those formats will behave.
+Each option has one of the following forms:
+<dl>
+<dt>_key=value_</dt><dd>
+The key will be set to the specified value in every module that supports it.
+Modules that do not support this key will ignore it.
+</dd><dt>_key_</dt><dd>
+The key will be enabled in every module that supports it.
+This is equivalent to
+_key_*=1*.
+</dd><dt>_!key_</dt><dd>
+The key will be disabled in every module that supports it.
+</dd><dt>_module:key=value_, _module:key_, _module:!key_</dt><dd>
+As above, but the corresponding key and value will be provided
+only to modules whose name matches
+_module_.
+</dd></dl>
+The currently supported modules and keys are:
+<dl>
+<dt>*iso9660:joliet*</dt><dd>
+Support Joliet extensions.
+This is enabled by default, use
+*!joliet*
+or
+*iso9660:!joliet*
+to disable.
+</dd><dt>*iso9660:rockridge*</dt><dd>
+Support Rock Ridge extensions.
+This is enabled by default, use
+*!rockridge*
+or
+*iso9660:!rockridge*
+to disable.
+</dd><dt>*gzip:compression-level*</dt><dd>
+A decimal integer from 0 to 9 specifying the gzip compression level.
+</dd><dt>*xz:compression-level*</dt><dd>
+A decimal integer from 0 to 9 specifying the xz compression level.
+</dd><dt>*mtree:*_keyword_</dt><dd>
+The mtree writer module allows you to specify which mtree keywords
+will be included in the output.
+Supported keywords include:
+*cksum*, *device*, *flags*, *gid*, *gname*, *indent*,
+*link*, *md5*, *mode*, *nlink*, *rmd160*, *sha1*, *sha256*,
+*sha384*, *sha512*, *size*, *time*, *uid*, *uname*.
+The default is equivalent to:
+"device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname".
+</dd><dt>*mtree:all*</dt><dd>
+Enables all of the above keywords.
+You can also use
+*mtree:!all*
+to disable all keywords.
+</dd><dt>*mtree:use-set*</dt><dd>
+Enable generation of
+*/set*
+lines in the output.
+</dd><dt>*mtree:indent*</dt><dd>
+Produce human-readable output by indenting options and splitting lines
+to fit into 80 columns.
+</dd><dt>*zip:compression*=_type_</dt><dd>
+Use
+_type_
+as compression method.
+Supported values are store (uncompressed) and deflate (gzip algorithm).
+</dd></dl>
+If a provided option is not supported by any module, that
+is a fatal error.
+</dd><dt>*-P*</dt><dd>
+Preserve pathnames.
+By default, absolute pathnames (those that begin with a /
+character) have the leading slash removed both when creating archives
+and extracting from them.
+Also,
+*tar*
+will refuse to extract archive entries whose pathnames contain
+_.._
+or whose target directory would be altered by a symlink.
+This option suppresses these behaviors.
+</dd><dt>*-p*</dt><dd>
+(x mode only)
+Preserve file permissions.
+Attempt to restore the full permissions, including owner, file modes, file
+flags and ACLs, if available, for each item extracted from the archive.
+By default, newly-created files are owned by the user running
+*tar*,
+the file mode is restored for newly-created regular files, and
+all other types of entries receive default permissions.
+If
+*tar*
+is being run by root, the default is to restore the owner unless the
+*-o*
+option is also specified.
+</dd><dt>*-q* (*--fast-read*)</dt><dd>
+(x and t mode only)
+Extract or list only the first archive entry that matches each pattern
+or filename operand.
+Exit as soon as each specified pattern or filename has been matched.
+By default, the archive is always read to the very end, since
+there can be multiple entries with the same name and, by convention,
+later entries overwrite earlier entries.
+This option is provided as a performance optimization.
+</dd><dt>*-S*</dt><dd>
+(x mode only)
+Extract files as sparse files.
+For every block on disk, check first if it contains only NULL bytes and seek
+over it otherwise.
+This works similiar to the conv=sparse option of dd.
+</dd><dt>*--strip-components* _count_</dt><dd>
+(x mode only)
+Remove the specified number of leading path elements.
+Pathnames with fewer elements will be silently skipped.
+Note that the pathname is edited after checking inclusion/exclusion patterns
+but before security checks.
+</dd><dt>*-s* _pattern_</dt><dd>
+Modify file or archive member names according to
+_pattern_.
+The pattern has the format
+_/old/new/_`[`gps`]`
+where
+_old_
+is a basic regular expression,
+_new_
+is the replacement string of the matched part,
+and the optional trailing letters modify
+how the replacement is handled.
+If
+_old_
+is not matched, the pattern is skipped.
+Within
+_new_,
+~ is substituted with the match, \1 to \9 with the content of
+the corresponding captured group.
+The optional trailing g specifies that matching should continue
+after the matched part and stopped on the first unmatched pattern.
+The optional trailing s specifies that the pattern applies to the value
+of symbolic links.
+The optional trailing p specifies that after a successful substitution
+the original path name and the new path name should be printed to
+standard error.
+</dd><dt>*-T* _filename_</dt><dd>
+In x or t mode,
+*tar*
+will read the list of names to be extracted from
+_filename_.
+In c mode,
+*tar*
+will read names to be archived from
+_filename_.
+The special name
+"-C"
+on a line by itself will cause the current directory to be changed to
+the directory specified on the following line.
+Names are terminated by newlines unless
+*--null*
+is specified.
+Note that
+*--null*
+also disables the special handling of lines containing
+"-C".
+</dd><dt>*-U*</dt><dd>
+(x mode only)
+Unlink files before creating them.
+Without this option,
+*tar*
+overwrites existing files, which preserves existing hardlinks.
+With this option, existing hardlinks will be broken, as will any
+symlink that would affect the location of an extracted file.
+</dd><dt>*--use-compress-program* _program_</dt><dd>
+Pipe the input (in x or t mode) or the output (in c mode) through
+_program_
+instead of using the builtin compression support.
+</dd><dt>*-v*</dt><dd>
+Produce verbose output.
+In create and extract modes,
+*tar*
+will list each file name as it is read from or written to
+the archive.
+In list mode,
+*tar*
+will produce output similar to that of
+*ls*(1).
+Additional
+*-v*
+options will provide additional detail.
+</dd><dt>*--version*</dt><dd>
+Print version of
+*tar*
+and
+*libarchive*,
+and exit.
+</dd><dt>*-w*</dt><dd>
+Ask for confirmation for every action.
+</dd><dt>*-X* _filename_</dt><dd>
+Read a list of exclusion patterns from the specified file.
+See
+*--exclude*
+for more information about the handling of exclusions.
+</dd><dt>*-y*</dt><dd>
+(c mode only)
+Compress the resulting archive with
+*bzip2*(1).
+In extract or list modes, this option is ignored.
+Note that, unlike other
+*tar*
+implementations, this implementation recognizes bzip2 compression
+automatically when reading archives.
+</dd><dt>*-z*</dt><dd>
+(c mode only)
+Compress the resulting archive with
+*gzip*(1).
+In extract or list modes, this option is ignored.
+Note that, unlike other
+*tar*
+implementations, this implementation recognizes gzip compression
+automatically when reading archives.
+</dd><dt>*-Z*</dt><dd>
+(c mode only)
+Compress the resulting archive with
+*compress*(1).
+In extract or list modes, this option is ignored.
+Note that, unlike other
+*tar*
+implementations, this implementation recognizes compress compression
+automatically when reading archives.
+</dd></dl>
+== ENVIRONMENT ==
+The following environment variables affect the execution of
+*tar*:
+<dl>
+<dt>*LANG*
+The locale to use.
+See
+*environ*(7)
+for more information.
+</dt><dt>*TAPE*
+The default tape device.
+The
+*-f*
+option overrides this.
+</dt><dt>*TZ*
+The timezone to use when displaying dates.
+See
+*environ*(7)
+for more information.
+</dt></dl>
+== FILES ==
+<dl>
+<dt>*/dev/sa0*
+The default tape device, if not overridden by the
+.IR TAPE
+environment variable or the
+*-f*
+option.
+</dt></dl>
+== EXIT STATUS ==
+The *tar* utility exits 0 on success, and >0 if an error occurs.
+== EXAMPLES ==
+The following creates a new archive
+called
+_file.tar.gz_
+that contains two files
+_source.c_
+and
+_source.h_:
+{{{
+tar -czf file.tar.gz source.c source.h
+}}}
+
+To view a detailed table of contents for this
+archive:
+{{{
+tar -tvf file.tar.gz
+}}}
+
+To extract all entries from the archive on
+the default tape drive:
+{{{
+tar -x
+}}}
+
+To examine the contents of an ISO 9660 cdrom image:
+{{{
+tar -tf image.iso
+}}}
+
+To move file hierarchies, invoke
+*tar*
+as
+{{{
+tar -cf - -C srcdir\. | tar -xpf - -C destdir
+}}}
+or more traditionally
+{{{
+cd srcdir ; tar -cf -\. | (cd destdir ; tar -xpf -)
+}}}
+
+In create mode, the list of files and directories to be archived
+can also include directory change instructions of the form
+*-C*_foo/baz_
+and archive inclusions of the form
+*@*_archive-file_.
+For example, the command line
+{{{
+tar -c -f new.tar foo1 @old.tgz -C/tmp foo2
+}}}
+will create a new archive
+_new.tar_.
+*tar*
+will read the file
+_foo1_
+from the current directory and add it to the output archive.
+It will then read each entry from
+_old.tgz_
+and add those entries to the output archive.
+Finally, it will switch to the
+_/tmp_
+directory and add
+_foo2_
+to the output archive.
+
+An input file in
+*mtree*(5)
+format can be used to create an output archive with arbitrary ownership,
+permissions, or names that differ from existing data on disk:
+
+{{{
+$ cat input.mtree
+}}}
+{{{
+#mtree
+}}}
+{{{
+usr/bin uid=0 gid=0 mode=0755 type=dir
+}}}
+{{{
+usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
+}}}
+{{{
+$ tar -cvf output.tar @input.mtree
+}}}
+
+The
+*--newer*
+and
+*--newer-mtime*
+switches accept a variety of common date and time specifications, including
+"12 Mar 2005 7:14:29pm",
+"2005-03-12 19:14",
+"5 minutes ago",
+and
+"19:14 PST May 1".
+
+The
+*--options*
+argument can be used to control various details of archive generation
+or reading.
+For example, you can generate mtree output which only contains
+*type*, *time*,
+and
+*uid*
+keywords:
+{{{
+tar -cf file.tar --format=mtree --options='!all,type,time,uid' dir
+}}}
+or you can set the compression level used by gzip or xz compression:
+{{{
+tar -czf file.tar --options='compression-level=9'.
+}}}
+For more details, see the explanation of the
+*archive_read_set_options*()
+and
+*archive_write_set_options*()
+API calls that are described in
+*archive_read*(3)
+and
+*archive_write*(3).
+== COMPATIBILITY ==
+The bundled-arguments format is supported for compatibility
+with historic implementations.
+It consists of an initial word (with no leading - character) in which
+each character indicates an option.
+Arguments follow as separate words.
+The order of the arguments must match the order
+of the corresponding characters in the bundled command word.
+For example,
+{{{
+tar tbf 32 file.tar
+}}}
+specifies three flags
+*t*,
+*b*,
+and
+*f*.
+The
+*b*
+and
+*f*
+flags both require arguments,
+so there must be two additional items
+on the command line.
+The
+_32_
+is the argument to the
+*b*
+flag, and
+_file.tar_
+is the argument to the
+*f*
+flag.
+
+The mode options c, r, t, u, and x and the options
+b, f, l, m, o, v, and w comply with SUSv2.
+
+For maximum portability, scripts that invoke
+*tar*
+should use the bundled-argument format above, should limit
+themselves to the
+*c*,
+*t*,
+and
+*x*
+modes, and the
+*b*,
+*f*,
+*m*,
+*v*,
+and
+*w*
+options.
+
+Additional long options are provided to improve compatibility with other
+tar implementations.
+== SECURITY ==
+Certain security issues are common to many archiving programs, including
+*tar*.
+In particular, carefully-crafted archives can request that
+*tar*
+extract files to locations outside of the target directory.
+This can potentially be used to cause unwitting users to overwrite
+files they did not intend to overwrite.
+If the archive is being extracted by the superuser, any file
+on the system can potentially be overwritten.
+There are three ways this can happen.
+Although
+*tar*
+has mechanisms to protect against each one,
+savvy users should be aware of the implications:
+<ul>
+<li>
+Archive entries can have absolute pathnames.
+By default,
+*tar*
+removes the leading
+_/_
+character from filenames before restoring them to guard against this problem.
+</li><li>
+Archive entries can have pathnames that include
+_.._
+components.
+By default,
+*tar*
+will not extract files containing
+_.._
+components in their pathname.
+</li><li>
+Archive entries can exploit symbolic links to restore
+files to other directories.
+An archive can restore a symbolic link to another directory,
+then use that link to restore a file into that directory.
+To guard against this,
+*tar*
+checks each extracted path for symlinks.
+If the final path element is a symlink, it will be removed
+and replaced with the archive entry.
+If
+*-U*
+is specified, any intermediate symlink will also be unconditionally removed.
+If neither
+*-U*
+nor
+*-P*
+is specified,
+*tar*
+will refuse to extract the entry.
+</li></ul>
+To protect yourself, you should be wary of any archives that
+come from untrusted sources.
+You should examine the contents of an archive with
+{{{
+tar -tf filename
+}}}
+before extraction.
+You should use the
+*-k*
+option to ensure that
+*tar*
+will not overwrite any existing files or the
+*-U*
+option to remove any pre-existing files.
+You should generally not extract archives while running with super-user
+privileges.
+Note that the
+*-P*
+option to
+*tar*
+disables the security checks above and allows you to extract
+an archive while preserving any absolute pathnames,
+_.._
+components, or symlinks to other directories.
+== SEE ALSO ==
+*bzip2*(1),
+*compress*(1),
+*cpio*(1),
+*gzip*(1),
+*mt*(1),
+*pax*(1),
+*shar*(1),
+*libarchive*(3),
+*libarchive-formats*(5),
+*tar*(5)
+== STANDARDS ==
+There is no current POSIX standard for the tar command; it appeared
+in
+ISO/IEC 9945-1:1996 (``POSIX.1'')
+but was dropped from
+IEEE Std 1003.1-2001 (``POSIX.1'').
+The options used by this implementation were developed by surveying a
+number of existing tar implementations as well as the old POSIX specification
+for tar and the current POSIX specification for pax.
+
+The ustar and pax interchange file formats are defined by
+IEEE Std 1003.1-2001 (``POSIX.1'')
+for the pax command.
+== HISTORY ==
+A
+*tar*
+command appeared in Seventh Edition Unix, which was released in January, 1979.
+There have been numerous other implementations,
+many of which extended the file format.
+John Gilmore's
+*pdtar*
+public-domain implementation (circa November, 1987)
+was quite influential, and formed the basis of GNU tar.
+GNU tar was included as the standard system tar
+in
+FreeBSD
+beginning with
+FreeBSD 1.0.
+
+This is a complete re-implementation based on the
+*libarchive*(3)
+library.
+== BUGS ==
+This program follows
+ISO/IEC 9945-1:1996 (``POSIX.1'')
+for the definition of the
+*-l*
+option.
+Note that GNU tar prior to version 1.15 treated
+*-l*
+as a synonym for the
+*--one-file-system*
+option.
+
+The
+*-C* _dir_
+option may differ from historic implementations.
+
+All archive output is written in correctly-sized blocks, even
+if the output is being compressed.
+Whether or not the last output block is padded to a full
+block size varies depending on the format and the
+output device.
+For tar and cpio formats, the last block of output is padded
+to a full block size if the output is being
+written to standard output or to a character or block device such as
+a tape drive.
+If the output is being written to a regular file, the last block
+will not be padded.
+Many compressors, including
+*gzip*(1)
+and
+*bzip2*(1),
+complain about the null padding when decompressing an archive created by
+*tar*,
+although they still extract it correctly.
+
+The compression and decompression is implemented internally, so
+there may be insignificant differences between the compressed output
+generated by
+{{{
+tar -czf - file
+}}}
+and that generated by
+{{{
+tar -cf - file | gzip
+}}}
+
+The default should be to read and write archives to the standard I/O paths,
+but tradition (and POSIX) dictates otherwise.
+
+The
+*r*
+and
+*u*
+modes require that the archive be uncompressed
+and located in a regular file on disk.
+Other archives can be modified using
+*c*
+mode with the
+_@archive-file_
+extension.
+
+To archive a file called
+_@foo_
+or
+_-foo_
+you must specify it as
+_./@foo_
+or
+_./-foo_,
+respectively.
+
+In create mode, a leading
+_./_
+is always removed.
+A leading
+_/_
+is stripped unless the
+*-P*
+option is specified.
+
+There needs to be better support for file selection on both create
+and extract.
+
+There is not yet any support for multi-volume archives or for archiving
+sparse files.
+
+Converting between dissimilar archive formats (such as tar and cpio) using the
+*@*_-_
+convention can cause hard link information to be lost.
+(This is a consequence of the incompatible ways that different archive
+formats store hardlink information.)
+
+There are alternative long options for many of the short options that
+are deliberately not documented.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageCpio5.wiki b/archivers/libarchive/files/doc/wiki/ManPageCpio5.wiki
new file mode 100644
index 00000000000..f39f64f4711
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageCpio5.wiki
@@ -0,0 +1,297 @@
+#summary CPIO 5 manual page
+== NAME ==
+*cpio*
+- format of cpio archive files
+== DESCRIPTION ==
+The
+*cpio*
+archive format collects any number of files, directories, and other
+file system objects (symbolic links, device nodes, etc.) into a single
+stream of bytes.
+=== General Format===
+Each file system object in a
+*cpio*
+archive comprises a header record with basic numeric metadata
+followed by the full pathname of the entry and the file data.
+The header record stores a series of integer values that generally
+follow the fields in
+_struct_ stat.
+(See
+*stat*(2)
+for details.)
+The variants differ primarily in how they store those integers
+(binary, octal, or hexadecimal).
+The header is followed by the pathname of the
+entry (the length of the pathname is stored in the header)
+and any file data.
+The end of the archive is indicated by a special record with
+the pathname
+"TRAILER!!!".
+=== PWB format===
+XXX Any documentation of the original PWB/UNIX 1.0 format? XXX
+=== Old Binary Format===
+The old binary
+*cpio*
+format stores numbers as 2-byte and 4-byte binary values.
+Each entry begins with a header in the following format:
+{{{
+struct header_old_cpio {
+ unsigned short c_magic;
+ unsigned short c_dev;
+ unsigned short c_ino;
+ unsigned short c_mode;
+ unsigned short c_uid;
+ unsigned short c_gid;
+ unsigned short c_nlink;
+ unsigned short c_rdev;
+ unsigned short c_mtime[2];
+ unsigned short c_namesize;
+ unsigned short c_filesize[2];
+};
+}}}
+
+The
+_unsigned_ short
+fields here are 16-bit integer values; the
+_unsigned_ int
+fields are 32-bit integer values.
+The fields are as follows
+<dl>
+<dt>_magic_</dt><dd>
+The integer value octal 070707.
+This value can be used to determine whether this archive is
+written with little-endian or big-endian integers.
+</dd><dt>_dev_, _ino_</dt><dd>
+The device and inode numbers from the disk.
+These are used by programs that read
+*cpio*
+archives to determine when two entries refer to the same file.
+Programs that synthesize
+*cpio*
+archives should be careful to set these to distinct values for each entry.
+</dd><dt>_mode_</dt><dd>
+The mode specifies both the regular permissions and the file type.
+It consists of several bit fields as follows:
+<dl>
+<dt>0170000</dt><dd>
+This masks the file type bits.
+</dd><dt>0140000</dt><dd>
+File type value for sockets.
+</dd><dt>0120000</dt><dd>
+File type value for symbolic links.
+For symbolic links, the link body is stored as file data.
+</dd><dt>0100000</dt><dd>
+File type value for regular files.
+</dd><dt>0060000</dt><dd>
+File type value for block special devices.
+</dd><dt>0040000</dt><dd>
+File type value for directories.
+</dd><dt>0020000</dt><dd>
+File type value for character special devices.
+</dd><dt>0010000</dt><dd>
+File type value for named pipes or FIFOs.
+</dd><dt>0004000</dt><dd>
+SUID bit.
+</dd><dt>0002000</dt><dd>
+SGID bit.
+</dd><dt>0001000</dt><dd>
+Sticky bit.
+On some systems, this modifies the behavior of executables and/or directories.
+</dd><dt>0000777</dt><dd>
+The lower 9 bits specify read/write/execute permissions
+for world, group, and user following standard POSIX conventions.
+</dd></dl>
+</dd><dt>_uid_, _gid_</dt><dd>
+The numeric user id and group id of the owner.
+</dd><dt>_nlink_</dt><dd>
+The number of links to this file.
+Directories always have a value of at least two here.
+Note that hardlinked files include file data with every copy in the archive.
+</dd><dt>_rdev_</dt><dd>
+For block special and character special entries,
+this field contains the associated device number.
+For all other entry types, it should be set to zero by writers
+and ignored by readers.
+</dd><dt>_mtime_</dt><dd>
+Modification time of the file, indicated as the number
+of seconds since the start of the epoch,
+00:00:00 UTC January 1, 1970.
+The four-byte integer is stored with the most-significant 16 bits first
+followed by the least-significant 16 bits.
+Each of the two 16 bit values are stored in machine-native byte order.
+</dd><dt>_namesize_</dt><dd>
+The number of bytes in the pathname that follows the header.
+This count includes the trailing NUL byte.
+</dd><dt>_filesize_</dt><dd>
+The size of the file.
+Note that this archive format is limited to
+four gigabyte file sizes.
+See
+_mtime_
+above for a description of the storage of four-byte integers.
+</dd></dl>
+
+The pathname immediately follows the fixed header.
+If the
+*namesize*
+is odd, an additional NUL byte is added after the pathname.
+The file data is then appended, padded with NUL
+bytes to an even length.
+
+Hardlinked files are not given special treatment;
+the full file contents are included with each copy of the
+file.
+=== Portable ASCII Format===
+Version 2 of the Single UNIX Specification (``SUSv2'')
+standardized an ASCII variant that is portable across all
+platforms.
+It is commonly known as the
+"old character"
+format or as the
+"odc"
+format.
+It stores the same numeric fields as the old binary format, but
+represents them as 6-character or 11-character octal values.
+{{{
+struct cpio_odc_header {
+ char c_magic[6];
+ char c_dev[6];
+ char c_ino[6];
+ char c_mode[6];
+ char c_uid[6];
+ char c_gid[6];
+ char c_nlink[6];
+ char c_rdev[6];
+ char c_mtime[11];
+ char c_namesize[6];
+ char c_filesize[11];
+};
+}}}
+
+The fields are identical to those in the old binary format.
+The name and file body follow the fixed header.
+Unlike the old binary format, there is no additional padding
+after the pathname or file contents.
+If the files being archived are themselves entirely ASCII, then
+the resulting archive will be entirely ASCII, except for the
+NUL byte that terminates the name field.
+=== New ASCII Format===
+The "new" ASCII format uses 8-byte hexadecimal fields for
+all numbers and separates device numbers into separate fields
+for major and minor numbers.
+{{{
+struct cpio_newc_header {
+ char c_magic[6];
+ char c_ino[8];
+ char c_mode[8];
+ char c_uid[8];
+ char c_gid[8];
+ char c_nlink[8];
+ char c_mtime[8];
+ char c_filesize[8];
+ char c_devmajor[8];
+ char c_devminor[8];
+ char c_rdevmajor[8];
+ char c_rdevminor[8];
+ char c_namesize[8];
+ char c_check[8];
+};
+}}}
+
+Except as specified below, the fields here match those specified
+for the old binary format above.
+<dl>
+<dt>_magic_</dt><dd>
+The string
+"070701".
+</dd><dt>_check_</dt><dd>
+This field is always set to zero by writers and ignored by readers.
+See the next section for more details.
+</dd></dl>
+
+The pathname is followed by NUL bytes so that the total size
+of the fixed header plus pathname is a multiple of four.
+Likewise, the file data is padded to a multiple of four bytes.
+Note that this format supports only 4 gigabyte files (unlike the
+older ASCII format, which supports 8 gigabyte files).
+
+In this format, hardlinked files are handled by setting the
+filesize to zero for each entry except the last one that
+appears in the archive.
+=== New CRC Format===
+The CRC format is identical to the new ASCII format described
+in the previous section except that the magic field is set
+to
+"070702"
+and the
+_check_
+field is set to the sum of all bytes in the file data.
+This sum is computed treating all bytes as unsigned values
+and using unsigned arithmetic.
+Only the least-significant 32 bits of the sum are stored.
+=== HP variants===
+The
+*cpio*
+implementation distributed with HPUX used XXXX but stored
+device numbers differently XXX.
+=== Other Extensions and Variants===
+Sun Solaris uses additional file types to store extended file
+data, including ACLs and extended attributes, as special
+entries in cpio archives.
+
+XXX Others? XXX
+== BUGS ==
+The
+"CRC"
+format is mis-named, as it uses a simple checksum and
+not a cyclic redundancy check.
+
+The old binary format is limited to 16 bits for user id,
+group id, device, and inode numbers.
+It is limited to 4 gigabyte file sizes.
+
+The old ASCII format is limited to 18 bits for
+the user id, group id, device, and inode numbers.
+It is limited to 8 gigabyte file sizes.
+
+The new ASCII format is limited to 4 gigabyte file sizes.
+
+None of the cpio formats store user or group names,
+which are essential when moving files between systems with
+dissimilar user or group numbering.
+
+Especially when writing older cpio variants, it may be necessary
+to map actual device/inode values to synthesized values that
+fit the available fields.
+With very large filesystems, this may be necessary even for
+the newer formats.
+== SEE ALSO ==
+*cpio*(1),
+*tar*(5)
+== STANDARDS ==
+The
+*cpio*
+utility is no longer a part of POSIX or the Single Unix Standard.
+It last appeared in
+Version 2 of the Single UNIX Specification (``SUSv2'').
+It has been supplanted in subsequent standards by
+*pax*(1).
+The portable ASCII format is currently part of the specification for the
+*pax*(1)
+utility.
+== HISTORY ==
+The original cpio utility was written by Dick Haight
+while working in AT&T's Unix Support Group.
+It appeared in 1977 as part of PWB/UNIX 1.0, the
+"Programmer's Work Bench"
+derived from
+At v6
+that was used internally at AT&T.
+Both the old binary and old character formats were in use
+by 1980, according to the System III source released
+by SCO under their
+"Ancient Unix"
+license.
+The character format was adopted as part of
+IEEE Std 1003.1-1988 (``POSIX.1'').
+XXX when did "newc" appear? Who invented it? When did HP come out with their variant? When did Sun introduce ACLs and extended attributes? XXX
diff --git a/archivers/libarchive/files/doc/wiki/ManPageLibarchive3.wiki b/archivers/libarchive/files/doc/wiki/ManPageLibarchive3.wiki
new file mode 100644
index 00000000000..997212f1232
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageLibarchive3.wiki
@@ -0,0 +1,302 @@
+#summary LIBARCHIVE 3 manual page
+== NAME ==
+*libarchive*
+- functions for reading and writing streaming archives
+== LIBRARY ==
+Lb libarchive
+== OVERVIEW ==
+The
+*libarchive*
+library provides a flexible interface for reading and writing
+streaming archive files such as tar and cpio.
+The library is inherently stream-oriented; readers serially iterate through
+the archive, writers serially add things to the archive.
+In particular, note that there is no built-in support for
+random access nor for in-place modification.
+
+When reading an archive, the library automatically detects the
+format and the compression.
+The library currently has read support for:
+<ul>
+<li>
+old-style tar archives,
+</li><li>
+most variants of the POSIX
+"ustar"
+format,
+</li><li>
+the POSIX
+"pax interchange"
+format,
+</li><li>
+GNU-format tar archives,
+</li><li>
+most common cpio archive formats,
+</li><li>
+ISO9660 CD images (with or without RockRidge extensions),
+</li><li>
+Zip archives.
+</li></ul>
+The library automatically detects archives compressed with
+*gzip*(1),
+*bzip2*(1),
+or
+*compress*(1)
+and decompresses them transparently.
+
+When writing an archive, you can specify the compression
+to be used and the format to use.
+The library can write
+<ul>
+<li>
+POSIX-standard
+"ustar"
+archives,
+</li><li>
+POSIX
+"pax interchange format"
+archives,
+</li><li>
+POSIX octet-oriented cpio archives,
+</li><li>
+two different variants of shar archives.
+</li></ul>
+Pax interchange format is an extension of the tar archive format that
+eliminates essentially all of the limitations of historic tar formats
+in a standard fashion that is supported
+by POSIX-compliant
+*pax*(1)
+implementations on many systems as well as several newer implementations of
+*tar*(1).
+Note that the default write format will suppress the pax extended
+attributes for most entries; explicitly requesting pax format will
+enable those attributes for all entries.
+
+The read and write APIs are accessed through the
+*archive_read_XXX*()
+functions and the
+*archive_write_XXX*()
+functions, respectively, and either can be used independently
+of the other.
+
+The rest of this manual page provides an overview of the library
+operation.
+More detailed information can be found in the individual manual
+pages for each API or utility function.
+== READING AN ARCHIVE ==
+To read an archive, you must first obtain an initialized
+*struct archive*
+object from
+*archive_read_new*().
+You can then modify this object for the desired operations with the
+various
+*archive_read_set_XXX*()
+and
+*archive_read_support_XXX*()
+functions.
+In particular, you will need to invoke appropriate
+*archive_read_support_XXX*()
+functions to enable the corresponding compression and format
+support.
+Note that these latter functions perform two distinct operations:
+they cause the corresponding support code to be linked into your
+program, and they enable the corresponding auto-detect code.
+Unless you have specific constraints, you will generally want
+to invoke
+*archive_read_support_compression_all*()
+and
+*archive_read_support_format_all*()
+to enable auto-detect for all formats and compression types
+currently supported by the library.
+
+Once you have prepared the
+*struct archive*
+object, you call
+*archive_read_open*()
+to actually open the archive and prepare it for reading.
+There are several variants of this function;
+the most basic expects you to provide pointers to several
+functions that can provide blocks of bytes from the archive.
+There are convenience forms that allow you to
+specify a filename, file descriptor,
+*FILE `*`*
+object, or a block of memory from which to read the archive data.
+Note that the core library makes no assumptions about the
+size of the blocks read;
+callback functions are free to read whatever block size is
+most appropriate for the medium.
+
+Each archive entry consists of a header followed by a certain
+amount of data.
+You can obtain the next header with
+*archive_read_next_header*(),
+which returns a pointer to an
+*struct archive_entry*
+structure with information about the current archive element.
+If the entry is a regular file, then the header will be followed
+by the file data.
+You can use
+*archive_read_data*()
+(which works much like the
+*read*(2)
+system call)
+to read this data from the archive.
+You may prefer to use the higher-level
+*archive_read_data_skip*(),
+which reads and discards the data for this entry,
+*archive_read_data_to_buffer*(),
+which reads the data into an in-memory buffer,
+*archive_read_data_to_file*(),
+which copies the data to the provided file descriptor, or
+*archive_read_extract*(),
+which recreates the specified entry on disk and copies data
+from the archive.
+In particular, note that
+*archive_read_extract*()
+uses the
+*struct archive_entry*
+structure that you provide it, which may differ from the
+entry just read from the archive.
+In particular, many applications will want to override the
+pathname, file permissions, or ownership.
+
+Once you have finished reading data from the archive, you
+should call
+*archive_read_close*()
+to close the archive, then call
+*archive_read_finish*()
+to release all resources, including all memory allocated by the library.
+
+The
+*archive_read*(3)
+manual page provides more detailed calling information for this API.
+== WRITING AN ARCHIVE ==
+You use a similar process to write an archive.
+The
+*archive_write_new*()
+function creates an archive object useful for writing,
+the various
+*archive_write_set_XXX*()
+functions are used to set parameters for writing the archive, and
+*archive_write_open*()
+completes the setup and opens the archive for writing.
+
+Individual archive entries are written in a three-step
+process:
+You first initialize a
+*struct archive_entry*
+structure with information about the new entry.
+At a minimum, you should set the pathname of the
+entry and provide a
+_struct_ stat
+with a valid
+_st_mode_
+field, which specifies the type of object and
+_st_size_
+field, which specifies the size of the data portion of the object.
+The
+*archive_write_header*()
+function actually writes the header data to the archive.
+You can then use
+*archive_write_data*()
+to write the actual data.
+
+After all entries have been written, use the
+*archive_write_finish*()
+function to release all resources.
+
+The
+*archive_write*(3)
+manual page provides more detailed calling information for this API.
+== DESCRIPTION ==
+Detailed descriptions of each function are provided by the
+corresponding manual pages.
+
+All of the functions utilize an opaque
+*struct archive*
+datatype that provides access to the archive contents.
+
+The
+*struct archive_entry*
+structure contains a complete description of a single archive
+entry.
+It uses an opaque interface that is fully documented in
+*archive_entry*(3).
+
+Users familiar with historic formats should be aware that the newer
+variants have eliminated most restrictions on the length of textual fields.
+Clients should not assume that filenames, link names, user names, or
+group names are limited in length.
+In particular, pax interchange format can easily accommodate pathnames
+in arbitrary character sets that exceed
+_PATH_MAX_.
+== RETURN VALUES ==
+Most functions return zero on success, non-zero on error.
+The return value indicates the general severity of the error, ranging
+from
+*ARCHIVE_WARN*,
+which indicates a minor problem that should probably be reported
+to the user, to
+*ARCHIVE_FATAL*,
+which indicates a serious problem that will prevent any further
+operations on this archive.
+On error, the
+*archive_errno*()
+function can be used to retrieve a numeric error code (see
+*errno*(2)).
+The
+*archive_error_string*()
+returns a textual error message suitable for display.
+
+*archive_read_new*()
+and
+*archive_write_new*()
+return pointers to an allocated and initialized
+*struct archive*
+object.
+
+*archive_read_data*()
+and
+*archive_write_data*()
+return a count of the number of bytes actually read or written.
+A value of zero indicates the end of the data for this entry.
+A negative value indicates an error, in which case the
+*archive_errno*()
+and
+*archive_error_string*()
+functions can be used to obtain more information.
+== ENVIRONMENT ==
+There are character set conversions within the
+*archive_entry*(3)
+functions that are impacted by the currently-selected locale.
+== SEE ALSO ==
+*tar*(1),
+*archive_entry*(3),
+*archive_read*(3),
+*archive_util*(3),
+*archive_write*(3),
+*tar*(5)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
+== BUGS ==
+Some archive formats support information that is not supported by
+*struct archive_entry .*
+Such information cannot be fully archived or restored using this library.
+This includes, for example, comments, character sets,
+or the arbitrary key/value pairs that can appear in
+pax interchange format archives.
+
+Conversely, of course, not all of the information that can be
+stored in an
+*struct archive_entry*
+is supported by all formats.
+For example, cpio formats do not support nanosecond timestamps;
+old tar formats do not support large device numbers.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageLibarchiveFormats5.wiki b/archivers/libarchive/files/doc/wiki/ManPageLibarchiveFormats5.wiki
new file mode 100644
index 00000000000..0a8f362672f
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageLibarchiveFormats5.wiki
@@ -0,0 +1,327 @@
+#summary libarchive-formats 5 manual page
+== NAME ==
+*libarchive-formats*
+- archive formats supported by the libarchive library
+== DESCRIPTION ==
+The
+*libarchive*(3)
+library reads and writes a variety of streaming archive formats.
+Generally speaking, all of these archive formats consist of a series of
+"entries".
+Each entry stores a single file system object, such as a file, directory,
+or symbolic link.
+
+The following provides a brief description of each format supported
+by libarchive, with some information about recognized extensions or
+limitations of the current library support.
+Note that just because a format is supported by libarchive does not
+imply that a program that uses libarchive will support that format.
+Applications that use libarchive specify which formats they wish
+to support, though many programs do use libarchive convenience
+functions to enable all supported formats.
+=== Tar Formats===
+The
+*libarchive*(3)
+library can read most tar archives.
+However, it only writes POSIX-standard
+"ustar"
+and
+"pax interchange"
+formats.
+
+All tar formats store each entry in one or more 512-byte records.
+The first record is used for file metadata, including filename,
+timestamp, and mode information, and the file data is stored in
+subsequent records.
+Later variants have extended this by either appropriating undefined
+areas of the header record, extending the header to multiple records,
+or by storing special entries that modify the interpretation of
+subsequent entries.
+
+<dl>
+<dt>*gnutar*</dt><dd>
+The
+*libarchive*(3)
+library can read GNU-format tar archives.
+It currently supports the most popular GNU extensions, including
+modern long filename and linkname support, as well as atime and ctime data.
+The libarchive library does not support multi-volume
+archives, nor the old GNU long filename format.
+It can read GNU sparse file entries, including the new POSIX-based
+formats, but cannot write GNU sparse file entries.
+</dd><dt>*pax*</dt><dd>
+The
+*libarchive*(3)
+library can read and write POSIX-compliant pax interchange format
+archives.
+Pax interchange format archives are an extension of the older ustar
+format that adds a separate entry with additional attributes stored
+as key/value pairs immediately before each regular entry.
+The presence of these additional entries is the only difference between
+pax interchange format and the older ustar format.
+The extended attributes are of unlimited length and are stored
+as UTF-8 Unicode strings.
+Keywords defined in the standard are in all lowercase; vendors are allowed
+to define custom keys by preceding them with the vendor name in all uppercase.
+When writing pax archives, libarchive uses many of the SCHILY keys
+defined by Joerg Schilling's
+"star"
+archiver and a few LIBARCHIVE keys.
+The libarchive library can read most of the SCHILY keys
+and most of the GNU keys introduced by GNU tar.
+It silently ignores any keywords that it does not understand.
+</dd><dt>*restricted* pax</dt><dd>
+The libarchive library can also write pax archives in which it
+attempts to suppress the extended attributes entry whenever
+possible.
+The result will be identical to a ustar archive unless the
+extended attributes entry is required to store a long file
+name, long linkname, extended ACL, file flags, or if any of the standard
+ustar data (user name, group name, UID, GID, etc) cannot be fully
+represented in the ustar header.
+In all cases, the result can be dearchived by any program that
+can read POSIX-compliant pax interchange format archives.
+Programs that correctly read ustar format (see below) will also be
+able to read this format; any extended attributes will be extracted as
+separate files stored in
+_PaxHeader_
+directories.
+</dd><dt>*ustar*</dt><dd>
+The libarchive library can both read and write this format.
+This format has the following limitations:
+<ul>
+<li>
+Device major and minor numbers are limited to 21 bits.
+Nodes with larger numbers will not be added to the archive.
+</li><li>
+Path names in the archive are limited to 255 bytes.
+(Shorter if there is no / character in exactly the right place.)
+</li><li>
+Symbolic links and hard links are stored in the archive with
+the name of the referenced file.
+This name is limited to 100 bytes.
+</li><li>
+Extended attributes, file flags, and other extended
+security information cannot be stored.
+</li><li>
+Archive entries are limited to 8 gigabytes in size.
+</li></ul>
+Note that the pax interchange format has none of these restrictions.
+</dd></dl>
+
+The libarchive library also reads a variety of commonly-used extensions to
+the basic tar format.
+These extensions are recognized automatically whenever they appear.
+<dl>
+<dt>Numeric extensions.</dt><dd>
+The POSIX standards require fixed-length numeric fields to be written with
+some character position reserved for terminators.
+Libarchive allows these fields to be written without terminator characters.
+This extends the allowable range; in particular, ustar archives with this
+extension can support entries up to 64 gigabytes in size.
+Libarchive also recognizes base-256 values in most numeric fields.
+This essentially removes all limitations on file size, modification time,
+and device numbers.
+</dd><dt>Solaris extensions</dt><dd>
+Libarchive recognizes ACL and extended attribute records written
+by Solaris tar.
+Currently, libarchive only has support for old-style ACLs; the
+newer NFSv4 ACLs are recognized but discarded.
+</dd></dl>
+
+The first tar program appeared in Seventh Edition Unix in 1979.
+The first official standard for the tar file format was the
+"ustar"
+(Unix Standard Tar) format defined by POSIX in 1988.
+POSIX.1-2001 extended the ustar format to create the
+"pax interchange"
+format.
+=== Cpio Formats===
+The libarchive library can read a number of common cpio variants and can write
+"odc"
+and
+"newc"
+format archives.
+A cpio archive stores each entry as a fixed-size header followed
+by a variable-length filename and variable-length data.
+Unlike the tar format, the cpio format does only minimal padding
+of the header or file data.
+There are several cpio variants, which differ primarily in
+how they store the initial header: some store the values as
+octal or hexadecimal numbers in ASCII, others as binary values of
+varying byte order and length.
+<dl>
+<dt>*binary*</dt><dd>
+The libarchive library transparently reads both big-endian and little-endian
+variants of the original binary cpio format.
+This format used 32-bit binary values for file size and mtime,
+and 16-bit binary values for the other fields.
+</dd><dt>*odc*</dt><dd>
+The libarchive library can both read and write this
+POSIX-standard format, which is officially known as the
+"cpio interchange format"
+or the
+"octet-oriented cpio archive format"
+and sometimes unofficially referred to as the
+"old character format".
+This format stores the header contents as octal values in ASCII.
+It is standard, portable, and immune from byte-order confusion.
+File sizes and mtime are limited to 33 bits (8GB file size),
+other fields are limited to 18 bits.
+</dd><dt>*SVR4*</dt><dd>
+The libarchive library can read both CRC and non-CRC variants of
+this format.
+The SVR4 format uses eight-digit hexadecimal values for
+all header fields.
+This limits file size to 4GB, and also limits the mtime and
+other fields to 32 bits.
+The SVR4 format can optionally include a CRC of the file
+contents, although libarchive does not currently verify this CRC.
+</dd></dl>
+
+Cpio first appeared in PWB/UNIX 1.0, which was released within
+AT&T in 1977.
+PWB/UNIX 1.0 formed the basis of System III Unix, released outside
+of AT&T in 1981.
+This makes cpio older than tar, although cpio was not included
+in Version 7 AT&T Unix.
+As a result, the tar command became much better known in universities
+and research groups that used Version 7.
+The combination of the
+*find*
+and
+*cpio*
+utilities provided very precise control over file selection.
+Unfortunately, the format has many limitations that make it unsuitable
+for widespread use.
+Only the POSIX format permits files over 4GB, and its 18-bit
+limit for most other fields makes it unsuitable for modern systems.
+In addition, cpio formats only store numeric UID/GID values (not
+usernames and group names), which can make it very difficult to correctly
+transfer archives across systems with dissimilar user numbering.
+=== Shar Formats===
+A
+"shell archive"
+is a shell script that, when executed on a POSIX-compliant
+system, will recreate a collection of file system objects.
+The libarchive library can write two different kinds of shar archives:
+<dl>
+<dt>*shar*</dt><dd>
+The traditional shar format uses a limited set of POSIX
+commands, including
+*echo*(1),
+*mkdir*(1),
+and
+*sed*(1).
+It is suitable for portably archiving small collections of plain text files.
+However, it is not generally well-suited for large archives
+(many implementations of
+*sh*(1)
+have limits on the size of a script) nor should it be used with non-text files.
+</dd><dt>*shardump*</dt><dd>
+This format is similar to shar but encodes files using
+*uuencode*(1)
+so that the result will be a plain text file regardless of the file contents.
+It also includes additional shell commands that attempt to reproduce as
+many file attributes as possible, including owner, mode, and flags.
+The additional commands used to restore file attributes make
+shardump archives less portable than plain shar archives.
+</dd></dl>
+=== ISO9660 format===
+Libarchive can read and extract from files containing ISO9660-compliant
+CDROM images.
+In many cases, this can remove the need to burn a physical CDROM
+just in order to read the files contained in an ISO9660 image.
+It also avoids security and complexity issues that come with
+virtual mounts and loopback devices.
+Libarchive supports the most common Rockridge extensions and has partial
+support for Joliet extensions.
+If both extensions are present, the Joliet extensions will be
+used and the Rockridge extensions will be ignored.
+In particular, this can create problems with hardlinks and symlinks,
+which are supported by Rockridge but not by Joliet.
+=== Zip format===
+Libarchive can read and write zip format archives that have
+uncompressed entries and entries compressed with the
+"deflate"
+algorithm.
+Older zip compression algorithms are not supported.
+It can extract jar archives, archives that use Zip64 extensions and many
+self-extracting zip archives.
+Libarchive reads Zip archives as they are being streamed,
+which allows it to read archives of arbitrary size.
+It currently does not use the central directory; this
+limits libarchive's ability to support some self-extracting
+archives and ones that have been modified in certain ways.
+=== Archive (library) file format===
+The Unix archive format (commonly created by the
+*ar*(1)
+archiver) is a general-purpose format which is
+used almost exclusively for object files to be
+read by the link editor
+*ld*(1).
+The ar format has never been standardised.
+There are two common variants:
+the GNU format derived from SVR4,
+and the BSD format, which first appeared in 4.4BSD.
+The two differ primarily in their handling of filenames
+longer than 15 characters:
+the GNU/SVR4 variant writes a filename table at the beginning of the archive;
+the BSD format stores each long filename in an extension
+area adjacent to the entry.
+Libarchive can read both extensions,
+including archives that may include both types of long filenames.
+Programs using libarchive can write GNU/SVR4 format
+if they provide a filename table to be written into
+the archive before any of the entries.
+Any entries whose names are not in the filename table
+will be written using BSD-style long filenames.
+This can cause problems for programs such as
+GNU ld that do not support the BSD-style long filenames.
+=== mtree===
+Libarchive can read and write files in
+*mtree*(5)
+format.
+This format is not a true archive format, but rather a textual description
+of a file hierarchy in which each line specifies the name of a file and
+provides specific metadata about that file.
+Libarchive can read all of the keywords supported by both
+the NetBSD and FreeBSD versions of
+*mtree*(1),
+although many of the keywords cannot currently be stored in an
+*archive_entry*
+object.
+When writing, libarchive supports use of the
+*archive_write_set_options*(3)
+interface to specify which keywords should be included in the
+output.
+If libarchive was compiled with access to suitable
+cryptographic libraries (such as the OpenSSL libraries),
+it can compute hash entries such as
+*sha512*
+or
+*md5*
+from file data being written to the mtree writer.
+
+When reading an mtree file, libarchive will locate the corresponding
+files on disk using the
+*contents*
+keyword if present or the regular filename.
+If it can locate and open the file on disk, it will use that
+to fill in any metadata that is missing from the mtree file
+and will read the file contents and return those to the program
+using libarchive.
+If it cannot locate and open the file on disk, libarchive
+will return an error for any attempt to read the entry
+body.
+== SEE ALSO ==
+*ar*(1),
+*cpio*(1),
+*mkisofs*(1),
+*shar*(1),
+*tar*(1),
+*zip*(1),
+*zlib*(3),
+*cpio*(5),
+*mtree*(5),
+*tar*(5)
diff --git a/archivers/libarchive/files/doc/wiki/ManPageLibarchiveInternals3.wiki b/archivers/libarchive/files/doc/wiki/ManPageLibarchiveInternals3.wiki
new file mode 100644
index 00000000000..b21fedbab1c
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageLibarchiveInternals3.wiki
@@ -0,0 +1,337 @@
+#summary LIBARCHIVE 3 manual page
+== NAME ==
+*libarchive_internals*
+- description of libarchive internal interfaces
+== OVERVIEW ==
+The
+*libarchive*
+library provides a flexible interface for reading and writing
+streaming archive files such as tar and cpio.
+Internally, it follows a modular layered design that should
+make it easy to add new archive and compression formats.
+== GENERAL ARCHITECTURE ==
+Externally, libarchive exposes most operations through an
+opaque, object-style interface.
+The
+*archive_entry*(1)
+objects store information about a single filesystem object.
+The rest of the library provides facilities to write
+*archive_entry*(1)
+objects to archive files,
+read them from archive files,
+and write them to disk.
+(There are plans to add a facility to read
+*archive_entry*(1)
+objects from disk as well.)
+
+The read and write APIs each have four layers: a public API
+layer, a format layer that understands the archive file format,
+a compression layer, and an I/O layer.
+The I/O layer is completely exposed to clients who can replace
+it entirely with their own functions.
+
+In order to provide as much consistency as possible for clients,
+some public functions are virtualized.
+Eventually, it should be possible for clients to open
+an archive or disk writer, and then use a single set of
+code to select and write entries, regardless of the target.
+== READ ARCHITECTURE ==
+From the outside, clients use the
+*archive_read*(3)
+API to manipulate an
+*archive*
+object to read entries and bodies from an archive stream.
+Internally, the
+*archive*
+object is cast to an
+*archive_read*
+object, which holds all read-specific data.
+The API has four layers:
+The lowest layer is the I/O layer.
+This layer can be overridden by clients, but most clients use
+the packaged I/O callbacks provided, for example, by
+*archive_read_open_memory*(3),
+and
+*archive_read_open_fd*(3).
+The compression layer calls the I/O layer to
+read bytes and decompresses them for the format layer.
+The format layer unpacks a stream of uncompressed bytes and
+creates
+*archive_entry*
+objects from the incoming data.
+The API layer tracks overall state
+(for example, it prevents clients from reading data before reading a header)
+and invokes the format and compression layer operations
+through registered function pointers.
+In particular, the API layer drives the format-detection process:
+When opening the archive, it reads an initial block of data
+and offers it to each registered compression handler.
+The one with the highest bid is initialized with the first block.
+Similarly, the format handlers are polled to see which handler
+is the best for each archive.
+(Prior to 2.4.0, the format bidders were invoked for each
+entry, but this design hindered error recovery.)
+=== I/O Layer and Client Callbacks===
+The read API goes to some lengths to be nice to clients.
+As a result, there are few restrictions on the behavior of
+the client callbacks.
+
+The client read callback is expected to provide a block
+of data on each call.
+A zero-length return does indicate end of file, but otherwise
+blocks may be as small as one byte or as large as the entire file.
+In particular, blocks may be of different sizes.
+
+The client skip callback returns the number of bytes actually
+skipped, which may be much smaller than the skip requested.
+The only requirement is that the skip not be larger.
+In particular, clients are allowed to return zero for any
+skip that they don't want to handle.
+The skip callback must never be invoked with a negative value.
+
+Keep in mind that not all clients are reading from disk:
+clients reading from networks may provide different-sized
+blocks on every request and cannot skip at all;
+advanced clients may use
+*mmap*(2)
+to read the entire file into memory at once and return the
+entire file to libarchive as a single block;
+other clients may begin asynchronous I/O operations for the
+next block on each request.
+=== Decompresssion Layer===
+The decompression layer not only handles decompression,
+it also buffers data so that the format handlers see a
+much nicer I/O model.
+The decompression API is a two stage peek/consume model.
+A read_ahead request specifies a minimum read amount;
+the decompression layer must provide a pointer to at least
+that much data.
+If more data is immediately available, it should return more:
+the format layer handles bulk data reads by asking for a minimum
+of one byte and then copying as much data as is available.
+
+A subsequent call to the
+*consume*()
+function advances the read pointer.
+Note that data returned from a
+*read_ahead*()
+call is guaranteed to remain in place until
+the next call to
+*read_ahead*().
+Intervening calls to
+*consume*()
+should not cause the data to move.
+
+Skip requests must always be handled exactly.
+Decompression handlers that cannot seek forward should
+not register a skip handler;
+the API layer fills in a generic skip handler that reads and discards data.
+
+A decompression handler has a specific lifecycle:
+<dl>
+<dt>Registration/Configuration</dt><dd>
+When the client invokes the public support function,
+the decompression handler invokes the internal
+*__archive_read_register_compression*()
+function to provide bid and initialization functions.
+This function returns
+*NULL*
+on error or else a pointer to a
+*struct* decompressor_t.
+This structure contains a
+_void_ * config
+slot that can be used for storing any customization information.
+</dd><dt>Bid</dt><dd>
+The bid function is invoked with a pointer and size of a block of data.
+The decompressor can access its config data
+through the
+_decompressor_
+element of the
+*archive_read*
+object.
+The bid function is otherwise stateless.
+In particular, it must not perform any I/O operations.
+
+The value returned by the bid function indicates its suitability
+for handling this data stream.
+A bid of zero will ensure that this decompressor is never invoked.
+Return zero if magic number checks fail.
+Otherwise, your initial implementation should return the number of bits
+actually checked.
+For example, if you verify two full bytes and three bits of another
+byte, bid 19.
+Note that the initial block may be very short;
+be careful to only inspect the data you are given.
+(The current decompressors require two bytes for correct bidding.)
+</dd><dt>Initialize</dt><dd>
+The winning bidder will have its init function called.
+This function should initialize the remaining slots of the
+_struct_ decompressor_t
+object pointed to by the
+_decompressor_
+element of the
+_archive_read_
+object.
+In particular, it should allocate any working data it needs
+in the
+_data_
+slot of that structure.
+The init function is called with the block of data that
+was used for tasting.
+At this point, the decompressor is responsible for all I/O
+requests to the client callbacks.
+The decompressor is free to read more data as and when
+necessary.
+</dd><dt>Satisfy I/O requests</dt><dd>
+The format handler will invoke the
+_read_ahead_,
+_consume_,
+and
+_skip_
+functions as needed.
+</dd><dt>Finish</dt><dd>
+The finish method is called only once when the archive is closed.
+It should release anything stored in the
+_data_
+and
+_config_
+slots of the
+_decompressor_
+object.
+It should not invoke the client close callback.
+</dd></dl>
+=== Format Layer===
+The read formats have a similar lifecycle to the decompression handlers:
+<dl>
+<dt>Registration</dt><dd>
+Allocate your private data and initialize your pointers.
+</dd><dt>Bid</dt><dd>
+Formats bid by invoking the
+*read_ahead*()
+decompression method but not calling the
+*consume*()
+method.
+This allows each bidder to look ahead in the input stream.
+Bidders should not look further ahead than necessary, as long
+look aheads put pressure on the decompression layer to buffer
+lots of data.
+Most formats only require a few hundred bytes of look ahead;
+look aheads of a few kilobytes are reasonable.
+(The ISO9660 reader sometimes looks ahead by 48k, which
+should be considered an upper limit.)
+</dd><dt>Read header</dt><dd>
+The header read is usually the most complex part of any format.
+There are a few strategies worth mentioning:
+For formats such as tar or cpio, reading and parsing the header is
+straightforward since headers alternate with data.
+For formats that store all header data at the beginning of the file,
+the first header read request may have to read all headers into
+memory and store that data, sorted by the location of the file
+data.
+Subsequent header read requests will skip forward to the
+beginning of the file data and return the corresponding header.
+</dd><dt>Read Data</dt><dd>
+The read data interface supports sparse files; this requires that
+each call return a block of data specifying the file offset and
+size.
+This may require you to carefully track the location so that you
+can return accurate file offsets for each read.
+Remember that the decompressor will return as much data as it has.
+Generally, you will want to request one byte,
+examine the return value to see how much data is available, and
+possibly trim that to the amount you can use.
+You should invoke consume for each block just before you return it.
+</dd><dt>Skip All Data</dt><dd>
+The skip data call should skip over all file data and trailing padding.
+This is called automatically by the API layer just before each
+header read.
+It is also called in response to the client calling the public
+*data_skip*()
+function.
+</dd><dt>Cleanup</dt><dd>
+On cleanup, the format should release all of its allocated memory.
+</dd></dl>
+=== API Layer===
+XXX to do XXX
+== WRITE ARCHITECTURE ==
+The write API has a similar set of four layers:
+an API layer, a format layer, a compression layer, and an I/O layer.
+The registration here is much simpler because only
+one format and one compression can be registered at a time.
+=== I/O Layer and Client Callbacks===
+XXX To be written XXX
+=== Compression Layer===
+XXX To be written XXX
+=== Format Layer===
+XXX To be written XXX
+=== API Layer===
+XXX To be written XXX
+== WRITE_DISK ARCHITECTURE ==
+The write_disk API is intended to look just like the write API
+to clients.
+Since it does not handle multiple formats or compression, it
+is not layered internally.
+== GENERAL SERVICES ==
+The
+*archive_read*,
+*archive_write*,
+and
+*archive_write_disk*
+objects all contain an initial
+*archive*
+object which provides common support for a set of standard services.
+(Recall that ANSI/ISO C90 guarantees that you can cast freely between
+a pointer to a structure and a pointer to the first element of that
+structure.)
+The
+*archive*
+object has a magic value that indicates which API this object
+is associated with,
+slots for storing error information,
+and function pointers for virtualized API functions.
+== MISCELLANEOUS NOTES ==
+Connecting existing archiving libraries into libarchive is generally
+quite difficult.
+In particular, many existing libraries strongly assume that you
+are reading from a file; they seek forwards and backwards as necessary
+to locate various pieces of information.
+In contrast, libarchive never seeks backwards in its input, which
+sometimes requires very different approaches.
+
+For example, libarchive's ISO9660 support operates very differently
+from most ISO9660 readers.
+The libarchive support utilizes a work-queue design that
+keeps a list of known entries sorted by their location in the input.
+Whenever libarchive's ISO9660 implementation is asked for the next
+header, checks this list to find the next item on the disk.
+Directories are parsed when they are encountered and new
+items are added to the list.
+This design relies heavily on the ISO9660 image being optimized so that
+directories always occur earlier on the disk than the files they
+describe.
+
+Depending on the specific format, such approaches may not be possible.
+The ZIP format specification, for example, allows archivers to store
+key information only at the end of the file.
+In theory, it is possible to create ZIP archives that cannot
+be read without seeking.
+Fortunately, such archives are very rare, and libarchive can read
+most ZIP archives, though it cannot always extract as much information
+as a dedicated ZIP program.
+== SEE ALSO ==
+*archive*(3),
+*archive_entry*(3),
+*archive_read*(3),
+*archive_write*(3),
+*archive_write_disk*(3)
+== HISTORY ==
+The
+*libarchive*
+library first appeared in
+FreeBSD 5.3.
+== AUTHORS ==
+The
+*libarchive*
+library was written by
+Tim Kientzle <kientzle@acm.org.>
+== BUGS ==
diff --git a/archivers/libarchive/files/doc/wiki/ManPageMtree5.wiki b/archivers/libarchive/files/doc/wiki/ManPageMtree5.wiki
new file mode 100644
index 00000000000..fd49e3061d8
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageMtree5.wiki
@@ -0,0 +1,237 @@
+#summary MTREE 5 manual page
+== NAME ==
+*mtree*
+- format of mtree dir hierarchy files
+== DESCRIPTION ==
+The
+*mtree*
+format is a textual format that describes a collection of filesystem objects.
+Such files are typically used to create or verify directory hierarchies.
+=== General Format===
+An
+*mtree*
+file consists of a series of lines, each providing information
+about a single filesystem object.
+Leading whitespace is always ignored.
+
+When encoding file or pathnames, any backslash character or
+character outside of the 95 printable ASCII characters must be
+encoded as a a backslash followed by three
+octal digits.
+When reading mtree files, any appearance of a backslash
+followed by three octal digits should be converted into the
+corresponding character.
+
+Each line is interpreted independently as one of the following types:
+<dl>
+<dt>Signature</dt><dd>
+The first line of any mtree file must begin with
+"#mtree".
+If a file contains any full path entries, the first line should
+begin with
+"#mtree v2.0",
+otherwise, the first line should begin with
+"#mtree v1.0".
+</dd><dt>Blank</dt><dd>
+Blank lines are ignored.
+</dd><dt>Comment</dt><dd>
+Lines beginning with
+*#*
+are ignored.
+</dd><dt>Special</dt><dd>
+Lines beginning with
+*/*
+are special commands that influence
+the interpretation of later lines.
+</dd><dt>Relative</dt><dd>
+If the first whitespace-delimited word has no
+*/*
+characters,
+it is the name of a file in the current directory.
+Any relative entry that describes a directory changes the
+current directory.
+</dd><dt>dot-dot</dt><dd>
+As a special case, a relative entry with the filename
+_.._
+changes the current directory to the parent directory.
+Options on dot-dot entries are always ignored.
+</dd><dt>Full</dt><dd>
+If the first whitespace-delimited word has a
+*/*
+character after
+the first character, it is the pathname of a file relative to the
+starting directory.
+There can be multiple full entries describing the same file.
+</dd></dl>
+
+Some tools that process
+*mtree*
+files may require that multiple lines describing the same file
+occur consecutively.
+It is not permitted for the same file to be mentioned using
+both a relative and a full file specification.
+=== Special commands===
+Two special commands are currently defined:
+<dl>
+<dt>*/set*</dt><dd>
+This command defines default values for one or more keywords.
+It is followed on the same line by one or more whitespace-separated
+keyword definitions.
+These definitions apply to all following files that do not specify
+a value for that keyword.
+</dd><dt>*/unset*</dt><dd>
+This command removes any default value set by a previous
+*/set*
+command.
+It is followed on the same line by one or more keywords
+separated by whitespace.
+</dd></dl>
+=== Keywords===
+After the filename, a full or relative entry consists of zero
+or more whitespace-separated keyword definitions.
+Each such definition consists of a key from the following
+list immediately followed by an '=' sign
+and a value.
+Software programs reading mtree files should warn about
+unrecognized keywords.
+
+Currently supported keywords are as follows:
+<dl>
+<dt>*cksum*</dt><dd>
+The checksum of the file using the default algorithm specified by
+the
+*cksum*(1)
+utility.
+</dd><dt>*contents*</dt><dd>
+The full pathname of a file that holds the contents of this file.
+</dd><dt>*flags*</dt><dd>
+The file flags as a symbolic name.
+See
+*chflags*(1)
+for information on these names.
+If no flags are to be set the string
+"none"
+may be used to override the current default.
+</dd><dt>*gid*</dt><dd>
+The file group as a numeric value.
+</dd><dt>*gname*</dt><dd>
+The file group as a symbolic name.
+</dd><dt>*ignore*</dt><dd>
+Ignore any file hierarchy below this file.
+</dd><dt>*link*</dt><dd>
+The target of the symbolic link when type=link.
+</dd><dt>*md5*</dt><dd>
+The MD5 message digest of the file.
+</dd><dt>*md5digest*</dt><dd>
+A synonym for
+*md5*.
+</dd><dt>*mode*</dt><dd>
+The current file's permissions as a numeric (octal) or symbolic
+value.
+</dd><dt>*nlink*</dt><dd>
+The number of hard links the file is expected to have.
+</dd><dt>*nochange*</dt><dd>
+Make sure this file or directory exists but otherwise ignore all attributes.
+</dd><dt>*ripemd160digest*</dt><dd>
+The
+*RIPEMD160*
+message digest of the file.
+</dd><dt>*rmd160*</dt><dd>
+A synonym for
+*ripemd160digest*.
+</dd><dt>*rmd160digest*</dt><dd>
+A synonym for
+*ripemd160digest*.
+</dd><dt>*sha1*</dt><dd>
+The
+*FIPS*
+160-1
+("Tn SHA-1")
+message digest of the file.
+</dd><dt>*sha1digest*</dt><dd>
+A synonym for
+*sha1*.
+</dd><dt>*sha256*</dt><dd>
+The
+*FIPS*
+180-2
+("Tn SHA-256")
+message digest of the file.
+</dd><dt>*sha256digest*</dt><dd>
+A synonym for
+*sha256*.
+</dd><dt>*size*</dt><dd>
+The size, in bytes, of the file.
+</dd><dt>*time*</dt><dd>
+The last modification time of the file.
+</dd><dt>*type*</dt><dd>
+The type of the file; may be set to any one of the following:
+
+<dl>
+<dt>*block*</dt><dd>
+block special device
+</dd><dt>*char*</dt><dd>
+character special device
+</dd><dt>*dir*</dt><dd>
+directory
+</dd><dt>*fifo*</dt><dd>
+fifo
+</dd><dt>*file*</dt><dd>
+regular file
+</dd><dt>*link*</dt><dd>
+symbolic link
+</dd><dt>*socket*</dt><dd>
+socket
+</dd></dl>
+</dd><dt>*uid*</dt><dd>
+The file owner as a numeric value.
+</dd><dt>*uname*</dt><dd>
+The file owner as a symbolic name.
+</dd></dl>
+
+== SEE ALSO ==
+*cksum*(1),
+*find*(1),
+*mtree*(8)
+== BUGS ==
+The
+FreeBSD
+implementation of mtree does not currently support
+the
+*mtree*
+2.0
+format.
+The requirement for a
+"#mtree"
+signature line is new and not yet widely implemented.
+== HISTORY ==
+The
+*mtree*
+utility appeared in
+BSD 4.3 Reno.
+The
+*MD5*
+digest capability was added in
+FreeBSD 2.1,
+in response to the widespread use of programs which can spoof
+*cksum*(1).
+The
+*SHA-1*
+and
+*RIPEMD160*
+digests were added in
+FreeBSD 4.0,
+as new attacks have demonstrated weaknesses in
+*MD5 .*
+The
+*SHA-256*
+digest was added in
+FreeBSD 6.0.
+Support for file flags was added in
+FreeBSD 4.0,
+and mostly comes from
+NetBSD.
+The
+"full"
+entry format was added by
+NetBSD.
diff --git a/archivers/libarchive/files/doc/wiki/ManPageTar5.wiki b/archivers/libarchive/files/doc/wiki/ManPageTar5.wiki
new file mode 100644
index 00000000000..12fd514562f
--- /dev/null
+++ b/archivers/libarchive/files/doc/wiki/ManPageTar5.wiki
@@ -0,0 +1,805 @@
+#summary tar 5 manual page
+== NAME ==
+*tar*
+- format of tape archive files
+== DESCRIPTION ==
+The
+*tar*
+archive format collects any number of files, directories, and other
+file system objects (symbolic links, device nodes, etc.) into a single
+stream of bytes.
+The format was originally designed to be used with
+tape drives that operate with fixed-size blocks, but is widely used as
+a general packaging mechanism.
+=== General Format===
+A
+*tar*
+archive consists of a series of 512-byte records.
+Each file system object requires a header record which stores basic metadata
+(pathname, owner, permissions, etc.) and zero or more records containing any
+file data.
+The end of the archive is indicated by two records consisting
+entirely of zero bytes.
+
+For compatibility with tape drives that use fixed block sizes,
+programs that read or write tar files always read or write a fixed
+number of records with each I/O operation.
+These
+"blocks"
+are always a multiple of the record size.
+The maximum block size supported by early
+implementations was 10240 bytes or 20 records.
+This is still the default for most implementations
+although block sizes of 1MiB (2048 records) or larger are
+commonly used with modern high-speed tape drives.
+(Note: the terms
+"block"
+and
+"record"
+here are not entirely standard; this document follows the
+convention established by John Gilmore in documenting
+*pdtar*.)
+=== Old-Style Archive Format===
+The original tar archive format has been extended many times to
+include additional information that various implementors found
+necessary.
+This section describes the variant implemented by the tar command
+included in
+At v7,
+which seems to be the earliest widely-used version of the tar program.
+
+The header record for an old-style
+*tar*
+archive consists of the following:
+{{{
+struct header_old_tar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char linkflag[1];
+ char linkname[100];
+ char pad[255];
+};
+}}}
+All unused bytes in the header record are filled with nulls.
+<dl>
+<dt>_name_</dt><dd>
+Pathname, stored as a null-terminated string.
+Early tar implementations only stored regular files (including
+hardlinks to those files).
+One common early convention used a trailing "/" character to indicate
+a directory name, allowing directory permissions and owner information
+to be archived and restored.
+</dd><dt>_mode_</dt><dd>
+File mode, stored as an octal number in ASCII.
+</dd><dt>_uid_, _gid_</dt><dd>
+User id and group id of owner, as octal numbers in ASCII.
+</dd><dt>_size_</dt><dd>
+Size of file, as octal number in ASCII.
+For regular files only, this indicates the amount of data
+that follows the header.
+In particular, this field was ignored by early tar implementations
+when extracting hardlinks.
+Modern writers should always store a zero length for hardlink entries.
+</dd><dt>_mtime_</dt><dd>
+Modification time of file, as an octal number in ASCII.
+This indicates the number of seconds since the start of the epoch,
+00:00:00 UTC January 1, 1970.
+Note that negative values should be avoided
+here, as they are handled inconsistently.
+</dd><dt>_checksum_</dt><dd>
+Header checksum, stored as an octal number in ASCII.
+To compute the checksum, set the checksum field to all spaces,
+then sum all bytes in the header using unsigned arithmetic.
+This field should be stored as six octal digits followed by a null and a space
+character.
+Note that many early implementations of tar used signed arithmetic
+for the checksum field, which can cause interoperability problems
+when transferring archives between systems.
+Modern robust readers compute the checksum both ways and accept the
+header if either computation matches.
+</dd><dt>_linkflag_, _linkname_</dt><dd>
+In order to preserve hardlinks and conserve tape, a file
+with multiple links is only written to the archive the first
+time it is encountered.
+The next time it is encountered, the
+_linkflag_
+is set to an ASCII
+Sq 1
+and the
+_linkname_
+field holds the first name under which this file appears.
+(Note that regular files have a null value in the
+_linkflag_
+field.)
+</dd></dl>
+
+Early tar implementations varied in how they terminated these fields.
+The tar command in
+At v7
+used the following conventions (this is also documented in early BSD manpages):
+the pathname must be null-terminated;
+the mode, uid, and gid fields must end in a space and a null byte;
+the size and mtime fields must end in a space;
+the checksum is terminated by a null and a space.
+Early implementations filled the numeric fields with leading spaces.
+This seems to have been common practice until the
+IEEE Std 1003.1-1988 (``POSIX.1'')
+standard was released.
+For best portability, modern implementations should fill the numeric
+fields with leading zeros.
+=== Pre-POSIX Archives===
+An early draft of
+IEEE Std 1003.1-1988 (``POSIX.1'')
+served as the basis for John Gilmore's
+*pdtar*
+program and many system implementations from the late 1980s
+and early 1990s.
+These archives generally follow the POSIX ustar
+format described below with the following variations:
+<ul>
+<li>
+The magic value is
+"ustar\ \&"
+(note the following space).
+The version field contains a space character followed by a null.
+</li><li>
+The numeric fields are generally filled with leading spaces
+(not leading zeros as recommended in the final standard).
+</li><li>
+The prefix field is often not used, limiting pathnames to
+the 100 characters of old-style archives.
+</li></ul>
+=== POSIX ustar Archives===
+IEEE Std 1003.1-1988 (``POSIX.1'')
+defined a standard tar file format to be read and written
+by compliant implementations of
+*tar*(1).
+This format is often called the
+"ustar"
+format, after the magic value used
+in the header.
+(The name is an acronym for
+"Unix Standard TAR".)
+It extends the historic format with new fields:
+{{{
+struct header_posix_ustar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char typeflag[1];
+ char linkname[100];
+ char magic[6];
+ char version[2];
+ char uname[32];
+ char gname[32];
+ char devmajor[8];
+ char devminor[8];
+ char prefix[155];
+ char pad[12];
+};
+}}}
+<dl>
+<dt>_typeflag_</dt><dd>
+Type of entry.
+POSIX extended the earlier
+_linkflag_
+field with several new type values:
+<dl>
+<dt>"0"</dt><dd>
+Regular file.
+NUL should be treated as a synonym, for compatibility purposes.
+</dd><dt>"1"</dt><dd>
+Hard link.
+</dd><dt>"2"</dt><dd>
+Symbolic link.
+</dd><dt>"3"</dt><dd>
+Character device node.
+</dd><dt>"4"</dt><dd>
+Block device node.
+</dd><dt>"5"</dt><dd>
+Directory.
+</dd><dt>"6"</dt><dd>
+FIFO node.
+</dd><dt>"7"</dt><dd>
+Reserved.
+</dd><dt>Other</dt><dd>
+A POSIX-compliant implementation must treat any unrecognized typeflag value
+as a regular file.
+In particular, writers should ensure that all entries
+have a valid filename so that they can be restored by readers that do not
+support the corresponding extension.
+Uppercase letters "A" through "Z" are reserved for custom extensions.
+Note that sockets and whiteout entries are not archivable.
+</dd></dl>
+It is worth noting that the
+_size_
+field, in particular, has different meanings depending on the type.
+For regular files, of course, it indicates the amount of data
+following the header.
+For directories, it may be used to indicate the total size of all
+files in the directory, for use by operating systems that pre-allocate
+directory space.
+For all other types, it should be set to zero by writers and ignored
+by readers.
+</dd><dt>_magic_</dt><dd>
+Contains the magic value
+"ustar"
+followed by a NUL byte to indicate that this is a POSIX standard archive.
+Full compliance requires the uname and gname fields be properly set.
+</dd><dt>_version_</dt><dd>
+Version.
+This should be
+"00"
+(two copies of the ASCII digit zero) for POSIX standard archives.
+</dd><dt>_uname_, _gname_</dt><dd>
+User and group names, as null-terminated ASCII strings.
+These should be used in preference to the uid/gid values
+when they are set and the corresponding names exist on
+the system.
+</dd><dt>_devmajor_, _devminor_</dt><dd>
+Major and minor numbers for character device or block device entry.
+</dd><dt>_name_, _prefix_</dt><dd>
+If the pathname is too long to fit in the 100 bytes provided by the standard
+format, it can be split at any
+_/_
+character with the first portion going into the prefix field.
+If the prefix field is not empty, the reader will prepend
+the prefix value and a
+_/_
+character to the regular name field to obtain the full pathname.
+The standard does not require a trailing
+_/_
+character on directory names, though most implementations still
+include this for compatibility reasons.
+</dd></dl>
+
+Note that all unused bytes must be set to
+NUL.
+
+Field termination is specified slightly differently by POSIX
+than by previous implementations.
+The
+_magic_,
+_uname_,
+and
+_gname_
+fields must have a trailing
+NUL.
+The
+_pathname_,
+_linkname_,
+and
+_prefix_
+fields must have a trailing
+NUL
+unless they fill the entire field.
+(In particular, it is possible to store a 256-character pathname if it
+happens to have a
+_/_
+as the 156th character.)
+POSIX requires numeric fields to be zero-padded in the front, and requires
+them to be terminated with either space or
+NUL
+characters.
+
+Currently, most tar implementations comply with the ustar
+format, occasionally extending it by adding new fields to the
+blank area at the end of the header record.
+=== Pax Interchange Format===
+There are many attributes that cannot be portably stored in a
+POSIX ustar archive.
+IEEE Std 1003.1-2001 (``POSIX.1'')
+defined a
+"pax interchange format"
+that uses two new types of entries to hold text-formatted
+metadata that applies to following entries.
+Note that a pax interchange format archive is a ustar archive in every
+respect.
+The new data is stored in ustar-compatible archive entries that use the
+"x"
+or
+"g"
+typeflag.
+In particular, older implementations that do not fully support these
+extensions will extract the metadata into regular files, where the
+metadata can be examined as necessary.
+
+An entry in a pax interchange format archive consists of one or
+two standard ustar entries, each with its own header and data.
+The first optional entry stores the extended attributes
+for the following entry.
+This optional first entry has an "x" typeflag and a size field that
+indicates the total size of the extended attributes.
+The extended attributes themselves are stored as a series of text-format
+lines encoded in the portable UTF-8 encoding.
+Each line consists of a decimal number, a space, a key string, an equals
+sign, a value string, and a new line.
+The decimal number indicates the length of the entire line, including the
+initial length field and the trailing newline.
+An example of such a field is:
+{{{
+25 ctime=1084839148.1212\en
+}}}
+Keys in all lowercase are standard keys.
+Vendors can add their own keys by prefixing them with an all uppercase
+vendor name and a period.
+Note that, unlike the historic header, numeric values are stored using
+decimal, not octal.
+A description of some common keys follows:
+<dl>
+<dt>*atime*, *ctime*, *mtime*</dt><dd>
+File access, inode change, and modification times.
+These fields can be negative or include a decimal point and a fractional value.
+</dd><dt>*uname*, *uid*, *gname*, *gid*</dt><dd>
+User name, group name, and numeric UID and GID values.
+The user name and group name stored here are encoded in UTF8
+and can thus include non-ASCII characters.
+The UID and GID fields can be of arbitrary length.
+</dd><dt>*linkpath*</dt><dd>
+The full path of the linked-to file.
+Note that this is encoded in UTF8 and can thus include non-ASCII characters.
+</dd><dt>*path*</dt><dd>
+The full pathname of the entry.
+Note that this is encoded in UTF8 and can thus include non-ASCII characters.
+</dd><dt>*realtime.`*`*, *security.`*`*</dt><dd>
+These keys are reserved and may be used for future standardization.
+</dd><dt>*size*</dt><dd>
+The size of the file.
+Note that there is no length limit on this field, allowing conforming
+archives to store files much larger than the historic 8GB limit.
+</dd><dt>*SCHILY.`*`*</dt><dd>
+Vendor-specific attributes used by Joerg Schilling's
+*star*
+implementation.
+</dd><dt>*SCHILY.acl.access*, *SCHILY.acl.default*</dt><dd>
+Stores the access and default ACLs as textual strings in a format
+that is an extension of the format specified by POSIX.1e draft 17.
+In particular, each user or group access specification can include a fourth
+colon-separated field with the numeric UID or GID.
+This allows ACLs to be restored on systems that may not have complete
+user or group information available (such as when NIS/YP or LDAP services
+are temporarily unavailable).
+</dd><dt>*SCHILY.devminor*, *SCHILY.devmajor*</dt><dd>
+The full minor and major numbers for device nodes.
+</dd><dt>*SCHILY.fflags*</dt><dd>
+The file flags.
+</dd><dt>*SCHILY.realsize*</dt><dd>
+The full size of the file on disk.
+XXX explain? XXX
+</dd><dt>*SCHILY.dev,* *SCHILY.ino*, *SCHILY.nlinks*</dt><dd>
+The device number, inode number, and link count for the entry.
+In particular, note that a pax interchange format archive using Joerg
+Schilling's
+*SCHILY.`*`*
+extensions can store all of the data from
+_struct_ stat.
+</dd><dt>*LIBARCHIVE.xattr.*_namespace_._key_</dt><dd>
+Libarchive stores POSIX.1e-style extended attributes using
+keys of this form.
+The
+_key_
+value is URL-encoded:
+All non-ASCII characters and the two special characters
+"="
+and
+"%"
+are encoded as
+"%"
+followed by two uppercase hexadecimal digits.
+The value of this key is the extended attribute value
+encoded in base 64.
+XXX Detail the base-64 format here XXX
+</dd><dt>*VENDOR.`*`*</dt><dd>
+XXX document other vendor-specific extensions XXX
+</dd></dl>
+
+Any values stored in an extended attribute override the corresponding
+values in the regular tar header.
+Note that compliant readers should ignore the regular fields when they
+are overridden.
+This is important, as existing archivers are known to store non-compliant
+values in the standard header fields in this situation.
+There are no limits on length for any of these fields.
+In particular, numeric fields can be arbitrarily large.
+All text fields are encoded in UTF8.
+Compliant writers should store only portable 7-bit ASCII characters in
+the standard ustar header and use extended
+attributes whenever a text value contains non-ASCII characters.
+
+In addition to the
+*x*
+entry described above, the pax interchange format
+also supports a
+*g*
+entry.
+The
+*g*
+entry is identical in format, but specifies attributes that serve as
+defaults for all subsequent archive entries.
+The
+*g*
+entry is not widely used.
+
+Besides the new
+*x*
+and
+*g*
+entries, the pax interchange format has a few other minor variations
+from the earlier ustar format.
+The most troubling one is that hardlinks are permitted to have
+data following them.
+This allows readers to restore any hardlink to a file without
+having to rewind the archive to find an earlier entry.
+However, it creates complications for robust readers, as it is no longer
+clear whether or not they should ignore the size field for hardlink entries.
+=== GNU Tar Archives===
+The GNU tar program started with a pre-POSIX format similar to that
+described earlier and has extended it using several different mechanisms:
+It added new fields to the empty space in the header (some of which was later
+used by POSIX for conflicting purposes);
+it allowed the header to be continued over multiple records;
+and it defined new entries that modify following entries
+(similar in principle to the
+*x*
+entry described above, but each GNU special entry is single-purpose,
+unlike the general-purpose
+*x*
+entry).
+As a result, GNU tar archives are not POSIX compatible, although
+more lenient POSIX-compliant readers can successfully extract most
+GNU tar archives.
+{{{
+struct header_gnu_tar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char typeflag[1];
+ char linkname[100];
+ char magic[6];
+ char version[2];
+ char uname[32];
+ char gname[32];
+ char devmajor[8];
+ char devminor[8];
+ char atime[12];
+ char ctime[12];
+ char offset[12];
+ char longnames[4];
+ char unused[1];
+ struct {
+ char offset[12];
+ char numbytes[12];
+ } sparse[4];
+ char isextended[1];
+ char realsize[12];
+ char pad[17];
+};
+}}}
+<dl>
+<dt>_typeflag_</dt><dd>
+GNU tar uses the following special entry types, in addition to
+those defined by POSIX:
+<dl>
+<dt>7</dt><dd>
+GNU tar treats type "7" records identically to type "0" records,
+except on one obscure RTOS where they are used to indicate the
+pre-allocation of a contiguous file on disk.
+</dd><dt>D</dt><dd>
+This indicates a directory entry.
+Unlike the POSIX-standard "5"
+typeflag, the header is followed by data records listing the names
+of files in this directory.
+Each name is preceded by an ASCII "Y"
+if the file is stored in this archive or "N" if the file is not
+stored in this archive.
+Each name is terminated with a null, and
+an extra null marks the end of the name list.
+The purpose of this
+entry is to support incremental backups; a program restoring from
+such an archive may wish to delete files on disk that did not exist
+in the directory when the archive was made.
+
+Note that the "D" typeflag specifically violates POSIX, which requires
+that unrecognized typeflags be restored as normal files.
+In this case, restoring the "D" entry as a file could interfere
+with subsequent creation of the like-named directory.
+</dd><dt>K</dt><dd>
+The data for this entry is a long linkname for the following regular entry.
+</dd><dt>L</dt><dd>
+The data for this entry is a long pathname for the following regular entry.
+</dd><dt>M</dt><dd>
+This is a continuation of the last file on the previous volume.
+GNU multi-volume archives guarantee that each volume begins with a valid
+entry header.
+To ensure this, a file may be split, with part stored at the end of one volume,
+and part stored at the beginning of the next volume.
+The "M" typeflag indicates that this entry continues an existing file.
+Such entries can only occur as the first or second entry
+in an archive (the latter only if the first entry is a volume label).
+The
+_size_
+field specifies the size of this entry.
+The
+_offset_
+field at bytes 369-380 specifies the offset where this file fragment
+begins.
+The
+_realsize_
+field specifies the total size of the file (which must equal
+_size_
+plus
+_offset_).
+When extracting, GNU tar checks that the header file name is the one it is
+expecting, that the header offset is in the correct sequence, and that
+the sum of offset and size is equal to realsize.
+</dd><dt>N</dt><dd>
+Type "N" records are no longer generated by GNU tar.
+They contained a
+list of files to be renamed or symlinked after extraction; this was
+originally used to support long names.
+The contents of this record
+are a text description of the operations to be done, in the form
+"Rename %s to %s\en"
+or
+"Symlink %s to %s\en ;"
+in either case, both
+filenames are escaped using K&R C syntax.
+Due to security concerns, "N" records are now generally ignored
+when reading archives.
+</dd><dt>S</dt><dd>
+This is a
+"sparse"
+regular file.
+Sparse files are stored as a series of fragments.
+The header contains a list of fragment offset/length pairs.
+If more than four such entries are required, the header is
+extended as necessary with
+"extra"
+header extensions (an older format that is no longer used), or
+"sparse"
+extensions.
+</dd><dt>V</dt><dd>
+The
+_name_
+field should be interpreted as a tape/volume header name.
+This entry should generally be ignored on extraction.
+</dd></dl>
+</dd><dt>_magic_</dt><dd>
+The magic field holds the five characters
+"ustar"
+followed by a space.
+Note that POSIX ustar archives have a trailing null.
+</dd><dt>_version_</dt><dd>
+The version field holds a space character followed by a null.
+Note that POSIX ustar archives use two copies of the ASCII digit
+"0".
+</dd><dt>_atime_, _ctime_</dt><dd>
+The time the file was last accessed and the time of
+last change of file information, stored in octal as with
+_mtime_.
+</dd><dt>_longnames_</dt><dd>
+This field is apparently no longer used.
+</dd><dt>Sparse _offset_ / _numbytes_</dt><dd>
+Each such structure specifies a single fragment of a sparse
+file.
+The two fields store values as octal numbers.
+The fragments are each padded to a multiple of 512 bytes
+in the archive.
+On extraction, the list of fragments is collected from the
+header (including any extension headers), and the data
+is then read and written to the file at appropriate offsets.
+</dd><dt>_isextended_</dt><dd>
+If this is set to non-zero, the header will be followed by additional
+"sparse header"
+records.
+Each such record contains information about as many as 21 additional
+sparse blocks as shown here:
+{{{
+struct gnu_sparse_header {
+ struct {
+ char offset[12];
+ char numbytes[12];
+ } sparse[21];
+ char isextended[1];
+ char padding[7];
+};
+}}}
+</dd><dt>_realsize_</dt><dd>
+A binary representation of the file's complete size, with a much larger range
+than the POSIX file size.
+In particular, with
+*M*
+type files, the current entry is only a portion of the file.
+In that case, the POSIX size field will indicate the size of this
+entry; the
+_realsize_
+field will indicate the total size of the file.
+</dd></dl>
+=== GNU tar pax archives===
+GNU tar 1.14 (XXX check this XXX) and later will write
+pax interchange format archives when you specify the
+*--posix*
+flag.
+This format uses custom keywords to store sparse file information.
+There have been three iterations of this support, referred to
+as
+"0.0",
+"0.1",
+and
+"1.0".
+<dl>
+<dt>*GNU.sparse.numblocks*, *GNU.sparse.offset*, *GNU.sparse.numbytes*, *GNU.sparse.size*</dt><dd>
+The
+"0.0"
+format used an initial
+*GNU.sparse.numblocks*
+attribute to indicate the number of blocks in the file, a pair of
+*GNU.sparse.offset*
+and
+*GNU.sparse.numbytes*
+to indicate the offset and size of each block,
+and a single
+*GNU.sparse.size*
+to indicate the full size of the file.
+This is not the same as the size in the tar header because the
+latter value does not include the size of any holes.
+This format required that the order of attributes be preserved and
+relied on readers accepting multiple appearances of the same attribute
+names, which is not officially permitted by the standards.
+</dd><dt>*GNU.sparse.map*</dt><dd>
+The
+"0.1"
+format used a single attribute that stored a comma-separated
+list of decimal numbers.
+Each pair of numbers indicated the offset and size, respectively,
+of a block of data.
+This does not work well if the archive is extracted by an archiver
+that does not recognize this extension, since many pax implementations
+simply discard unrecognized attributes.
+</dd><dt>*GNU.sparse.major*, *GNU.sparse.minor*, *GNU.sparse.name*, *GNU.sparse.realsize*</dt><dd>
+The
+"1.0"
+format stores the sparse block map in one or more 512-byte blocks
+prepended to the file data in the entry body.
+The pax attributes indicate the existence of this map
+(via the
+*GNU.sparse.major*
+and
+*GNU.sparse.minor*
+fields)
+and the full size of the file.
+The
+*GNU.sparse.name*
+holds the true name of the file.
+To avoid confusion, the name stored in the regular tar header
+is a modified name so that extraction errors will be apparent
+to users.
+</dd></dl>
+=== Solaris Tar===
+XXX More Details Needed XXX
+
+Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an
+"extended"
+format that is fundamentally similar to pax interchange format,
+with the following differences:
+<ul>
+<li>
+Extended attributes are stored in an entry whose type is
+*X*,
+not
+*x*,
+as used by pax interchange format.
+The detailed format of this entry appears to be the same
+as detailed above for the
+*x*
+entry.
+</li><li>
+An additional
+*A*
+entry is used to store an ACL for the following regular entry.
+The body of this entry contains a seven-digit octal number
+followed by a zero byte, followed by the
+textual ACL description.
+The octal value is the number of ACL entries
+plus a constant that indicates the ACL type: 01000000
+for POSIX.1e ACLs and 03000000 for NFSv4 ACLs.
+</li></ul>
+=== AIX Tar===
+XXX More details needed XXX
+=== Mac OS X Tar===
+The tar distributed with Apple's Mac OS X stores most regular files
+as two separate entries in the tar archive.
+The two entries have the same name except that the first
+one has
+"._"
+added to the beginning of the name.
+This first entry stores the
+"resource fork"
+with additional attributes for the file.
+The Mac OS X
+*CopyFile*()
+API is used to separate a file on disk into separate
+resource and data streams and to reassemble those separate
+streams when the file is restored to disk.
+=== Other Extensions===
+One obvious extension to increase the size of files is to
+eliminate the terminating characters from the various
+numeric fields.
+For example, the standard only allows the size field to contain
+11 octal digits, reserving the twelfth byte for a trailing
+NUL character.
+Allowing 12 octal digits allows file sizes up to 64 GB.
+
+Another extension, utilized by GNU tar, star, and other newer
+*tar*
+implementations, permits binary numbers in the standard numeric fields.
+This is flagged by setting the high bit of the first byte.
+This permits 95-bit values for the length and time fields
+and 63-bit values for the uid, gid, and device numbers.
+GNU tar supports this extension for the
+length, mtime, ctime, and atime fields.
+Joerg Schilling's star program supports this extension for
+all numeric fields.
+Note that this extension is largely obsoleted by the extended attribute
+record provided by the pax interchange format.
+
+Another early GNU extension allowed base-64 values rather than octal.
+This extension was short-lived and is no longer supported by any
+implementation.
+== SEE ALSO ==
+*ar*(1),
+*pax*(1),
+*tar*(1)
+== STANDARDS ==
+The
+*tar*
+utility is no longer a part of POSIX or the Single Unix Standard.
+It last appeared in
+Version 2 of the Single UNIX Specification (``SUSv2'').
+It has been supplanted in subsequent standards by
+*pax*(1).
+The ustar format is currently part of the specification for the
+*pax*(1)
+utility.
+The pax interchange file format is new with
+IEEE Std 1003.1-2001 (``POSIX.1'').
+== HISTORY ==
+A
+*tar*
+command appeared in Seventh Edition Unix, which was released in January, 1979.
+It replaced the
+*tp*
+program from Fourth Edition Unix which in turn replaced the
+*tap*
+program from First Edition Unix.
+John Gilmore's
+*pdtar*
+public-domain implementation (circa 1987) was highly influential
+and formed the basis of
+*GNU* tar
+(circa 1988).
+Joerg Shilling's
+*star*
+archiver is another open-source (GPL) archiver (originally developed
+circa 1985) which features complete support for pax interchange
+format.
+
+This documentation was written as part of the
+*libarchive*
+and
+*bsdtar*
+project by
+Tim Kientzle <kientzle@FreeBSD.org.>
diff --git a/archivers/libarchive/files/examples/minitar/minitar.c b/archivers/libarchive/files/examples/minitar/minitar.c
index c94391690e9..7e901118377 100644
--- a/archivers/libarchive/files/examples/minitar/minitar.c
+++ b/archivers/libarchive/files/examples/minitar/minitar.c
@@ -1,59 +1,42 @@
/*-
- * Copyright (c) 2003-2004 Tim Kientzle
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This file is in the public domain.
+ * Do with it as you will.
*/
/*-
* This is a compact "tar" program whose primary goal is small size.
- * Statically linked, it can be under 64k. This serves a number
+ * Statically linked, it can be very small indeed. This serves a number
* of goals:
* o a testbed for libarchive (to check for link pollution),
* o a useful tool for space-constrained systems (boot floppies, etc),
* o a place to experiment with new implementation ideas for bsdtar,
* o a small program to demonstrate libarchive usage.
*
- * Use the following macros to control what features get incorporated:
+ * Use the following macros to suppress features:
* NO_BZIP2 - Implies NO_BZIP2_CREATE and NO_BZIP2_EXTRACT
* NO_BZIP2_CREATE - Suppress bzip2 compression support.
* NO_BZIP2_EXTRACT - Suppress bzip2 auto-detection and decompression.
+ * NO_COMPRESS - Implies NO_COMPRESS_CREATE and NO_COMPRESS_EXTRACT
+ * NO_COMPRESS_CREATE - Suppress compress(1) compression support
* NO_COMPRESS_EXTRACT - Suppress compress(1) auto-detect and decompression.
- * NO_COMPRESS - Implies NO_COMPRESS_EXTRACT
* NO_CREATE - Suppress all archive creation support.
* NO_CPIO_EXTRACT - Suppress auto-detect and dearchiving of cpio archives.
* NO_GZIP - Implies NO_GZIP_CREATE and NO_GZIP_EXTRACT
* NO_GZIP_CREATE - Suppress gzip compression support.
* NO_GZIP_EXTRACT - Suppress gzip auto-detection and decompression.
+ * NO_LOOKUP - Try to avoid getpw/getgr routines, which can be very large
* NO_TAR_EXTRACT - Suppress tar extraction
*
- * With all of the above options (except NO_TAR_EXTRACT), you get a
- * very small program that can recognize and extract essentially any
- * uncompressed tar archive. On FreeBSD 5.1, this minimal program is
- * under 64k, statically linked. Without any of the above options,
- * you get a static executable of about 180k with a lot of very
- * sophisticated modern features.
- *
- * Compare this to over 60k for: main(){printf("hello, world!");}
+ * With all of the above macros defined (except NO_TAR_EXTRACT), you
+ * get a very small program that can recognize and extract essentially
+ * any uncompressed tar archive. On FreeBSD 5.1, this minimal program
+ * is under 64k, statically linked, which compares rather favorably to
+ * main(){printf("hello, world");}
+ * which is over 60k statically linked on the same operating system.
+ * Without any of the above macros, you get a static executable of
+ * about 180k with a lot of very sophisticated modern features.
+ * Obviously, it's trivial to add support for ISO, Zip, mtree,
+ * lzma/xz, etc. Just fill in the appropriate setup calls.
*/
#include <sys/types.h>
@@ -74,29 +57,13 @@ __FBSDID("$FreeBSD$");
#endif
/*
- * NO_CREATE implies NO_BZIP2_CREATE and NO_GZIP_CREATE.
+ * NO_CREATE implies NO_BZIP2_CREATE and NO_GZIP_CREATE and NO_COMPRESS_CREATE.
*/
#ifdef NO_CREATE
#undef NO_BZIP2_CREATE
#define NO_BZIP2_CREATE
-#undef NO_GZIP_CREATE
-#define NO_GZIP_CREATE
-#endif
-
-/*
- * The combination of NO_GZIP_CREATE and NO_GZIP_EXTRACT is
- * equivalent to NO_GZIP.
- */
-#ifdef NO_GZIP_CREATE
-#ifdef NO_GZIP_EXTRACT
-#undef NO_GZIP
-#define NO_GZIP
-#endif
-#endif
-
-#ifdef NO_GZIP
-#undef NO_GZIP_EXTRACT
-#define NO_GZIP_EXTRACT
+#undef NO_COMPRESS_CREATE
+#define NO_COMPRESS_CREATE
#undef NO_GZIP_CREATE
#define NO_GZIP_CREATE
#endif
@@ -120,18 +87,40 @@ __FBSDID("$FreeBSD$");
#endif
/*
- * NO_COMPRESS_EXTRACT and NO_COMPRESS are equivalent.
+ * The combination of NO_COMPRESS_CREATE and NO_COMPRESS_EXTRACT is
+ * equivalent to NO_COMPRESS.
*/
+#ifdef NO_COMPRESS_CREATE
#ifdef NO_COMPRESS_EXTRACT
#undef NO_COMPRESS
#define NO_COMPRESS
#endif
+#endif
#ifdef NO_COMPRESS
#undef NO_COMPRESS_EXTRACT
#define NO_COMPRESS_EXTRACT
+#undef NO_COMPRESS_CREATE
+#define NO_COMPRESS_CREATE
+#endif
+
+/*
+ * The combination of NO_GZIP_CREATE and NO_GZIP_EXTRACT is
+ * equivalent to NO_GZIP.
+ */
+#ifdef NO_GZIP_CREATE
+#ifdef NO_GZIP_EXTRACT
+#undef NO_GZIP
+#define NO_GZIP
+#endif
#endif
+#ifdef NO_GZIP
+#undef NO_GZIP_EXTRACT
+#define NO_GZIP_EXTRACT
+#undef NO_GZIP_CREATE
+#define NO_GZIP_CREATE
+#endif
#ifndef NO_CREATE
static void create(const char *filename, int compress, const char **argv);
@@ -198,6 +187,11 @@ main(int argc, const char **argv)
compress = opt;
break;
#endif
+#ifndef NO_COMPRESS_CREATE
+ case 'Z':
+ compress = opt;
+ break;
+#endif
#ifndef NO_GZIP_CREATE
case 'z':
compress = opt;
@@ -234,6 +228,7 @@ static void
create(const char *filename, int compress, const char **argv)
{
struct archive *a;
+ struct archive *disk;
struct archive_entry *entry;
ssize_t len;
int fd;
@@ -245,6 +240,11 @@ create(const char *filename, int compress, const char **argv)
archive_write_set_compression_bzip2(a);
break;
#endif
+#ifndef NO_COMPRESS_CREATE
+ case 'Z':
+ archive_write_set_compression_compress(a);
+ break;
+#endif
#ifndef NO_GZIP_CREATE
case 'z':
archive_write_set_compression_gzip(a);
@@ -258,12 +258,18 @@ create(const char *filename, int compress, const char **argv)
if (strcmp(filename, "-") == 0)
filename = NULL;
archive_write_open_file(a, filename);
+
+ disk = archive_read_disk_new();
+#ifndef NO_LOOKUP
+ archive_read_disk_set_standard_lookup(disk);
+#endif
while (*argv != NULL) {
struct tree *t = tree_open(*argv);
while (tree_next(t)) {
entry = archive_entry_new();
- archive_entry_copy_stat(entry, tree_current_stat(t));
archive_entry_set_pathname(entry, tree_current_path(t));
+ archive_read_disk_entry_from_file(disk, entry, -1,
+ tree_current_stat(t));
if (verbose) {
msg("a ");
msg(tree_current_path(t));
@@ -313,6 +319,9 @@ extract(const char *filename, int do_extract, int flags)
#ifndef NO_CPIO_EXTRACT
archive_read_support_format_cpio(a);
#endif
+#ifndef NO_LOOKUP
+ archive_write_disk_set_standard_lookup(ext);
+#endif
if (filename != NULL && strcmp(filename, "-") == 0)
filename = NULL;
if ((r = archive_read_open_file(a, filename, 10240))) {
@@ -399,6 +408,9 @@ usage(void)
#ifndef NO_BZIP2
"y"
#endif
+#ifndef NO_COMPRESS
+ "Z"
+#endif
#ifndef NO_GZIP
"z"
#endif
@@ -407,27 +419,3 @@ usage(void)
errmsg(m);
exit(1);
}
-
-#if 0
-/*
- * These override functions in libc (which are called by libarchive).
- * The libc functions are pretty large; this bit of subterfuge
- * reduces the size of the executable by about 70%.
- */
-struct passwd *getpwnam(const char *);
-struct group *getgrnam(const char *);
-
-struct passwd *
-getpwnam(const char *login)
-{
- (void)login;
- return (NULL);
-}
-
-struct group *
-getgrnam(const char *name)
-{
- (void)name;
- return (NULL);
-}
-#endif
diff --git a/archivers/libarchive/files/examples/untar.c b/archivers/libarchive/files/examples/untar.c
index 88f6dc26de0..e77adf70125 100644
--- a/archivers/libarchive/files/examples/untar.c
+++ b/archivers/libarchive/files/examples/untar.c
@@ -4,29 +4,52 @@
*/
/*
- * This is a compact tar extraction program whose primary goal is
- * small size. Statically linked, it can be under 64k, depending on
- * how cleanly factored your system libraries are. Note that this
- * uses the standard libarchive, without any special recompilation.
- * The only functional concession is that this program uses the
- * uid/gid from the archive instead of doing uname/gname lookups.
- * (Call archive_write_disk_set_standard_lookup() to enable
- * uname/gname lookups, but be aware that this can add 500k or more to
- * a static executable, depending on the system libraries.)
+ * This is a compact tar extraction program using libarchive whose
+ * primary goal is small executable size. Statically linked, it can
+ * be very small, depending in large part on how cleanly factored your
+ * system libraries are. Note that this uses the standard libarchive,
+ * without any special recompilation. The only functional concession
+ * is that this program uses the uid/gid from the archive instead of
+ * doing uname/gname lookups. (Add a call to
+ * archive_write_disk_set_standard_lookup() to enable uname/gname
+ * lookups, but be aware that this can add 500k or more to a static
+ * executable, depending on the system libraries, since user/group
+ * lookups frequently pull in password, YP/LDAP, networking, and DNS
+ * resolver libraries.)
*
* To build:
- * gcc -static -Wall -o untar untar.c -larchive
- * strip untar
+ * $ gcc -static -Wall -o untar untar.c -larchive
+ * $ strip untar
+ *
+ * NOTE: On some systems, you may need to add additional flags
+ * to ensure that untar.c is compiled the same way as libarchive
+ * was compiled. In particular, Linux users will probably
+ * have to add -D_FILE_OFFSET_BITS=64 to the command line above.
*
* For fun, statically compile the following simple hello.c program
- * and compare the size. (On my system, the result is 89k, untar is
- * 69k.)
+ * using the same flags as for untar and compare the size:
*
* #include <stdio.h>
* int main(int argc, char **argv) {
* printf("hello, world\n");
* return(0);
* }
+ *
+ * You may be even more surprised by the compiled size of true.c listed here:
+ *
+ * int main(int argc, char **argv) {
+ * return (0);
+ * }
+ *
+ * On a slightly customized FreeBSD 5 system that I used around
+ * 2005, hello above compiled to 89k compared to untar of 69k. So at
+ * that time, libarchive's tar reader and extract-to-disk routines
+ * compiled to less code than printf().
+ *
+ * On my FreeBSD development system today (August, 2009):
+ * hello: 195024 bytes
+ * true: 194912 bytes
+ * untar: 259924 bytes
*/
#include <sys/types.h>
@@ -44,9 +67,11 @@ __FBSDID("$FreeBSD$");
static void errmsg(const char *);
static void extract(const char *filename, int do_extract, int flags);
+static void fail(const char *, const char *, int);
static int copy_data(struct archive *, struct archive *);
static void msg(const char *);
static void usage(void);
+static void warn(const char *, const char *);
static int verbose = 0;
@@ -133,20 +158,16 @@ extract(const char *filename, int do_extract, int flags)
*/
if (filename != NULL && strcmp(filename, "-") == 0)
filename = NULL;
- if ((r = archive_read_open_file(a, filename, 10240))) {
- errmsg(archive_error_string(a));
- errmsg("\n");
- exit(r);
- }
+ if ((r = archive_read_open_file(a, filename, 10240)))
+ fail("archive_read_open_file()",
+ archive_error_string(a), r);
for (;;) {
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
break;
- if (r != ARCHIVE_OK) {
- errmsg(archive_error_string(a));
- errmsg("\n");
- exit(1);
- }
+ if (r != ARCHIVE_OK)
+ fail("archive_read_next_header()",
+ archive_error_string(a), 1);
if (verbose && do_extract)
msg("x ");
if (verbose || !do_extract)
@@ -154,9 +175,16 @@ extract(const char *filename, int do_extract, int flags)
if (do_extract) {
r = archive_write_header(ext, entry);
if (r != ARCHIVE_OK)
- errmsg(archive_error_string(a));
- else
+ warn("archive_write_header()",
+ archive_error_string(ext));
+ else {
copy_data(a, ext);
+ r = archive_write_finish_entry(ext);
+ if (r != ARCHIVE_OK)
+ fail("archive_write_finish_entry()",
+ archive_error_string(ext), 1);
+ }
+
}
if (verbose || !do_extract)
msg("\n");
@@ -176,20 +204,27 @@ copy_data(struct archive *ar, struct archive *aw)
for (;;) {
r = archive_read_data_block(ar, &buff, &size, &offset);
- if (r == ARCHIVE_EOF) {
- errmsg(archive_error_string(ar));
+ if (r == ARCHIVE_EOF)
return (ARCHIVE_OK);
- }
if (r != ARCHIVE_OK)
return (r);
r = archive_write_data_block(aw, buff, size, offset);
if (r != ARCHIVE_OK) {
- errmsg(archive_error_string(ar));
+ warn("archive_write_data_block()",
+ archive_error_string(aw));
return (r);
}
}
}
+/*
+ * These reporting functions use low-level I/O; on some systems, this
+ * is a significant code reduction. Of course, on many server and
+ * desktop operating systems, malloc() and even crt rely on printf(),
+ * which in turn pulls in most of the rest of stdio, so this is not an
+ * optimization at all there. (If you're going to pay 100k or more
+ * for printf() anyway, you may as well use it!)
+ */
static void
msg(const char *m)
{
@@ -203,6 +238,22 @@ errmsg(const char *m)
}
static void
+warn(const char *f, const char *m)
+{
+ errmsg(f);
+ errmsg(" failed: ");
+ errmsg(m);
+ errmsg("\n");
+}
+
+static void
+fail(const char *f, const char *m, int r)
+{
+ warn(f, m);
+ exit(r);
+}
+
+static void
usage(void)
{
const char *m = "Usage: untar [-tvx] [-f file] [file]\n";
diff --git a/archivers/libarchive/files/libarchive/CMakeLists.txt b/archivers/libarchive/files/libarchive/CMakeLists.txt
new file mode 100644
index 00000000000..459a5ddbb90
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/CMakeLists.txt
@@ -0,0 +1,139 @@
+
+############################################
+#
+# How to build libarchive
+#
+############################################
+
+# Public headers
+SET(include_HEADERS
+ archive.h
+ archive_entry.h
+)
+
+# Sources and private headers
+SET(libarchive_SOURCES
+ archive_check_magic.c
+ archive_endian.h
+ archive_entry.c
+ archive_entry.h
+ archive_entry_copy_stat.c
+ archive_entry_link_resolver.c
+ archive_entry_private.h
+ archive_entry_stat.c
+ archive_entry_strmode.c
+ archive_entry_xattr.c
+ archive_hash.h
+ archive_platform.h
+ archive_private.h
+ archive_read.c
+ archive_read_data_into_fd.c
+ archive_read_disk.c
+ archive_read_disk_entry_from_file.c
+ archive_read_disk_private.h
+ archive_read_disk_set_standard_lookup.c
+ archive_read_extract.c
+ archive_read_open_fd.c
+ archive_read_open_file.c
+ archive_read_open_filename.c
+ archive_read_open_memory.c
+ archive_read_private.h
+ archive_read_support_compression_all.c
+ archive_read_support_compression_bzip2.c
+ archive_read_support_compression_compress.c
+ archive_read_support_compression_gzip.c
+ archive_read_support_compression_none.c
+ archive_read_support_compression_program.c
+ archive_read_support_compression_rpm.c
+ archive_read_support_compression_uu.c
+ archive_read_support_compression_xz.c
+ archive_read_support_format_all.c
+ archive_read_support_format_ar.c
+ archive_read_support_format_cpio.c
+ archive_read_support_format_empty.c
+ archive_read_support_format_iso9660.c
+ archive_read_support_format_mtree.c
+ archive_read_support_format_raw.c
+ archive_read_support_format_tar.c
+ archive_read_support_format_xar.c
+ archive_read_support_format_zip.c
+ archive_string.c
+ archive_string.h
+ archive_string_sprintf.c
+ archive_util.c
+ archive_virtual.c
+ archive_write.c
+ archive_write_disk.c
+ archive_write_disk_private.h
+ archive_write_disk_set_standard_lookup.c
+ archive_write_private.h
+ archive_write_open_fd.c
+ archive_write_open_file.c
+ archive_write_open_filename.c
+ archive_write_open_memory.c
+ archive_write_set_compression_bzip2.c
+ archive_write_set_compression_compress.c
+ archive_write_set_compression_gzip.c
+ archive_write_set_compression_none.c
+ archive_write_set_compression_program.c
+ archive_write_set_compression_xz.c
+ archive_write_set_format.c
+ archive_write_set_format_ar.c
+ archive_write_set_format_by_name.c
+ archive_write_set_format_cpio.c
+ archive_write_set_format_cpio_newc.c
+ archive_write_set_format_mtree.c
+ archive_write_set_format_pax.c
+ archive_write_set_format_shar.c
+ archive_write_set_format_ustar.c
+ archive_write_set_format_zip.c
+ filter_fork.c
+ filter_fork.h
+)
+
+# Man pages
+SET(libarchive_MANS
+ archive_entry.3
+ archive_read.3
+ archive_read_disk.3
+ archive_util.3
+ archive_write.3
+ archive_write_disk.3
+ cpio.5
+ libarchive.3
+ libarchive_internals.3
+ libarchive-formats.5
+ mtree.5
+ tar.5
+)
+
+IF(WIN32 AND NOT CYGWIN)
+ LIST(APPEND libarchive_SOURCES archive_entry_copy_bhfi.c)
+ LIST(APPEND libarchive_SOURCES archive_windows.c)
+ LIST(APPEND libarchive_SOURCES archive_windows.h)
+ LIST(APPEND libarchive_SOURCES filter_fork_windows.c)
+ENDIF(WIN32 AND NOT CYGWIN)
+
+# Libarchive is a shared library
+ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
+TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
+SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
+
+# archive_static is a static library
+ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
+SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
+ LIBARCHIVE_STATIC)
+# On Posix systems, libarchive.so and libarchive.a can co-exist.
+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)
+
+add_subdirectory(test)
diff --git a/archivers/libarchive/files/libarchive/archive.h b/archivers/libarchive/files/libarchive/archive.h
index 3f9f6e1cf67..53851c6e149 100644
--- a/archivers/libarchive/files/libarchive/archive.h
+++ b/archivers/libarchive/files/libarchive/archive.h
@@ -35,22 +35,40 @@
* this header! If you must conditionalize, use predefined compiler and/or
* platform macros.
*/
+#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560
+# define __LA_STDINT_H <stdint.h>
+#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__)
+# define __LA_STDINT_H <inttypes.h>
+#endif
+#include <sys/stat.h>
#include <sys/types.h> /* Linux requires this for off_t */
-#if !defined(__WATCOMC__) && !defined(_MSC_VER)
-/* Header unavailable on Watcom C or MS Visual C++. */
-#include <inttypes.h> /* int64_t, etc. */
+#ifdef __LA_STDINT_H
+# include __LA_STDINT_H /* int64_t, etc. */
#endif
#include <stdio.h> /* For FILE * */
/* Get appropriate definitions of standard POSIX-style types. */
/* These should match the types used in 'struct stat' */
-#ifdef _WIN32
-#define __LA_SSIZE_T long
-#define __LA_UID_T unsigned int
-#define __LA_GID_T unsigned int
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define __LA_INT64_T __int64
+# if defined(_SSIZE_T_DEFINED)
+# define __LA_SSIZE_T ssize_t
+# elif defined(_WIN64)
+# define __LA_SSIZE_T __int64
+# else
+# define __LA_SSIZE_T long
+# endif
+# if defined(__BORLANDC__)
+# define __LA_UID_T uid_t
+# define __LA_GID_T gid_t
+# else
+# define __LA_UID_T short
+# define __LA_GID_T short
+# endif
#else
#include <unistd.h> /* ssize_t, uid_t, and gid_t */
+#define __LA_INT64_T int64_t
#define __LA_SSIZE_T ssize_t
#define __LA_UID_T uid_t
#define __LA_GID_T gid_t
@@ -61,7 +79,7 @@
* .lib. The default here assumes you're building a DLL. Only
* libarchive source should ever define __LIBARCHIVE_BUILD.
*/
-#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC)
+#if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
# ifdef __LIBARCHIVE_BUILD
# ifdef __GNUC__
# define __LA_DECL __attribute__((dllexport)) extern
@@ -80,7 +98,6 @@
# define __LA_DECL
#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -112,13 +129,13 @@ extern "C" {
* (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
* #endif
*/
-#define ARCHIVE_VERSION_NUMBER 2005005
+#define ARCHIVE_VERSION_NUMBER 2008000
__LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_STRING "libarchive 2.5.5"
+#define ARCHIVE_VERSION_STRING "libarchive 2.8.0"
__LA_DECL const char * archive_version_string(void);
#if ARCHIVE_VERSION_NUMBER < 3000000
@@ -183,20 +200,37 @@ struct archive_entry;
*/
/* Returns pointer and size of next block of data from archive. */
-typedef __LA_SSIZE_T archive_read_callback(struct archive *, void *_client_data,
- const void **_buffer);
+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 */
#if ARCHIVE_VERSION_NUMBER < 2000000
-typedef __LA_SSIZE_T archive_skip_callback(struct archive *, void *_client_data,
- size_t request);
+/* Libarchive 1.0 used ssize_t for the return, which is only 32 bits
+ * on most 32-bit platforms; not large enough. */
+typedef __LA_SSIZE_T archive_skip_callback(struct archive *,
+ void *_client_data, size_t request);
+#elif ARCHIVE_VERSION_NUMBER < 3000000
+/* Libarchive 2.0 used off_t here, but that is a bad idea on Linux and a
+ * few other platforms where off_t varies with build settings. */
+typedef off_t archive_skip_callback(struct archive *,
+ void *_client_data, off_t request);
#else
-typedef off_t archive_skip_callback(struct archive *, void *_client_data,
- off_t request);
+/* Libarchive 3.0 uses int64_t here, which is actually guaranteed to be
+ * 64 bits on every platform. */
+typedef __LA_INT64_T archive_skip_callback(struct archive *,
+ void *_client_data, __LA_INT64_T request);
#endif
+
/* Returns size actually written, zero on EOF, -1 on error. */
-typedef __LA_SSIZE_T archive_write_callback(struct archive *, void *_client_data,
- const void *_buffer, size_t _length);
+typedef __LA_SSIZE_T archive_write_callback(struct archive *,
+ void *_client_data,
+ const void *_buffer, size_t _length);
+
+#if ARCHIVE_VERSION_NUMBER < 3000000
+/* Open callback is actually never needed; remove it in libarchive 3.0. */
typedef int archive_open_callback(struct archive *, void *_client_data);
+#endif
+
typedef int archive_close_callback(struct archive *, void *_client_data);
/*
@@ -207,6 +241,10 @@ typedef int archive_close_callback(struct archive *, void *_client_data);
#define ARCHIVE_COMPRESSION_BZIP2 2
#define ARCHIVE_COMPRESSION_COMPRESS 3
#define ARCHIVE_COMPRESSION_PROGRAM 4
+#define ARCHIVE_COMPRESSION_LZMA 5
+#define ARCHIVE_COMPRESSION_XZ 6
+#define ARCHIVE_COMPRESSION_UU 7
+#define ARCHIVE_COMPRESSION_RPM 8
/*
* Codes returned by archive_format.
@@ -247,8 +285,8 @@ typedef int archive_close_callback(struct archive *, void *_client_data);
#define ARCHIVE_FORMAT_AR_GNU (ARCHIVE_FORMAT_AR | 1)
#define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2)
#define ARCHIVE_FORMAT_MTREE 0x80000
-#define ARCHIVE_FORMAT_MTREE_V1 (ARCHIVE_FORMAT_MTREE | 1)
-#define ARCHIVE_FORMAT_MTREE_V2 (ARCHIVE_FORMAT_MTREE | 2)
+#define ARCHIVE_FORMAT_RAW 0x90000
+#define ARCHIVE_FORMAT_XAR 0xA0000
/*-
* Basic outline for reading an archive:
@@ -275,9 +313,17 @@ __LA_DECL int archive_read_support_compression_all(struct archive *);
__LA_DECL int archive_read_support_compression_bzip2(struct archive *);
__LA_DECL int archive_read_support_compression_compress(struct archive *);
__LA_DECL int archive_read_support_compression_gzip(struct archive *);
+__LA_DECL int archive_read_support_compression_lzma(struct archive *);
__LA_DECL int archive_read_support_compression_none(struct archive *);
__LA_DECL int archive_read_support_compression_program(struct archive *,
const char *command);
+__LA_DECL int archive_read_support_compression_program_signature
+ (struct archive *, const char *,
+ const void * /* match */, size_t);
+
+__LA_DECL int archive_read_support_compression_rpm(struct archive *);
+__LA_DECL int archive_read_support_compression_uu(struct archive *);
+__LA_DECL int archive_read_support_compression_xz(struct archive *);
__LA_DECL int archive_read_support_format_all(struct archive *);
__LA_DECL int archive_read_support_format_ar(struct archive *);
@@ -286,7 +332,9 @@ __LA_DECL int archive_read_support_format_empty(struct archive *);
__LA_DECL int archive_read_support_format_gnutar(struct archive *);
__LA_DECL int archive_read_support_format_iso9660(struct archive *);
__LA_DECL int archive_read_support_format_mtree(struct archive *);
+__LA_DECL int archive_read_support_format_raw(struct archive *);
__LA_DECL int archive_read_support_format_tar(struct archive *);
+__LA_DECL int archive_read_support_format_xar(struct archive *);
__LA_DECL int archive_read_support_format_zip(struct archive *);
@@ -326,22 +374,34 @@ __LA_DECL int archive_read_open_FILE(struct archive *, FILE *_file);
__LA_DECL int archive_read_next_header(struct archive *,
struct archive_entry **);
+/* Parses and returns next entry header using the archive_entry passed in */
+__LA_DECL int archive_read_next_header2(struct archive *,
+ struct archive_entry *);
+
/*
* Retrieve the byte offset in UNCOMPRESSED data where last-read
* header started.
*/
-__LA_DECL int64_t archive_read_header_position(struct archive *);
+__LA_DECL __LA_INT64_T archive_read_header_position(struct archive *);
/* Read data from the body of an entry. Similar to read(2). */
-__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t);
+__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *,
+ void *, size_t);
+
/*
* A zero-copy version of archive_read_data that also exposes the file offset
* of each returned block. Note that the client has no way to specify
* the desired size of the block. The API does guarantee that offsets will
* be strictly increasing and that returned blocks will not overlap.
*/
+#if ARCHIVE_VERSION_NUMBER < 3000000
__LA_DECL int archive_read_data_block(struct archive *a,
- const void **buff, size_t *size, off_t *offset);
+ const void **buff, size_t *size, off_t *offset);
+#else
+__LA_DECL int archive_read_data_block(struct archive *a,
+ const void **buff, size_t *size,
+ __LA_INT64_T *offset);
+#endif
/*-
* Some convenience functions that are built on archive_read_data:
@@ -350,10 +410,23 @@ __LA_DECL int archive_read_data_block(struct archive *a,
* 'into_fd': writes data to specified filedes
*/
__LA_DECL int archive_read_data_skip(struct archive *);
-__LA_DECL int archive_read_data_into_buffer(struct archive *, void *buffer,
- __LA_SSIZE_T len);
+__LA_DECL int archive_read_data_into_buffer(struct archive *,
+ void *buffer, __LA_SSIZE_T len);
__LA_DECL int archive_read_data_into_fd(struct archive *, int fd);
+/*
+ * Set read options.
+ */
+/* Apply option string to the format only. */
+__LA_DECL int archive_read_set_format_options(struct archive *_a,
+ const char *s);
+/* Apply option string to the filter only. */
+__LA_DECL int archive_read_set_filter_options(struct archive *_a,
+ const char *s);
+/* Apply option string to both the format and the filter. */
+__LA_DECL int archive_read_set_options(struct archive *_a,
+ const char *s);
+
/*-
* Convenience function to recreate the current entry (whose header
* has just been read) on disk.
@@ -414,12 +487,11 @@ __LA_DECL void archive_read_extract_set_skip_file(struct archive *,
__LA_DECL int archive_read_close(struct archive *);
/* Release all resources and destroy the object. */
/* Note that archive_read_finish will call archive_read_close for you. */
-#if ARCHIVE_VERSION_NUMBER >= 2000000
-__LA_DECL int archive_read_finish(struct archive *);
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
+#if ARCHIVE_VERSION_NUMBER < 2000000
/* Erroneously declared to return void in libarchive 1.x */
__LA_DECL void archive_read_finish(struct archive *);
+#else
+__LA_DECL int archive_read_finish(struct archive *);
#endif
/*-
@@ -453,9 +525,11 @@ __LA_DECL int archive_write_set_skip_file(struct archive *, dev_t, ino_t);
__LA_DECL int archive_write_set_compression_bzip2(struct archive *);
__LA_DECL int archive_write_set_compression_compress(struct archive *);
__LA_DECL int archive_write_set_compression_gzip(struct archive *);
+__LA_DECL int archive_write_set_compression_lzma(struct archive *);
__LA_DECL int archive_write_set_compression_none(struct archive *);
__LA_DECL int archive_write_set_compression_program(struct archive *,
const char *cmd);
+__LA_DECL int archive_write_set_compression_xz(struct archive *);
/* A convenience function to set the format based on the code or name. */
__LA_DECL int archive_write_set_format(struct archive *, int format_code);
__LA_DECL int archive_write_set_format_by_name(struct archive *,
@@ -465,12 +539,14 @@ __LA_DECL int archive_write_set_format_ar_bsd(struct archive *);
__LA_DECL int archive_write_set_format_ar_svr4(struct archive *);
__LA_DECL int archive_write_set_format_cpio(struct archive *);
__LA_DECL int archive_write_set_format_cpio_newc(struct archive *);
+__LA_DECL int archive_write_set_format_mtree(struct archive *);
/* TODO: int archive_write_set_format_old_tar(struct archive *); */
__LA_DECL int archive_write_set_format_pax(struct archive *);
__LA_DECL int archive_write_set_format_pax_restricted(struct archive *);
__LA_DECL int archive_write_set_format_shar(struct archive *);
__LA_DECL int archive_write_set_format_shar_dump(struct archive *);
__LA_DECL int archive_write_set_format_ustar(struct archive *);
+__LA_DECL int archive_write_set_format_zip(struct archive *);
__LA_DECL int archive_write_open(struct archive *, void *,
archive_open_callback *, archive_write_callback *,
archive_close_callback *);
@@ -490,29 +566,59 @@ __LA_DECL int archive_write_open_memory(struct archive *,
*/
__LA_DECL int archive_write_header(struct archive *,
struct archive_entry *);
-#if ARCHIVE_VERSION_NUMBER >= 2000000
-__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, const void *, size_t);
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
+#if ARCHIVE_VERSION_NUMBER < 2000000
/* This was erroneously declared to return "int" in libarchive 1.x. */
-__LA_DECL int archive_write_data(struct archive *, const void *, size_t);
+__LA_DECL int archive_write_data(struct archive *,
+ const void *, size_t);
+#else
+/* Libarchive 2.0 and later return ssize_t here. */
+__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *,
+ const void *, size_t);
+#endif
+
+#if ARCHIVE_VERSION_NUMBER < 3000000
+/* Libarchive 1.x and 2.x use off_t for the argument, but that's not
+ * stable on Linux. */
+__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *,
+ const void *, size_t, off_t);
+#else
+/* Libarchive 3.0 uses explicit int64_t to ensure consistent 64-bit support. */
+__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *,
+ const void *, size_t, __LA_INT64_T);
#endif
-__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, const void *, size_t, off_t);
__LA_DECL int archive_write_finish_entry(struct archive *);
__LA_DECL int archive_write_close(struct archive *);
-#if ARCHIVE_VERSION_NUMBER >= 2000000
-__LA_DECL int archive_write_finish(struct archive *);
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
+#if ARCHIVE_VERSION_NUMBER < 2000000
/* Return value was incorrect in libarchive 1.x. */
__LA_DECL void archive_write_finish(struct archive *);
+#else
+/* Libarchive 2.x and later returns an error if this fails. */
+/* It can fail if the archive wasn't already closed, in which case
+ * archive_write_finish() will implicitly call archive_write_close(). */
+__LA_DECL int archive_write_finish(struct archive *);
#endif
+/*
+ * Set write options.
+ */
+/* Apply option string to the format only. */
+__LA_DECL int archive_write_set_format_options(struct archive *_a,
+ const char *s);
+/* Apply option string to the compressor only. */
+__LA_DECL int archive_write_set_compressor_options(struct archive *_a,
+ const char *s);
+/* Apply option string to both the format and the compressor. */
+__LA_DECL int archive_write_set_options(struct archive *_a,
+ const char *s);
+
+
/*-
+ * ARCHIVE_WRITE_DISK API
+ *
* To create objects on disk:
* 1) Ask archive_write_disk_new for a new archive_write_disk object.
- * 2) Set any global properties. In particular, you should set
- * the compression and format to use.
+ * 2) Set any global properties. In particular, you probably
+ * want to set the options.
* 3) For each entry:
* - construct an appropriate struct archive_entry structure
* - archive_write_header to create the file/dir/etc on disk
@@ -526,7 +632,8 @@ __LA_DECL struct archive *archive_write_disk_new(void);
/* This file will not be overwritten. */
__LA_DECL int archive_write_disk_set_skip_file(struct archive *,
dev_t, ino_t);
-/* Set flags to control how the next item gets created. */
+/* Set flags to control how the next item gets created.
+ * This accepts a bitmask of ARCHIVE_EXTRACT_XXX flags defined above. */
__LA_DECL int archive_write_disk_set_options(struct archive *,
int flags);
/*
@@ -562,13 +669,47 @@ __LA_DECL int archive_write_disk_set_user_lookup(struct archive *,
void (* /* cleanup */)(void *));
/*
+ * ARCHIVE_READ_DISK API
+ *
+ * This is still evolving and somewhat experimental.
+ */
+__LA_DECL struct archive *archive_read_disk_new(void);
+/* The names for symlink modes here correspond to an old BSD
+ * command-line argument convention: -L, -P, -H */
+/* Follow all symlinks. */
+__LA_DECL int archive_read_disk_set_symlink_logical(struct archive *);
+/* Follow no symlinks. */
+__LA_DECL int archive_read_disk_set_symlink_physical(struct archive *);
+/* Follow symlink initially, then not. */
+__LA_DECL int archive_read_disk_set_symlink_hybrid(struct archive *);
+/* TODO: Handle Linux stat32/stat64 ugliness. <sigh> */
+__LA_DECL int archive_read_disk_entry_from_file(struct archive *,
+ struct archive_entry *, int /* fd */, const struct stat *);
+/* Look up gname for gid or uname for uid. */
+/* Default implementations are very, very stupid. */
+__LA_DECL const char *archive_read_disk_gname(struct archive *, __LA_GID_T);
+__LA_DECL const char *archive_read_disk_uname(struct archive *, __LA_UID_T);
+/* "Standard" implementation uses getpwuid_r, getgrgid_r and caches the
+ * results for performance. */
+__LA_DECL int archive_read_disk_set_standard_lookup(struct archive *);
+/* You can install your own lookups if you like. */
+__LA_DECL int archive_read_disk_set_gname_lookup(struct archive *,
+ void * /* private_data */,
+ const char *(* /* lookup_fn */)(void *, __LA_GID_T),
+ void (* /* cleanup_fn */)(void *));
+__LA_DECL int archive_read_disk_set_uname_lookup(struct archive *,
+ void * /* private_data */,
+ const char *(* /* lookup_fn */)(void *, __LA_UID_T),
+ void (* /* cleanup_fn */)(void *));
+
+/*
* Accessor functions to read/set various information in
* the struct archive object:
*/
/* Bytes written after compression or read before decompression. */
-__LA_DECL int64_t archive_position_compressed(struct archive *);
+__LA_DECL __LA_INT64_T archive_position_compressed(struct archive *);
/* Bytes written to compressor or read from decompressor. */
-__LA_DECL int64_t archive_position_uncompressed(struct archive *);
+__LA_DECL __LA_INT64_T archive_position_uncompressed(struct archive *);
__LA_DECL const char *archive_compression_name(struct archive *);
__LA_DECL int archive_compression(struct archive *);
@@ -581,12 +722,20 @@ __LA_DECL void archive_set_error(struct archive *, int _err,
const char *fmt, ...);
__LA_DECL void archive_copy_error(struct archive *dest,
struct archive *src);
+__LA_DECL int archive_file_count(struct archive *);
#ifdef __cplusplus
}
#endif
-/* This is meaningless outside of this header. */
+/* These are meaningless outside of this header. */
#undef __LA_DECL
+#undef __LA_GID_T
+#undef __LA_UID_T
+
+/* These need to remain defined because they're used in the
+ * callback type definitions. XXX Fix this. This is ugly. XXX */
+/* #undef __LA_INT64_T */
+/* #undef __LA_SSIZE_T */
#endif /* !ARCHIVE_H_INCLUDED */
diff --git a/archivers/libarchive/files/libarchive/archive_check_magic.c b/archivers/libarchive/files/libarchive/archive_check_magic.c
index 715486dcfeb..e27e5d82708 100644
--- a/archivers/libarchive/files/libarchive/archive_check_magic.c
+++ b/archivers/libarchive/files/libarchive/archive_check_magic.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.8 2007/04/02 00:15:45 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_check_magic.c 201089 2009-12-28 02:20:23Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -40,20 +40,36 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.8 2007/04/02 00
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#include <winbase.h>
+#endif
#include "archive_private.h"
static void
errmsg(const char *m)
{
- write(STDERR_FILENO, m, strlen(m));
+ size_t s = strlen(m);
+ ssize_t written;
+
+ while (s > 0) {
+ written = write(2, m, strlen(m));
+ if (written <= 0)
+ return;
+ m += written;
+ s -= written;
+ }
}
static void
diediedie(void)
{
- *(char *)0 = 1; /* Deliberately segfault and force a coredump. */
- _exit(1); /* If that didn't work, just exit with an error. */
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+ /* Cause a breakpoint exception */
+ DebugBreak();
+#endif
+ abort(); /* Terminate the program abnormally. */
}
static const char *
@@ -77,7 +93,7 @@ write_all_states(unsigned int states)
unsigned int lowbit;
/* A trick for computing the lowest set bit. */
- while ((lowbit = states & (-states)) != 0) {
+ while ((lowbit = states & (1 + ~states)) != 0) {
states &= ~lowbit; /* Clear the low bit. */
errmsg(state_name(lowbit));
if (states != 0)
diff --git a/archivers/libarchive/files/libarchive/archive_endian.h b/archivers/libarchive/files/libarchive/archive_endian.h
index 550be164029..edc90ee6a84 100644
--- a/archivers/libarchive/files/libarchive/archive_endian.h
+++ b/archivers/libarchive/files/libarchive/archive_endian.h
@@ -23,11 +23,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_endian.h,v 1.3 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_endian.h 201085 2009-12-28 02:17:15Z kientzle $
*
* Borrowed from FreeBSD's <sys/endian.h>
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
/* Note: This is a purely internal header! */
/* Do not use this outside of libarchive internal code! */
@@ -35,14 +39,16 @@
#define ARCHIVE_ENDIAN_H_INCLUDED
-/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */
-#if defined( __WATCOMC__ )
- #define inline
-#endif
-
-/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */
-#if defined(_MSC_VER)
- #define inline
+/*
+ * Disabling inline keyword for compilers known to choke on it:
+ * - Watcom C++ in C code. (For any version?)
+ * - SGI MIPSpro
+ * - Microsoft Visual C++ 6.0 (supposedly newer versions too)
+ */
+#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__)
+#define inline
+#elif defined(_MSC_VER)
+#define inline __inline
#endif
/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */
diff --git a/archivers/libarchive/files/libarchive/archive_entry.c b/archivers/libarchive/files/libarchive/archive_entry.c
index 69921c309f1..f734b8c4f51 100644
--- a/archivers/libarchive/files/libarchive/archive_entry.c
+++ b/archivers/libarchive/files/libarchive/archive_entry.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry.c 201096 2009-12-28 02:41:27Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -32,15 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:2
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef MAJOR_IN_MKDEV
+#if MAJOR_IN_MKDEV
#include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
+#define HAVE_MAJOR
+#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
-#endif
-#endif
-#ifdef HAVE_EXT2FS_EXT2_FS_H
-#include <ext2fs/ext2_fs.h> /* for Linux file flags */
+#define HAVE_MAJOR
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -48,9 +45,16 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:2
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h> /* for Linux file flags */
#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
#ifdef HAVE_LINUX_EXT2_FS_H
#include <linux/ext2_fs.h> /* for Linux file flags */
#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h> /* for Linux file flags */
+#endif
#include <stddef.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
@@ -71,6 +75,13 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:2
#undef max
#define max(a, b) ((a)>(b)?(a):(b))
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define major(x) ((int)(0x00ff & ((x) >> 8)))
+#define minor(x) ((int)(0xffff00ff & (x)))
+#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
+
/* Play games to come up with a suitable makedev() definition. */
#ifdef __QNXNTO__
/* QNX. <sigh> */
@@ -79,7 +90,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:2
#elif defined makedev
/* There's a "makedev" macro. */
#define ae_makedev(maj, min) makedev((maj), (min))
-#elif defined mkdev || defined _WIN32 || defined __WIN32__
+#elif defined mkdev || ((defined _WIN32 || defined __WIN32__) && !defined(__CYGWIN__))
/* Windows. <sigh> */
#define ae_makedev(maj, min) mkdev((maj), (min))
#else
@@ -111,6 +122,7 @@ static int acl_special(struct archive_entry *entry,
static struct ae_acl *acl_new_entry(struct archive_entry *entry,
int type, int permset, int tag, int id);
static int isint_w(const wchar_t *start, const wchar_t *end, int *result);
+static int ismode_w(const wchar_t *start, const wchar_t *end, int *result);
static void next_field_w(const wchar_t **wp, const wchar_t **start,
const wchar_t **end, wchar_t *sep);
static int prefix_w(const wchar_t *start, const wchar_t *end,
@@ -210,7 +222,7 @@ static const wchar_t *
aes_get_wcs(struct aes *aes)
{
wchar_t *w;
- int r;
+ size_t r;
/* Return WCS form if we already have it. */
if (aes->aes_set & AES_SET_WCS)
@@ -228,8 +240,8 @@ aes_get_wcs(struct aes *aes)
if (w == NULL)
__archive_errx(1, "No memory for aes_get_wcs()");
r = mbstowcs(w, aes->aes_mbs.s, wcs_length);
- w[wcs_length] = 0;
- if (r > 0) {
+ if (r != (size_t)-1 && r != 0) {
+ w[r] = 0;
aes->aes_set |= AES_SET_WCS;
return (aes->aes_wcs = w);
}
@@ -239,7 +251,8 @@ aes_get_wcs(struct aes *aes)
if (aes->aes_set & AES_SET_UTF8) {
/* Try converting UTF8 to WCS. */
aes->aes_wcs = __archive_string_utf8_w(&(aes->aes_utf8));
- aes->aes_set |= AES_SET_WCS;
+ if (aes->aes_wcs != NULL)
+ aes->aes_set |= AES_SET_WCS;
return (aes->aes_wcs);
}
return (NULL);
@@ -365,6 +378,7 @@ archive_entry_clear(struct archive_entry *entry)
aes_clean(&entry->ae_gname);
aes_clean(&entry->ae_hardlink);
aes_clean(&entry->ae_pathname);
+ aes_clean(&entry->ae_sourcepath);
aes_clean(&entry->ae_symlink);
aes_clean(&entry->ae_uname);
archive_entry_acl_clear(entry);
@@ -394,9 +408,9 @@ archive_entry_clone(struct archive_entry *entry)
aes_copy(&entry2->ae_gname, &entry->ae_gname);
aes_copy(&entry2->ae_hardlink, &entry->ae_hardlink);
aes_copy(&entry2->ae_pathname, &entry->ae_pathname);
+ aes_copy(&entry2->ae_sourcepath, &entry->ae_sourcepath);
aes_copy(&entry2->ae_symlink, &entry->ae_symlink);
- entry2->ae_hardlinkset = entry->ae_hardlinkset;
- entry2->ae_symlinkset = entry->ae_symlinkset;
+ entry2->ae_set = entry->ae_set;
aes_copy(&entry2->ae_uname, &entry->ae_uname);
/* Copy ACL data over. */
@@ -455,12 +469,42 @@ archive_entry_atime_nsec(struct archive_entry *entry)
return (entry->ae_stat.aest_atime_nsec);
}
+int
+archive_entry_atime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_ATIME);
+}
+
+time_t
+archive_entry_birthtime(struct archive_entry *entry)
+{
+ return (entry->ae_stat.aest_birthtime);
+}
+
+long
+archive_entry_birthtime_nsec(struct archive_entry *entry)
+{
+ return (entry->ae_stat.aest_birthtime_nsec);
+}
+
+int
+archive_entry_birthtime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_BIRTHTIME);
+}
+
time_t
archive_entry_ctime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ctime);
}
+int
+archive_entry_ctime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_CTIME);
+}
+
long
archive_entry_ctime_nsec(struct archive_entry *entry)
{
@@ -562,17 +606,17 @@ archive_entry_gname_w(struct archive_entry *entry)
const char *
archive_entry_hardlink(struct archive_entry *entry)
{
- if (!entry->ae_hardlinkset)
- return (NULL);
- return (aes_get_mbs(&entry->ae_hardlink));
+ if (entry->ae_set & AE_SET_HARDLINK)
+ return (aes_get_mbs(&entry->ae_hardlink));
+ return (NULL);
}
const wchar_t *
archive_entry_hardlink_w(struct archive_entry *entry)
{
- if (!entry->ae_hardlinkset)
- return (NULL);
- return (aes_get_wcs(&entry->ae_hardlink));
+ if (entry->ae_set & AE_SET_HARDLINK)
+ return (aes_get_wcs(&entry->ae_hardlink));
+ return (NULL);
}
ino_t
@@ -581,6 +625,12 @@ archive_entry_ino(struct archive_entry *entry)
return (entry->ae_stat.aest_ino);
}
+int64_t
+archive_entry_ino64(struct archive_entry *entry)
+{
+ return (entry->ae_stat.aest_ino);
+}
+
mode_t
archive_entry_mode(struct archive_entry *entry)
{
@@ -599,6 +649,12 @@ archive_entry_mtime_nsec(struct archive_entry *entry)
return (entry->ae_stat.aest_mtime_nsec);
}
+int
+archive_entry_mtime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_MTIME);
+}
+
unsigned int
archive_entry_nlink(struct archive_entry *entry)
{
@@ -651,6 +707,12 @@ archive_entry_size(struct archive_entry *entry)
return (entry->ae_stat.aest_size);
}
+int
+archive_entry_size_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_SIZE);
+}
+
const char *
archive_entry_sourcepath(struct archive_entry *entry)
{
@@ -660,17 +722,17 @@ archive_entry_sourcepath(struct archive_entry *entry)
const char *
archive_entry_symlink(struct archive_entry *entry)
{
- if (!entry->ae_symlinkset)
- return (NULL);
- return (aes_get_mbs(&entry->ae_symlink));
+ if (entry->ae_set & AE_SET_SYMLINK)
+ return (aes_get_mbs(&entry->ae_symlink));
+ return (NULL);
}
const wchar_t *
archive_entry_symlink_w(struct archive_entry *entry)
{
- if (!entry->ae_symlinkset)
- return (NULL);
- return (aes_get_wcs(&entry->ae_symlink));
+ if (entry->ae_set & AE_SET_SYMLINK)
+ return (aes_get_wcs(&entry->ae_symlink));
+ return (NULL);
}
uid_t
@@ -769,11 +831,20 @@ archive_entry_set_ino(struct archive_entry *entry, unsigned long ino)
}
void
+archive_entry_set_ino64(struct archive_entry *entry, int64_t ino)
+{
+ entry->stat_valid = 0;
+ entry->ae_stat.aest_ino = ino;
+}
+
+void
archive_entry_set_hardlink(struct archive_entry *entry, const char *target)
{
aes_set_mbs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
}
void
@@ -781,7 +852,9 @@ archive_entry_copy_hardlink(struct archive_entry *entry, const char *target)
{
aes_copy_mbs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
}
void
@@ -789,26 +862,70 @@ archive_entry_copy_hardlink_w(struct archive_entry *entry, const wchar_t *target
{
aes_copy_wcs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
+}
+
+int
+archive_entry_update_hardlink_utf8(struct archive_entry *entry, const char *target)
+{
+ if (target != NULL)
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
+ return (aes_update_utf8(&entry->ae_hardlink, target));
}
void
archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_ATIME;
entry->ae_stat.aest_atime = t;
entry->ae_stat.aest_atime_nsec = ns;
}
void
+archive_entry_unset_atime(struct archive_entry *entry)
+{
+ archive_entry_set_atime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_ATIME;
+}
+
+void
+archive_entry_set_birthtime(struct archive_entry *entry, time_t m, long ns)
+{
+ entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_BIRTHTIME;
+ entry->ae_stat.aest_birthtime = m;
+ entry->ae_stat.aest_birthtime_nsec = ns;
+}
+
+void
+archive_entry_unset_birthtime(struct archive_entry *entry)
+{
+ archive_entry_set_birthtime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_BIRTHTIME;
+}
+
+void
archive_entry_set_ctime(struct archive_entry *entry, time_t t, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_CTIME;
entry->ae_stat.aest_ctime = t;
entry->ae_stat.aest_ctime_nsec = ns;
}
void
+archive_entry_unset_ctime(struct archive_entry *entry)
+{
+ archive_entry_set_ctime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_CTIME;
+}
+
+void
archive_entry_set_dev(struct archive_entry *entry, dev_t d)
{
entry->stat_valid = 0;
@@ -836,7 +953,7 @@ archive_entry_set_devminor(struct archive_entry *entry, dev_t m)
void
archive_entry_set_link(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_set_mbs(&entry->ae_symlink, target);
else
aes_set_mbs(&entry->ae_hardlink, target);
@@ -846,7 +963,7 @@ archive_entry_set_link(struct archive_entry *entry, const char *target)
void
archive_entry_copy_link(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_copy_mbs(&entry->ae_symlink, target);
else
aes_copy_mbs(&entry->ae_hardlink, target);
@@ -856,7 +973,7 @@ archive_entry_copy_link(struct archive_entry *entry, const char *target)
void
archive_entry_copy_link_w(struct archive_entry *entry, const wchar_t *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_copy_wcs(&entry->ae_symlink, target);
else
aes_copy_wcs(&entry->ae_hardlink, target);
@@ -865,7 +982,7 @@ archive_entry_copy_link_w(struct archive_entry *entry, const wchar_t *target)
int
archive_entry_update_link_utf8(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
return (aes_update_utf8(&entry->ae_symlink, target));
else
return (aes_update_utf8(&entry->ae_hardlink, target));
@@ -882,11 +999,19 @@ void
archive_entry_set_mtime(struct archive_entry *entry, time_t m, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_MTIME;
entry->ae_stat.aest_mtime = m;
entry->ae_stat.aest_mtime_nsec = ns;
}
void
+archive_entry_unset_mtime(struct archive_entry *entry)
+{
+ archive_entry_set_mtime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_MTIME;
+}
+
+void
archive_entry_set_nlink(struct archive_entry *entry, unsigned int nlink)
{
entry->stat_valid = 0;
@@ -954,6 +1079,14 @@ archive_entry_set_size(struct archive_entry *entry, int64_t s)
{
entry->stat_valid = 0;
entry->ae_stat.aest_size = s;
+ entry->ae_set |= AE_SET_SIZE;
+}
+
+void
+archive_entry_unset_size(struct archive_entry *entry)
+{
+ archive_entry_set_size(entry, 0);
+ entry->ae_set &= ~AE_SET_SIZE;
}
void
@@ -967,7 +1100,9 @@ archive_entry_set_symlink(struct archive_entry *entry, const char *linkname)
{
aes_set_mbs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
}
void
@@ -975,7 +1110,9 @@ archive_entry_copy_symlink(struct archive_entry *entry, const char *linkname)
{
aes_copy_mbs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
}
void
@@ -983,7 +1120,19 @@ archive_entry_copy_symlink_w(struct archive_entry *entry, const wchar_t *linknam
{
aes_copy_wcs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
+}
+
+int
+archive_entry_update_symlink_utf8(struct archive_entry *entry, const char *linkname)
+{
+ if (linkname != NULL)
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
+ return (aes_update_utf8(&entry->ae_symlink, linkname));
}
void
@@ -1077,7 +1226,7 @@ archive_entry_acl_add_entry_w(struct archive_entry *entry,
archive_entry_acl_add_entry_w_len(entry, type, permset, tag, id, name, wcslen(name));
}
-void
+static void
archive_entry_acl_add_entry_w_len(struct archive_entry *entry,
int type, int permset, int tag, int id, const wchar_t *name, size_t len)
{
@@ -1130,7 +1279,7 @@ static struct ae_acl *
acl_new_entry(struct archive_entry *entry,
int type, int permset, int tag, int id)
{
- struct ae_acl *ap;
+ struct ae_acl *ap, *aq;
if (type != ARCHIVE_ENTRY_ACL_TYPE_ACCESS &&
type != ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
@@ -1143,20 +1292,26 @@ acl_new_entry(struct archive_entry *entry,
/* XXX TODO: More sanity-checks on the arguments XXX */
/* If there's a matching entry already in the list, overwrite it. */
- for (ap = entry->acl_head; ap != NULL; ap = ap->next) {
+ ap = entry->acl_head;
+ aq = NULL;
+ while (ap != NULL) {
if (ap->type == type && ap->tag == tag && ap->id == id) {
ap->permset = permset;
return (ap);
}
+ aq = ap;
+ ap = ap->next;
}
- /* Add a new entry to the list. */
+ /* Add a new entry to the end of the list. */
ap = (struct ae_acl *)malloc(sizeof(*ap));
if (ap == NULL)
return (NULL);
memset(ap, 0, sizeof(*ap));
- ap->next = entry->acl_head;
- entry->acl_head = ap;
+ if (aq == NULL)
+ entry->acl_head = ap;
+ else
+ aq->next = ap;
ap->type = type;
ap->tag = tag;
ap->id = id;
@@ -1478,11 +1633,10 @@ __archive_entry_acl_parse_w(struct archive_entry *entry,
struct {
const wchar_t *start;
const wchar_t *end;
- } field[4];
+ } field[4], name;
- int fields;
+ int fields, n;
int type, tag, permset, id;
- const wchar_t *p;
wchar_t sep;
while (text != NULL && *text != L'\0') {
@@ -1501,8 +1655,9 @@ __archive_entry_acl_parse_w(struct archive_entry *entry,
++fields;
} while (sep == L':');
- if (fields < 3)
- return (ARCHIVE_WARN);
+ /* Set remaining fields to blank. */
+ for (n = fields; n < 4; ++n)
+ field[n].start = field[n].end = NULL;
/* Check for a numeric ID in field 1 or 3. */
id = -1;
@@ -1511,54 +1666,58 @@ __archive_entry_acl_parse_w(struct archive_entry *entry,
if (id == -1 && fields > 3)
isint_w(field[3].start, field[3].end, &id);
- /* Parse the permissions from field 2. */
- permset = 0;
- p = field[2].start;
- while (p < field[2].end) {
- switch (*p++) {
- case 'r': case 'R':
- permset |= ARCHIVE_ENTRY_ACL_READ;
- break;
- case 'w': case 'W':
- permset |= ARCHIVE_ENTRY_ACL_WRITE;
- break;
- case 'x': case 'X':
- permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
- break;
- case '-':
- break;
- default:
- return (ARCHIVE_WARN);
- }
- }
-
/*
* Solaris extension: "defaultuser::rwx" is the
* default ACL corresponding to "user::rwx", etc.
*/
- if (field[0].end-field[0].start > 7
+ if (field[0].end - field[0].start > 7
&& wmemcmp(field[0].start, L"default", 7) == 0) {
type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
field[0].start += 7;
} else
type = default_type;
+ name.start = name.end = NULL;
if (prefix_w(field[0].start, field[0].end, L"user")) {
- if (id != -1 || field[1].start < field[1].end)
+ if (!ismode_w(field[2].start, field[2].end, &permset))
+ return (ARCHIVE_WARN);
+ if (id != -1 || field[1].start < field[1].end) {
tag = ARCHIVE_ENTRY_ACL_USER;
- else
+ name = field[1];
+ } else
tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
} else if (prefix_w(field[0].start, field[0].end, L"group")) {
- if (id != -1 || field[1].start < field[1].end)
+ if (!ismode_w(field[2].start, field[2].end, &permset))
+ return (ARCHIVE_WARN);
+ if (id != -1 || field[1].start < field[1].end) {
tag = ARCHIVE_ENTRY_ACL_GROUP;
- else
+ name = field[1];
+ } else
tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
} else if (prefix_w(field[0].start, field[0].end, L"other")) {
- if (id != -1 || field[1].start < field[1].end)
+ if (fields == 2
+ && field[1].start < field[1].end
+ && ismode_w(field[1].start, field[1].end, &permset)) {
+ /* This is Solaris-style "other:rwx" */
+ } else if (fields == 3
+ && field[1].start == field[1].end
+ && field[2].start < field[2].end
+ && ismode_w(field[2].start, field[2].end, &permset)) {
+ /* This is FreeBSD-style "other::rwx" */
+ } else
return (ARCHIVE_WARN);
tag = ARCHIVE_ENTRY_ACL_OTHER;
} else if (prefix_w(field[0].start, field[0].end, L"mask")) {
- if (id != -1 || field[1].start < field[1].end)
+ if (fields == 2
+ && field[1].start < field[1].end
+ && ismode_w(field[1].start, field[1].end, &permset)) {
+ /* This is Solaris-style "mask:rwx" */
+ } else if (fields == 3
+ && field[1].start == field[1].end
+ && field[2].start < field[2].end
+ && ismode_w(field[2].start, field[2].end, &permset)) {
+ /* This is FreeBSD-style "mask::rwx" */
+ } else
return (ARCHIVE_WARN);
tag = ARCHIVE_ENTRY_ACL_MASK;
} else
@@ -1566,104 +1725,12 @@ __archive_entry_acl_parse_w(struct archive_entry *entry,
/* Add entry to the internal list. */
archive_entry_acl_add_entry_w_len(entry, type, permset,
- tag, id, field[1].start, field[1].end - field[1].start);
+ tag, id, name.start, name.end - name.start);
}
return (ARCHIVE_OK);
}
/*
- * extended attribute handling
- */
-
-void
-archive_entry_xattr_clear(struct archive_entry *entry)
-{
- struct ae_xattr *xp;
-
- while (entry->xattr_head != NULL) {
- xp = entry->xattr_head->next;
- free(entry->xattr_head->name);
- free(entry->xattr_head->value);
- free(entry->xattr_head);
- entry->xattr_head = xp;
- }
-
- entry->xattr_head = NULL;
-}
-
-void
-archive_entry_xattr_add_entry(struct archive_entry *entry,
- const char *name, const void *value, size_t size)
-{
- struct ae_xattr *xp;
-
- for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
- ;
-
- if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL)
- /* XXX Error XXX */
- return;
-
- xp->name = strdup(name);
- if ((xp->value = malloc(size)) != NULL) {
- memcpy(xp->value, value, size);
- xp->size = size;
- } else
- xp->size = 0;
-
- xp->next = entry->xattr_head;
- entry->xattr_head = xp;
-}
-
-
-/*
- * returns number of the extended attribute entries
- */
-int
-archive_entry_xattr_count(struct archive_entry *entry)
-{
- struct ae_xattr *xp;
- int count = 0;
-
- for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
- count++;
-
- return count;
-}
-
-int
-archive_entry_xattr_reset(struct archive_entry * entry)
-{
- entry->xattr_p = entry->xattr_head;
-
- return archive_entry_xattr_count(entry);
-}
-
-int
-archive_entry_xattr_next(struct archive_entry * entry,
- const char **name, const void **value, size_t *size)
-{
- if (entry->xattr_p) {
- *name = entry->xattr_p->name;
- *value = entry->xattr_p->value;
- *size = entry->xattr_p->size;
-
- entry->xattr_p = entry->xattr_p->next;
-
- return (ARCHIVE_OK);
- } else {
- *name = NULL;
- *value = NULL;
- *size = (size_t)0;
- return (ARCHIVE_WARN);
- }
-}
-
-/*
- * end of xattr handling
- */
-
-/*
* Parse a string to a positive decimal integer. Returns true if
* the string is non-empty and consists only of decimal digits,
* false otherwise.
@@ -1690,6 +1757,40 @@ isint_w(const wchar_t *start, const wchar_t *end, int *result)
}
/*
+ * Parse a string as a mode field. Returns true if
+ * the string is non-empty and consists only of mode characters,
+ * false otherwise.
+ */
+static int
+ismode_w(const wchar_t *start, const wchar_t *end, int *permset)
+{
+ const wchar_t *p;
+
+ if (start >= end)
+ return (0);
+ p = start;
+ *permset = 0;
+ while (p < end) {
+ switch (*p++) {
+ case 'r': case 'R':
+ *permset |= ARCHIVE_ENTRY_ACL_READ;
+ break;
+ case 'w': case 'W':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE;
+ break;
+ case 'x': case 'X':
+ *permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ break;
+ case '-':
+ break;
+ default:
+ return (0);
+ }
+ }
+ return (1);
+}
+
+/*
* Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated
* to point to just after the separator. *start points to the first
* character of the matched text and *end just after the last
@@ -1841,6 +1942,18 @@ static struct flag {
{ "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 },
{ "nouunlink", L"nouunlink", UF_NOUNLINK, 0 },
#endif
+#ifdef EXT2_UNRM_FL
+ { "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0},
+#endif
+
+#ifdef EXT2_BTREE_FL
+ { "nobtree", L"nobtree", EXT2_BTREE_FL, 0 },
+#endif
+
+#ifdef EXT2_ECOMPR_FL
+ { "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 },
+#endif
+
#ifdef EXT2_COMPR_FL /* 'c' */
{ "nocompress", L"nocompress", EXT2_COMPR_FL, 0 },
#endif
@@ -1848,6 +1961,46 @@ static struct flag {
#ifdef EXT2_NOATIME_FL /* 'A' */
{ "noatime", L"noatime", 0, EXT2_NOATIME_FL},
#endif
+
+#ifdef EXT2_DIRTY_FL
+ { "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0},
+#endif
+
+#ifdef EXT2_COMPRBLK_FL
+#ifdef EXT2_NOCOMPR_FL
+ { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL},
+#else
+ { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, 0},
+#endif
+#endif
+#ifdef EXT2_DIRSYNC_FL
+ { "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
+#endif
+#ifdef EXT2_INDEX_FL
+ { "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0},
+#endif
+#ifdef EXT2_IMAGIC_FL
+ { "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0},
+#endif
+#ifdef EXT3_JOURNAL_DATA_FL
+ { "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
+#endif
+#ifdef EXT2_SECRM_FL
+ { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
+#endif
+#ifdef EXT2_SYNC_FL
+ { "nosync", L"nosync", EXT2_SYNC_FL, 0},
+#endif
+#ifdef EXT2_NOTAIL_FL
+ { "notail", L"notail", 0, EXT2_NOTAIL_FL},
+#endif
+#ifdef EXT2_TOPDIR_FL
+ { "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
+#endif
+#ifdef EXT2_RESERVED_FL
+ { "noreserved", L"noreserved", EXT2_RESERVED_FL, 0},
+#endif
+
{ NULL, NULL, 0, 0 }
};
diff --git a/archivers/libarchive/files/libarchive/archive_entry.h b/archivers/libarchive/files/libarchive/archive_entry.h
index ee96c56a79d..d5728179eb7 100644
--- a/archivers/libarchive/files/libarchive/archive_entry.h
+++ b/archivers/libarchive/files/libarchive/archive_entry.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.27 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_entry.h 201096 2009-12-28 02:41:27Z kientzle $
*/
#ifndef ARCHIVE_ENTRY_H_INCLUDED
@@ -40,15 +40,28 @@
#include <stddef.h> /* for wchar_t */
#include <time.h>
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
+
/* Get appropriate definitions of standard POSIX-style types. */
/* These should match the types used in 'struct stat' */
-#ifdef _WIN32
-#define __LA_UID_T unsigned int
-#define __LA_GID_T unsigned int
-#define __LA_DEV_T unsigned int
-#define __LA_MODE_T unsigned short
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define __LA_INT64_T __int64
+# if defined(__BORLANDC__)
+# define __LA_UID_T uid_t
+# define __LA_GID_T gid_t
+# define __LA_DEV_T dev_t
+# define __LA_MODE_T mode_t
+# else
+# define __LA_UID_T short
+# define __LA_GID_T short
+# define __LA_DEV_T unsigned int
+# define __LA_MODE_T unsigned short
+# endif
#else
#include <unistd.h>
+#define __LA_INT64_T int64_t
#define __LA_UID_T uid_t
#define __LA_GID_T gid_t
#define __LA_DEV_T dev_t
@@ -69,7 +82,7 @@
* .lib. The default here assumes you're building a DLL. Only
* libarchive source should ever define __LIBARCHIVE_BUILD.
*/
-#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC)
+#if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
# ifdef __LIBARCHIVE_BUILD
# ifdef __GNUC__
# define __LA_DECL __attribute__((dllexport)) extern
@@ -152,12 +165,32 @@ __LA_DECL struct archive_entry *archive_entry_new(void);
/*
* Retrieve fields from an archive_entry.
+ *
+ * There are a number of implicit conversions among these fields. For
+ * example, if a regular string field is set and you read the _w wide
+ * character field, the entry will implicitly convert narrow-to-wide
+ * using the current locale. Similarly, dev values are automatically
+ * updated when you write devmajor or devminor and vice versa.
+ *
+ * In addition, fields can be "set" or "unset." Unset string fields
+ * return NULL, non-string fields have _is_set() functions to test
+ * whether they've been set. You can "unset" a string field by
+ * assigning NULL; non-string fields have _unset() functions to
+ * unset them.
+ *
+ * Note: There is one ambiguity in the above; string fields will
+ * also return NULL when implicit character set conversions fail.
+ * This is usually what you want.
*/
-
__LA_DECL time_t archive_entry_atime(struct archive_entry *);
__LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
+__LA_DECL time_t archive_entry_birthtime(struct archive_entry *);
+__LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *);
__LA_DECL time_t archive_entry_ctime(struct archive_entry *);
__LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
__LA_DECL dev_t archive_entry_dev(struct archive_entry *);
__LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
@@ -172,9 +205,11 @@ __LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *);
__LA_DECL const char *archive_entry_hardlink(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *);
__LA_DECL __LA_INO_T archive_entry_ino(struct archive_entry *);
+__LA_DECL __LA_INT64_T archive_entry_ino64(struct archive_entry *);
__LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *);
__LA_DECL time_t archive_entry_mtime(struct archive_entry *);
__LA_DECL long archive_entry_mtime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_mtime_is_set(struct archive_entry *);
__LA_DECL unsigned int archive_entry_nlink(struct archive_entry *);
__LA_DECL const char *archive_entry_pathname(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
@@ -182,7 +217,8 @@ __LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
__LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
-__LA_DECL int64_t archive_entry_size(struct archive_entry *);
+__LA_DECL __LA_INT64_T archive_entry_size(struct archive_entry *);
+__LA_DECL int archive_entry_size_is_set(struct archive_entry *);
__LA_DECL const char *archive_entry_strmode(struct archive_entry *);
__LA_DECL const char *archive_entry_symlink(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
@@ -195,10 +231,22 @@ __LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *);
*
* Note that string 'set' functions do not copy the string, only the pointer.
* In contrast, 'copy' functions do copy the object pointed to.
+ *
+ * Note: As of libarchive 2.4, 'set' functions do copy the string and
+ * are therefore exact synonyms for the 'copy' versions. The 'copy'
+ * names will be retired in libarchive 3.0.
*/
__LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_atime(struct archive_entry *);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+__LA_DECL void archive_entry_copy_bhfi(struct archive_entry *,
+ BY_HANDLE_FILE_INFORMATION *);
+#endif
+__LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_birthtime(struct archive_entry *);
__LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
__LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
@@ -219,13 +267,21 @@ __LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char
__LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
+__LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *);
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+/* Starting with libarchive 3.0, this will be synonym for ino64. */
+__LA_DECL void archive_entry_set_ino(struct archive_entry *, __LA_INT64_T);
+#else
__LA_DECL void archive_entry_set_ino(struct archive_entry *, unsigned long);
+#endif
+__LA_DECL void archive_entry_set_ino64(struct archive_entry *, __LA_INT64_T);
__LA_DECL void archive_entry_set_link(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
__LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
__LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
__LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
__LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *);
@@ -235,11 +291,13 @@ __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
__LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
-__LA_DECL void archive_entry_set_size(struct archive_entry *, int64_t);
+__LA_DECL void archive_entry_set_size(struct archive_entry *, __LA_INT64_T);
+__LA_DECL void archive_entry_unset_size(struct archive_entry *);
__LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
+__LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_UID_T);
__LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *);
@@ -257,6 +315,7 @@ __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char
__LA_DECL const struct stat *archive_entry_stat(struct archive_entry *);
__LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
+
/*
* ACL routines. This used to simply store and return text-format ACL
* strings, but that proved insufficient for a number of reasons:
@@ -406,7 +465,7 @@ __LA_DECL int archive_entry_xattr_next(struct archive_entry *,
* Note that archive_entry_size() is reset to zero if the file
* body should not be written to the archive. Pay attention!
*/
-__LA_DECL struct archive_entry_linkresolver;
+struct archive_entry_linkresolver;
/*
* There are three different strategies for marking hardlinks.
diff --git a/archivers/libarchive/files/libarchive/archive_entry_copy_bhfi.c b/archivers/libarchive/files/libarchive/archive_entry_copy_bhfi.c
new file mode 100644
index 00000000000..8339032c5c3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_entry_copy_bhfi.c
@@ -0,0 +1,74 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD$");
+
+#include "archive_private.h"
+#include "archive_entry.h"
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
+
+__inline static void
+fileTimeToUtc(const FILETIME *filetime, time_t *time, long *ns)
+{
+ ULARGE_INTEGER utc;
+
+ utc.HighPart = filetime->dwHighDateTime;
+ utc.LowPart = filetime->dwLowDateTime;
+ if (utc.QuadPart >= EPOC_TIME) {
+ utc.QuadPart -= EPOC_TIME;
+ *time = (time_t)(utc.QuadPart / 10000000); /* milli seconds base */
+ *ns = (long)(utc.QuadPart % 10000000) * 100;/* nano seconds base */
+ } else {
+ *time = 0;
+ *ns = 0;
+ }
+}
+
+void
+archive_entry_copy_bhfi(struct archive_entry *entry,
+ BY_HANDLE_FILE_INFORMATION *bhfi)
+{
+ time_t secs;
+ long nsecs;
+
+ fileTimeToUtc(&bhfi->ftLastAccessTime, &secs, &nsecs);
+ archive_entry_set_atime(entry, secs, nsecs);
+ fileTimeToUtc(&bhfi->ftLastWriteTime, &secs, &nsecs);
+ archive_entry_set_mtime(entry, secs, nsecs);
+ fileTimeToUtc(&bhfi->ftCreationTime, &secs, &nsecs);
+ archive_entry_set_birthtime(entry, secs, nsecs);
+ archive_entry_set_dev(entry, bhfi->dwVolumeSerialNumber);
+ archive_entry_set_ino64(entry, (((int64_t)bhfi->nFileIndexHigh) << 32)
+ + bhfi->nFileIndexLow);
+ archive_entry_set_nlink(entry, bhfi->nNumberOfLinks);
+ archive_entry_set_size(entry, (((int64_t)bhfi->nFileSizeHigh) << 32)
+ + bhfi->nFileSizeLow);
+// archive_entry_set_mode(entry, st->st_mode);
+}
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_entry_copy_stat.c b/archivers/libarchive/files/libarchive/archive_entry_copy_stat.c
index 514db02743b..ef59a5e78a0 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_copy_stat.c
+++ b/archivers/libarchive/files/libarchive/archive_entry_copy_stat.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_copy_stat.c,v 1.1 2007/05/29 01:00:18 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_copy_stat.c 189466 2009-03-07 00:52:02Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -43,10 +43,28 @@ archive_entry_copy_stat(struct archive_entry *entry, const struct stat *st)
archive_entry_set_atime(entry, st->st_atime, st->st_atim.tv_nsec);
archive_entry_set_ctime(entry, st->st_ctime, st->st_ctim.tv_nsec);
archive_entry_set_mtime(entry, st->st_mtime, st->st_mtim.tv_nsec);
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+ archive_entry_set_atime(entry, st->st_atime, st->st_atime_n);
+ archive_entry_set_ctime(entry, st->st_ctime, st->st_ctime_n);
+ archive_entry_set_mtime(entry, st->st_mtime, st->st_mtime_n);
+#elif HAVE_STRUCT_STAT_ST_UMTIME
+ archive_entry_set_atime(entry, st->st_atime, st->st_uatime * 1000);
+ archive_entry_set_ctime(entry, st->st_ctime, st->st_uctime * 1000);
+ archive_entry_set_mtime(entry, st->st_mtime, st->st_umtime * 1000);
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+ archive_entry_set_atime(entry, st->st_atime, st->st_atime_usec * 1000);
+ archive_entry_set_ctime(entry, st->st_ctime, st->st_ctime_usec * 1000);
+ archive_entry_set_mtime(entry, st->st_mtime, st->st_mtime_usec * 1000);
#else
archive_entry_set_atime(entry, st->st_atime, 0);
archive_entry_set_ctime(entry, st->st_ctime, 0);
archive_entry_set_mtime(entry, st->st_mtime, 0);
+#if HAVE_STRUCT_STAT_ST_BIRTHTIME
+ archive_entry_set_birthtime(entry, st->st_birthtime, 0);
+#endif
+#endif
+#if HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+ archive_entry_set_birthtime(entry, st->st_birthtime, st->st_birthtimespec.tv_nsec);
#endif
archive_entry_set_dev(entry, st->st_dev);
archive_entry_set_gid(entry, st->st_gid);
diff --git a/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c b/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
index 4deee260d49..3b13e19c8bf 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
+++ b/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.3 2008/06/15 04:31:43 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_link_resolver.c 201100 2009-12-28 03:05:31Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -181,15 +181,17 @@ archive_entry_linkify(struct archive_entry_linkresolver *res,
/* If it has only one link, then we're done. */
if (archive_entry_nlink(*e) == 1)
return;
- /* Directories never have hardlinks. */
- if (archive_entry_filetype(*e) == AE_IFDIR)
+ /* Directories, devices never have hardlinks. */
+ if (archive_entry_filetype(*e) == AE_IFDIR
+ || archive_entry_filetype(*e) == AE_IFBLK
+ || archive_entry_filetype(*e) == AE_IFCHR)
return;
switch (res->strategy) {
case ARCHIVE_ENTRY_LINKIFY_LIKE_TAR:
le = find_entry(res, *e);
if (le != NULL) {
- archive_entry_set_size(*e, 0);
+ archive_entry_unset_size(*e);
archive_entry_copy_hardlink(*e,
archive_entry_pathname(le->canonical));
} else
@@ -217,7 +219,7 @@ archive_entry_linkify(struct archive_entry_linkresolver *res,
*e = le->entry;
le->entry = t;
/* Make the old entry into a hardlink. */
- archive_entry_set_size(*e, 0);
+ archive_entry_unset_size(*e);
archive_entry_copy_hardlink(*e,
archive_entry_pathname(le->canonical));
/* If we ran out of links, return the
@@ -249,7 +251,7 @@ find_entry(struct archive_entry_linkresolver *res,
struct links_entry *le;
int hash, bucket;
dev_t dev;
- ino_t ino;
+ int64_t ino;
/* Free a held entry. */
if (res->spare != NULL) {
@@ -264,15 +266,15 @@ find_entry(struct archive_entry_linkresolver *res,
return (NULL);
dev = archive_entry_dev(entry);
- ino = archive_entry_ino(entry);
- hash = dev ^ ino;
+ ino = archive_entry_ino64(entry);
+ hash = (int)(dev ^ ino);
/* Try to locate this entry in the links cache. */
bucket = hash % res->number_buckets;
for (le = res->buckets[bucket]; le != NULL; le = le->next) {
if (le->hash == hash
&& dev == archive_entry_dev(le->canonical)
- && ino == archive_entry_ino(le->canonical)) {
+ && ino == archive_entry_ino64(le->canonical)) {
/*
* Decrement link count each time and release
* the entry if it hits zero. This saves
@@ -350,7 +352,7 @@ insert_entry(struct archive_entry_linkresolver *res,
if (res->number_entries > res->number_buckets * 2)
grow_hash(res);
- hash = archive_entry_dev(entry) ^ archive_entry_ino(entry);
+ hash = archive_entry_dev(entry) ^ archive_entry_ino64(entry);
bucket = hash % res->number_buckets;
/* If we could allocate the entry, record it. */
diff --git a/archivers/libarchive/files/libarchive/archive_entry_private.h b/archivers/libarchive/files/libarchive/archive_entry_private.h
index 0289290b198..5ab4f75f0bc 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_private.h
+++ b/archivers/libarchive/files/libarchive/archive_entry_private.h
@@ -22,9 +22,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_entry_private.h,v 1.4 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_entry_private.h 201096 2009-12-28 02:41:27Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
#define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
@@ -112,8 +116,10 @@ struct archive_entry {
uint32_t aest_ctime_nsec;
int64_t aest_mtime;
uint32_t aest_mtime_nsec;
+ int64_t aest_birthtime;
+ uint32_t aest_birthtime_nsec;
gid_t aest_gid;
- ino_t aest_ino;
+ int64_t aest_ino;
mode_t aest_mode;
uint32_t aest_nlink;
uint64_t aest_size;
@@ -136,6 +142,15 @@ struct archive_entry {
dev_t aest_rdevminor;
} ae_stat;
+ int ae_set; /* bitmap of fields that are currently set */
+#define AE_SET_HARDLINK 1
+#define AE_SET_SYMLINK 2
+#define AE_SET_ATIME 4
+#define AE_SET_CTIME 8
+#define AE_SET_MTIME 16
+#define AE_SET_BIRTHTIME 32
+#define AE_SET_SIZE 64
+
/*
* Use aes here so that we get transparent mbs<->wcs conversions.
*/
@@ -147,8 +162,6 @@ struct archive_entry {
struct aes ae_pathname; /* Name of entry */
struct aes ae_symlink; /* symlink contents */
struct aes ae_uname; /* Name of owner */
- unsigned char ae_hardlinkset;
- unsigned char ae_symlinkset;
/* Not used within libarchive; useful for some clients. */
struct aes ae_sourcepath; /* Path this entry is sourced from. */
diff --git a/archivers/libarchive/files/libarchive/archive_entry_stat.c b/archivers/libarchive/files/libarchive/archive_entry_stat.c
index 6ef5b37287f..ad772c9564b 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_stat.c
+++ b/archivers/libarchive/files/libarchive/archive_entry_stat.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_stat.c,v 1.1 2007/05/29 01:00:18 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_stat.c 201100 2009-12-28 03:05:31Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -64,12 +64,15 @@ archive_entry_stat(struct archive_entry *entry)
* the appropriate conversions get invoked.
*/
st->st_atime = archive_entry_atime(entry);
+#if HAVE_STRUCT_STAT_ST_BIRTHTIME
+ st->st_birthtime = archive_entry_birthtime(entry);
+#endif
st->st_ctime = archive_entry_ctime(entry);
st->st_mtime = archive_entry_mtime(entry);
st->st_dev = archive_entry_dev(entry);
st->st_gid = archive_entry_gid(entry);
st->st_uid = archive_entry_uid(entry);
- st->st_ino = archive_entry_ino(entry);
+ st->st_ino = archive_entry_ino64(entry);
st->st_nlink = archive_entry_nlink(entry);
st->st_rdev = archive_entry_rdev(entry);
st->st_size = archive_entry_size(entry);
@@ -87,6 +90,21 @@ archive_entry_stat(struct archive_entry *entry)
st->st_atim.tv_nsec = archive_entry_atime_nsec(entry);
st->st_ctim.tv_nsec = archive_entry_ctime_nsec(entry);
st->st_mtim.tv_nsec = archive_entry_mtime_nsec(entry);
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+ st->st_atime_n = archive_entry_atime_nsec(entry);
+ st->st_ctime_n = archive_entry_ctime_nsec(entry);
+ st->st_mtime_n = archive_entry_mtime_nsec(entry);
+#elif HAVE_STRUCT_STAT_ST_UMTIME
+ st->st_uatime = archive_entry_atime_nsec(entry) / 1000;
+ st->st_uctime = archive_entry_ctime_nsec(entry) / 1000;
+ st->st_umtime = archive_entry_mtime_nsec(entry) / 1000;
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+ st->st_atime_usec = archive_entry_atime_nsec(entry) / 1000;
+ st->st_ctime_usec = archive_entry_ctime_nsec(entry) / 1000;
+ st->st_mtime_usec = archive_entry_mtime_nsec(entry) / 1000;
+#endif
+#if HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+ st->st_birthtimespec.tv_nsec = archive_entry_birthtime_nsec(entry);
#endif
/*
diff --git a/archivers/libarchive/files/libarchive/archive_entry_xattr.c b/archivers/libarchive/files/libarchive/archive_entry_xattr.c
new file mode 100644
index 00000000000..a3efe7ca8d9
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_entry_xattr.c
@@ -0,0 +1,158 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_xattr.c 201096 2009-12-28 02:41:27Z kientzle $");
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h> /* for Linux file flags */
+#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h> /* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h> /* for Linux file flags */
+#endif
+#include <stddef.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+
+#include "archive.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_entry_private.h"
+
+/*
+ * extended attribute handling
+ */
+
+void
+archive_entry_xattr_clear(struct archive_entry *entry)
+{
+ struct ae_xattr *xp;
+
+ while (entry->xattr_head != NULL) {
+ xp = entry->xattr_head->next;
+ free(entry->xattr_head->name);
+ free(entry->xattr_head->value);
+ free(entry->xattr_head);
+ entry->xattr_head = xp;
+ }
+
+ entry->xattr_head = NULL;
+}
+
+void
+archive_entry_xattr_add_entry(struct archive_entry *entry,
+ const char *name, const void *value, size_t size)
+{
+ struct ae_xattr *xp;
+
+ for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
+ ;
+
+ if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL)
+ /* XXX Error XXX */
+ return;
+
+ xp->name = strdup(name);
+ if ((xp->value = malloc(size)) != NULL) {
+ memcpy(xp->value, value, size);
+ xp->size = size;
+ } else
+ xp->size = 0;
+
+ xp->next = entry->xattr_head;
+ entry->xattr_head = xp;
+}
+
+
+/*
+ * returns number of the extended attribute entries
+ */
+int
+archive_entry_xattr_count(struct archive_entry *entry)
+{
+ struct ae_xattr *xp;
+ int count = 0;
+
+ for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
+ count++;
+
+ return count;
+}
+
+int
+archive_entry_xattr_reset(struct archive_entry * entry)
+{
+ entry->xattr_p = entry->xattr_head;
+
+ return archive_entry_xattr_count(entry);
+}
+
+int
+archive_entry_xattr_next(struct archive_entry * entry,
+ const char **name, const void **value, size_t *size)
+{
+ if (entry->xattr_p) {
+ *name = entry->xattr_p->name;
+ *value = entry->xattr_p->value;
+ *size = entry->xattr_p->size;
+
+ entry->xattr_p = entry->xattr_p->next;
+
+ return (ARCHIVE_OK);
+ } else {
+ *name = NULL;
+ *value = NULL;
+ *size = (size_t)0;
+ return (ARCHIVE_WARN);
+ }
+}
+
+/*
+ * end of xattr handling
+ */
diff --git a/archivers/libarchive/files/libarchive/archive_hash.h b/archivers/libarchive/files/libarchive/archive_hash.h
new file mode 100644
index 00000000000..1a3b3344dc8
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_hash.h
@@ -0,0 +1,196 @@
+/*-
+ * Copyright (c) 2009 Joerg Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: head/lib/libarchive/archive_hash.h 201171 2009-12-29 06:39:07Z kientzle $
+ */
+
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
+/*
+ * Hash function support in various Operating Systems:
+ *
+ * NetBSD:
+ * - MD5 and SHA1 in libc: without _ after algorithm name
+ * - SHA2 in libc: with _ after algorithm name
+ *
+ * OpenBSD:
+ * - MD5, SHA1 and SHA2 in libc: without _ after algorithm name
+ * - OpenBSD 4.4 and earlier have SHA2 in libc with _ after algorithm name
+ *
+ * DragonFly and FreeBSD (XXX not used yet):
+ * - MD5 and SHA1 in libmd: without _ after algorithm name
+ * - SHA256: with _ after algorithm name
+ *
+ * OpenSSL:
+ * - MD5, SHA1 and SHA2 in libcrypto: with _ after algorithm name
+ */
+
+#if defined(HAVE_MD5_H) && defined(HAVE_MD5INIT)
+# include <md5.h>
+# define ARCHIVE_HAS_MD5
+typedef MD5_CTX archive_md5_ctx;
+# define archive_md5_init(ctx) MD5Init(ctx)
+# define archive_md5_final(ctx, buf) MD5Final(buf, ctx)
+# define archive_md5_update(ctx, buf, n) MD5Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_MD5_H)
+# include <openssl/md5.h>
+# define ARCHIVE_HAS_MD5
+typedef MD5_CTX archive_md5_ctx;
+# define archive_md5_init(ctx) MD5_Init(ctx)
+# define archive_md5_final(ctx, buf) MD5_Final(buf, ctx)
+# define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_MD5)
+# define ARCHIVE_HAS_MD5
+typedef MD5_CTX archive_md5_ctx;
+# define archive_md5_init(ctx) MD5_Init(ctx)
+# define archive_md5_final(ctx, buf) MD5_Final(buf, ctx)
+# define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n)
+#endif
+
+#if defined(HAVE_RMD160_H) && defined(HAVE_RMD160INIT)
+# include <rmd160.h>
+# define ARCHIVE_HAS_RMD160
+typedef RMD160_CTX archive_rmd160_ctx;
+# define archive_rmd160_init(ctx) RMD160Init(ctx)
+# define archive_rmd160_final(ctx, buf) RMD160Final(buf, ctx)
+# define archive_rmd160_update(ctx, buf, n) RMD160Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_RIPEMD_H)
+# include <openssl/ripemd.h>
+# define ARCHIVE_HAS_RMD160
+typedef RIPEMD160_CTX archive_rmd160_ctx;
+# define archive_rmd160_init(ctx) RIPEMD160_Init(ctx)
+# define archive_rmd160_final(ctx, buf) RIPEMD160_Final(buf, ctx)
+# define archive_rmd160_update(ctx, buf, n) RIPEMD160_Update(ctx, buf, n)
+#endif
+
+#if defined(HAVE_SHA1_H) && defined(HAVE_SHA1INIT)
+# include <sha1.h>
+# define ARCHIVE_HAS_SHA1
+typedef SHA1_CTX archive_sha1_ctx;
+# define archive_sha1_init(ctx) SHA1Init(ctx)
+# define archive_sha1_final(ctx, buf) SHA1Final(buf, ctx)
+# define archive_sha1_update(ctx, buf, n) SHA1Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_SHA_H)
+# include <openssl/sha.h>
+# define ARCHIVE_HAS_SHA1
+typedef SHA_CTX archive_sha1_ctx;
+# define archive_sha1_init(ctx) SHA1_Init(ctx)
+# define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx)
+# define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA1)
+# define ARCHIVE_HAS_SHA1
+typedef SHA1_CTX archive_sha1_ctx;
+# define archive_sha1_init(ctx) SHA1_Init(ctx)
+# define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx)
+# define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n)
+#endif
+
+#if defined(HAVE_SHA2_H) && defined(HAVE_SHA256_INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA256
+typedef SHA256_CTX archive_sha256_ctx;
+# define archive_sha256_init(ctx) SHA256_Init(ctx)
+# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx)
+# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n)
+#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA256INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA256
+typedef SHA256_CTX archive_sha256_ctx;
+# define archive_sha256_init(ctx) SHA256Init(ctx)
+# define archive_sha256_final(ctx, buf) SHA256Final(buf, ctx)
+# define archive_sha256_update(ctx, buf, n) SHA256Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA256_INIT)
+# include <openssl/sha.h>
+# define ARCHIVE_HAS_SHA256
+typedef SHA256_CTX archive_sha256_ctx;
+# define archive_sha256_init(ctx) SHA256_Init(ctx)
+# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx)
+# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_256)
+# define ARCHIVE_HAS_SHA256
+typedef SHA256_CTX archive_sha256_ctx;
+# define archive_sha256_init(ctx) SHA256_Init(ctx)
+# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx)
+# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n)
+#endif
+
+#if defined(HAVE_SHA2_H) && defined(HAVE_SHA384_INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA384
+typedef SHA384_CTX archive_sha384_ctx;
+# define archive_sha384_init(ctx) SHA384_Init(ctx)
+# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx)
+# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n)
+#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA384INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA384
+typedef SHA384_CTX archive_sha384_ctx;
+# define archive_sha384_init(ctx) SHA384Init(ctx)
+# define archive_sha384_final(ctx, buf) SHA384Final(buf, ctx)
+# define archive_sha384_update(ctx, buf, n) SHA384Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA384_INIT)
+# include <openssl/sha.h>
+# define ARCHIVE_HAS_SHA384
+typedef SHA512_CTX archive_sha384_ctx;
+# define archive_sha384_init(ctx) SHA384_Init(ctx)
+# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx)
+# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_384)
+# define ARCHIVE_HAS_SHA384
+typedef SHA512_CTX archive_sha384_ctx;
+# define archive_sha384_init(ctx) SHA384_Init(ctx)
+# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx)
+# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n)
+#endif
+
+#if defined(HAVE_SHA2_H) && defined(HAVE_SHA512_INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA512
+typedef SHA512_CTX archive_sha512_ctx;
+# define archive_sha512_init(ctx) SHA512_Init(ctx)
+# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx)
+# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n)
+#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA512INIT)
+# include <sha2.h>
+# define ARCHIVE_HAS_SHA512
+typedef SHA512_CTX archive_sha512_ctx;
+# define archive_sha512_init(ctx) SHA512Init(ctx)
+# define archive_sha512_final(ctx, buf) SHA512Final(buf, ctx)
+# define archive_sha512_update(ctx, buf, n) SHA512Update(ctx, buf, n)
+#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA512_INIT)
+# include <openssl/sha.h>
+# define ARCHIVE_HAS_SHA512
+typedef SHA512_CTX archive_sha512_ctx;
+# define archive_sha512_init(ctx) SHA512_Init(ctx)
+# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx)
+# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_512)
+# define ARCHIVE_HAS_SHA512
+typedef SHA512_CTX archive_sha512_ctx;
+# define archive_sha512_init(ctx) SHA512_Init(ctx)
+# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx)
+# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n)
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_platform.h b/archivers/libarchive/files/libarchive/archive_platform.h
index 99dfacc50f5..ce2f482ba04 100644
--- a/archivers/libarchive/files/libarchive/archive_platform.h
+++ b/archivers/libarchive/files/libarchive/archive_platform.h
@@ -22,9 +22,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.30 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_platform.h 201090 2009-12-28 02:22:04Z kientzle $
*/
+/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
+
/*
* This header is the first thing included in any of the libarchive
* source files. As far as possible, platform-specific issues should
@@ -39,45 +41,76 @@
/* archive.h and archive_entry.h require this. */
#define __LIBARCHIVE_BUILD 1
-#ifdef _WIN32
-#include "config_windows.h"
-#include "archive_windows.h"
-#elif defined(PLATFORM_CONFIG_H)
+#if defined(PLATFORM_CONFIG_H)
/* Use hand-built config.h in environments that need it. */
#include PLATFORM_CONFIG_H
#elif defined(HAVE_CONFIG_H)
/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../config.h"
+#include "config.h"
#else
/* Warn if the library hasn't been (automatically or manually) configured. */
#error Oops: No config.h and no pre-built configuration in archive_platform.h.
#endif
+/* It should be possible to get rid of this by extending the feature-test
+ * macros to cover Windows API functions, probably along with non-trivial
+ * refactoring of code to find structures that sit more cleanly on top of
+ * either Windows or Posix APIs. */
+#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
+#include "archive_windows.h"
+#endif
+
/*
* The config files define a lot of feature macros. The following
* uses those macros to select/define replacements and include key
* headers as required.
*/
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
-#else
-/* Just leaving this macro replacement empty leads to a dangling semicolon. */
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
#define __FBSDID(a) struct _undefined_hack
#endif
/* Try to get standard C99-style integer type definitions. */
#if HAVE_INTTYPES_H
#include <inttypes.h>
-#elif HAVE_STDINT_H
+#endif
+#if HAVE_STDINT_H
#include <stdint.h>
#endif
+/* Borland warns about its own constants! */
+#if defined(__BORLANDC__)
+# if HAVE_DECL_UINT64_MAX
+# undef UINT64_MAX
+# undef HAVE_DECL_UINT64_MAX
+# endif
+# if HAVE_DECL_UINT64_MIN
+# undef UINT64_MIN
+# undef HAVE_DECL_UINT64_MIN
+# endif
+# if HAVE_DECL_INT64_MAX
+# undef INT64_MAX
+# undef HAVE_DECL_INT64_MAX
+# endif
+# if HAVE_DECL_INT64_MIN
+# undef INT64_MIN
+# undef HAVE_DECL_INT64_MIN
+# endif
+#endif
+
/* Some platforms lack the standard *_MAX definitions. */
#if !HAVE_DECL_SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
+#if !HAVE_DECL_SSIZE_MAX
+#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
+#endif
#if !HAVE_DECL_UINT32_MAX
#define UINT32_MAX (~(uint32_t)0)
#endif
diff --git a/archivers/libarchive/files/libarchive/archive_private.h b/archivers/libarchive/files/libarchive/archive_private.h
index 9ca5893d80a..63384b82fed 100644
--- a/archivers/libarchive/files/libarchive/archive_private.h
+++ b/archivers/libarchive/files/libarchive/archive_private.h
@@ -22,31 +22,43 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_private.h,v 1.29 2007/04/02 00:15:45 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_private.h 201098 2009-12-28 02:58:14Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_PRIVATE_H_INCLUDED
#define ARCHIVE_PRIVATE_H_INCLUDED
#include "archive.h"
#include "archive_string.h"
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_DEAD __attribute__((__noreturn__))
+#else
+#define __LA_DEAD
+#endif
+
#define ARCHIVE_WRITE_MAGIC (0xb0c5c0deU)
#define ARCHIVE_READ_MAGIC (0xdeb0c5U)
-#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
+#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
+#define ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
#define ARCHIVE_STATE_ANY 0xFFFFU
#define ARCHIVE_STATE_NEW 1U
#define ARCHIVE_STATE_HEADER 2U
#define ARCHIVE_STATE_DATA 4U
-#define ARCHIVE_STATE_DATA_END 8U
+#define ARCHIVE_STATE_DATA_END 8U
#define ARCHIVE_STATE_EOF 0x10U
#define ARCHIVE_STATE_CLOSED 0x20U
#define ARCHIVE_STATE_FATAL 0x8000U
struct archive_vtable {
- int (*archive_write_close)(struct archive *);
- int (*archive_write_finish)(struct archive *);
+ int (*archive_close)(struct archive *);
+ int (*archive_finish)(struct archive *);
int (*archive_write_header)(struct archive *,
struct archive_entry *);
int (*archive_write_finish_entry)(struct archive *);
@@ -79,9 +91,11 @@ struct archive {
const char *compression_name;
/* Position in UNCOMPRESSED data stream. */
- off_t file_position;
+ int64_t file_position;
/* Position in COMPRESSED data stream. */
- off_t raw_position;
+ int64_t raw_position;
+ /* Number of file entries processed. */
+ int file_count;
int archive_error_number;
const char *error;
@@ -92,8 +106,19 @@ struct archive {
void __archive_check_magic(struct archive *, unsigned int magic,
unsigned int state, const char *func);
-void __archive_errx(int retvalue, const char *msg);
+void __archive_errx(int retvalue, const char *msg) __LA_DEAD;
+
+int __archive_parse_options(const char *p, const char *fn,
+ int keysize, char *key, int valsize, char *val);
#define err_combine(a,b) ((a) < (b) ? (a) : (b))
+#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300)
+# define ARCHIVE_LITERAL_LL(x) x##i64
+# define ARCHIVE_LITERAL_ULL(x) x##ui64
+#else
+# define ARCHIVE_LITERAL_LL(x) x##ll
+# define ARCHIVE_LITERAL_ULL(x) x##ull
+#endif
+
#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read.3 b/archivers/libarchive/files/libarchive/archive_read.3
index 13063d917c7..43f3c76327a 100644
--- a/archivers/libarchive/files/libarchive/archive_read.3
+++ b/archivers/libarchive/files/libarchive/archive_read.3
@@ -22,23 +22,32 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/archive_read.3,v 1.37 2008/05/26 17:00:22 kientzle Exp $
+.\" $FreeBSD: head/lib/libarchive/archive_read.3 191595 2009-04-27 20:13:13Z kientzle $
.\"
-.Dd August 19, 2006
+.Dd April 13, 2009
.Dt archive_read 3
.Os
.Sh NAME
.Nm archive_read_new ,
+.Nm archive_read_set_filter_options ,
+.Nm archive_read_set_format_options ,
+.Nm archive_read_set_options ,
.Nm archive_read_support_compression_all ,
.Nm archive_read_support_compression_bzip2 ,
.Nm archive_read_support_compression_compress ,
.Nm archive_read_support_compression_gzip ,
+.Nm archive_read_support_compression_lzma ,
.Nm archive_read_support_compression_none ,
+.Nm archive_read_support_compression_xz ,
.Nm archive_read_support_compression_program ,
+.Nm archive_read_support_compression_program_signature ,
.Nm archive_read_support_format_all ,
+.Nm archive_read_support_format_ar ,
.Nm archive_read_support_format_cpio ,
.Nm archive_read_support_format_empty ,
.Nm archive_read_support_format_iso9660 ,
+.Nm archive_read_support_format_mtree,
+.Nm archive_read_support_format_raw,
.Nm archive_read_support_format_tar ,
.Nm archive_read_support_format_zip ,
.Nm archive_read_open ,
@@ -48,6 +57,7 @@
.Nm archive_read_open_filename ,
.Nm archive_read_open_memory ,
.Nm archive_read_next_header ,
+.Nm archive_read_next_header2 ,
.Nm archive_read_data ,
.Nm archive_read_data_block ,
.Nm archive_read_data_skip ,
@@ -74,25 +84,48 @@
.Ft int
.Fn archive_read_support_compression_gzip "struct archive *"
.Ft int
+.Fn archive_read_support_compression_lzma "struct archive *"
+.Ft int
.Fn archive_read_support_compression_none "struct archive *"
.Ft int
+.Fn archive_read_support_compression_xz "struct archive *"
+.Ft int
.Fo archive_read_support_compression_program
.Fa "struct archive *"
.Fa "const char *cmd"
.Fc
.Ft int
+.Fo archive_read_support_compression_program_signature
+.Fa "struct archive *"
+.Fa "const char *cmd"
+.Fa "const void *signature"
+.Fa "size_t signature_length"
+.Fc
+.Ft int
.Fn archive_read_support_format_all "struct archive *"
.Ft int
+.Fn archive_read_support_format_ar "struct archive *"
+.Ft int
.Fn archive_read_support_format_cpio "struct archive *"
.Ft int
.Fn archive_read_support_format_empty "struct archive *"
.Ft int
.Fn archive_read_support_format_iso9660 "struct archive *"
.Ft int
+.Fn archive_read_support_format_mtree "struct archive *"
+.Ft int
+.Fn archive_read_support_format_raw "struct archive *"
+.Ft int
.Fn archive_read_support_format_tar "struct archive *"
.Ft int
.Fn archive_read_support_format_zip "struct archive *"
.Ft int
+.Fn archive_read_set_filter_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_read_set_format_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_read_set_options "struct archive *" "const char *"
+.Ft int
.Fo archive_read_open
.Fa "struct archive *"
.Fa "void *client_data"
@@ -123,6 +156,8 @@
.Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size"
.Ft int
.Fn archive_read_next_header "struct archive *" "struct archive_entry **"
+.Ft int
+.Fn archive_read_next_header2 "struct archive *" "struct archive_entry *"
.Ft ssize_t
.Fn archive_read_data "struct archive *" "void *buff" "size_t len"
.Ft int
@@ -177,30 +212,43 @@ Allocates and initializes a
.Tn struct archive
object suitable for reading from an archive.
.It Xo
-.Fn archive_read_support_compression_all ,
.Fn archive_read_support_compression_bzip2 ,
.Fn archive_read_support_compression_compress ,
.Fn archive_read_support_compression_gzip ,
-.Fn archive_read_support_compression_none
+.Fn archive_read_support_compression_lzma ,
+.Fn archive_read_support_compression_none ,
+.Fn archive_read_support_compression_xz
.Xc
Enables auto-detection code and decompression support for the
specified compression.
+Returns
+.Cm ARCHIVE_OK
+if the compression is fully supported, or
+.Cm ARCHIVE_WARN
+if the compression is supported only through an external program.
+Note that decompression using an external program is usually slower than
+decompression through built-in libraries.
Note that
.Dq none
is always enabled by default.
-For convenience,
-.Fn archive_read_support_compression_all
-enables all available decompression code.
+.It Fn archive_read_support_compression_all
+Enables all available decompression filters.
.It Fn archive_read_support_compression_program
Data is fed through the specified external program before being dearchived.
Note that this disables automatic detection of the compression format,
so it makes no sense to specify this in conjunction with any other
decompression option.
+.It Fn archive_read_support_compression_program_signature
+This feeds data through the specified external program
+but only if the initial bytes of the data match the specified
+signature value.
.It Xo
.Fn archive_read_support_format_all ,
+.Fn archive_read_support_format_ar ,
.Fn archive_read_support_format_cpio ,
.Fn archive_read_support_format_empty ,
.Fn archive_read_support_format_iso9660 ,
+.Fn archive_read_support_format_mtree ,
.Fn archive_read_support_format_tar ,
.Fn archive_read_support_format_zip
.Xc
@@ -214,6 +262,59 @@ For convenience,
.Fn archive_read_support_format_all
enables support for all available formats.
Only empty archives are supported by default.
+.It Fn archive_read_support_format_raw
+The
+.Dq raw
+format handler allows libarchive to be used to read arbitrary data.
+It treats any data stream as an archive with a single entry.
+The pathname of this entry is
+.Dq data ;
+all other entry fields are unset.
+This is not enabled by
+.Fn archive_read_support_format_all
+in order to avoid erroneous handling of damaged archives.
+.It Xo
+.Fn archive_read_set_filter_options ,
+.Fn archive_read_set_format_options ,
+.Fn archive_read_set_options
+.Xc
+Specifies options that will be passed to currently-registered
+filters (including decompression filters) and/or format readers.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar option=value
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.It Ar option
+The option will be provided to every module with a value of
+.Dq 1 .
+.It Ar !option
+The option will be provided to every module with a NULL value.
+.It Ar module:option=value , Ar module:option , Ar module:!option
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The return value will be
+.Cm ARCHIVE_OK
+if any module accepts the option, or
+.Cm ARCHIVE_WARN
+if no module accepted the option, or
+.Cm ARCHIVE_FATAL
+if there was a fatal error while attempting to process the option.
+.Pp
+The currently supported options are:
+.Bl -tag -compact -width indent
+.It Format iso9660
+.Bl -tag -compact -width indent
+.It Cm joliet
+Support Joliet extensions.
+Defaults to enabled, use
+.Cm !joliet
+to disable.
+.El
+.El
.It Fn archive_read_open
The same as
.Fn archive_read_open2 ,
@@ -266,6 +367,14 @@ memory containing the archive data.
Read the header for the next entry and return a pointer to
a
.Tn struct archive_entry .
+This is a convenience wrapper around
+.Fn archive_read_next_header2
+that reuses an internal
+.Tn struct archive_entry
+object for each request.
+.It Fn archive_read_next_header2
+Read the header for the next entry and populate the provided
+.Tn struct archive_entry .
.It Fn archive_read_data
Read data associated with the header just read.
Internally, this is a convenience function that calls
diff --git a/archivers/libarchive/files/libarchive/archive_read.c b/archivers/libarchive/files/libarchive/archive_read.c
index 327969f4185..f39f5cec29d 100644
--- a/archivers/libarchive/files/libarchive/archive_read.c
+++ b/archivers/libarchive/files/libarchive/archive_read.c
@@ -32,7 +32,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.38 2008/03/12 04:58:32 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read.c 201157 2009-12-29 05:30:23Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -53,9 +53,27 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.38 2008/03/12 04:58:32
#include "archive_private.h"
#include "archive_read_private.h"
-static void choose_decompressor(struct archive_read *, const void*, size_t);
+#define minimum(a, b) (a < b ? a : b)
+
+static int build_stream(struct archive_read *);
static int choose_format(struct archive_read *);
-static off_t dummy_skip(struct archive_read *, off_t);
+static int cleanup_filters(struct archive_read *);
+static struct archive_vtable *archive_read_vtable(void);
+static int _archive_read_close(struct archive *);
+static int _archive_read_finish(struct archive *);
+
+static struct archive_vtable *
+archive_read_vtable(void)
+{
+ static struct archive_vtable av;
+ static int inited = 0;
+
+ if (!inited) {
+ av.archive_finish = _archive_read_finish;
+ av.archive_close = _archive_read_close;
+ }
+ return (&av);
+}
/*
* Allocate, initialize and return a struct archive object.
@@ -73,9 +91,7 @@ archive_read_new(void)
a->archive.state = ARCHIVE_STATE_NEW;
a->entry = archive_entry_new();
-
- /* We always support uncompressed archives. */
- archive_read_support_compression_none(&a->archive);
+ a->archive.vtable = archive_read_vtable();
return (&a->archive);
}
@@ -93,6 +109,121 @@ archive_read_extract_set_skip_file(struct archive *_a, dev_t d, ino_t i)
a->skip_file_ino = i;
}
+/*
+ * Set read options for the format.
+ */
+int
+archive_read_set_format_options(struct archive *_a, const char *s)
+{
+ struct archive_read *a;
+ struct archive_format_descriptor *format;
+ char key[64], val[64];
+ char *valp;
+ size_t i;
+ int len, r;
+
+ __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
+ "archive_read_set_format_options");
+
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
+ a = (struct archive_read *)_a;
+ __archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
+ ARCHIVE_STATE_NEW, "archive_read_set_format_options");
+ len = 0;
+ for (i = 0; i < sizeof(a->formats)/sizeof(a->formats[0]); i++) {
+ format = &a->formats[i];
+ if (format == NULL || format->options == NULL ||
+ format->name == NULL)
+ /* This format does not support option. */
+ continue;
+
+ while ((len = __archive_parse_options(s, format->name,
+ sizeof(key), key, sizeof(val), val)) > 0) {
+ valp = val[0] == '\0' ? NULL : val;
+ a->format = format;
+ r = format->options(a, key, valp);
+ a->format = NULL;
+ if (r == ARCHIVE_FATAL)
+ return (r);
+ s += len;
+ }
+ }
+ if (len < 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Illegal format options.");
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Set read options for the filter.
+ */
+int
+archive_read_set_filter_options(struct archive *_a, const char *s)
+{
+ struct archive_read *a;
+ struct archive_read_filter *filter;
+ struct archive_read_filter_bidder *bidder;
+ char key[64], val[64];
+ int len, r;
+
+ __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
+ "archive_read_set_filter_options");
+
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
+ a = (struct archive_read *)_a;
+ __archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
+ ARCHIVE_STATE_NEW, "archive_read_set_filter_options");
+ len = 0;
+ for (filter = a->filter; filter != NULL; filter = filter->upstream) {
+ bidder = filter->bidder;
+ if (bidder == NULL)
+ continue;
+ if (bidder->options == NULL)
+ /* This bidder does not support option */
+ continue;
+ while ((len = __archive_parse_options(s, filter->name,
+ sizeof(key), key, sizeof(val), val)) > 0) {
+ if (val[0] == '\0')
+ r = bidder->options(bidder, key, NULL);
+ else
+ r = bidder->options(bidder, key, val);
+ if (r == ARCHIVE_FATAL)
+ return (r);
+ s += len;
+ }
+ }
+ if (len < 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Illegal format options.");
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Set read options for the format and the filter.
+ */
+int
+archive_read_set_options(struct archive *_a, const char *s)
+{
+ int r;
+
+ __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
+ "archive_read_set_options");
+ archive_clear_error(_a);
+
+ r = archive_read_set_format_options(_a, s);
+ if (r != ARCHIVE_OK)
+ return (r);
+ r = archive_read_set_filter_options(_a, s);
+ if (r != ARCHIVE_OK)
+ return (r);
+ return (ARCHIVE_OK);
+}
/*
* Open the archive
@@ -108,6 +239,54 @@ archive_read_open(struct archive *a, void *client_data,
client_reader, NULL, client_closer);
}
+static ssize_t
+client_read_proxy(struct archive_read_filter *self, const void **buff)
+{
+ ssize_t r;
+ r = (self->archive->client.reader)(&self->archive->archive,
+ self->data, buff);
+ self->archive->archive.raw_position += r;
+ return (r);
+}
+
+static int64_t
+client_skip_proxy(struct archive_read_filter *self, int64_t request)
+{
+ int64_t ask, get, total;
+ /* Limit our maximum seek request to 1GB on platforms
+ * with 32-bit off_t (such as Windows). */
+ int64_t skip_limit = ((int64_t)1) << (sizeof(off_t) * 8 - 2);
+
+ if (self->archive->client.skipper == NULL)
+ return (0);
+ total = 0;
+ for (;;) {
+ ask = request;
+ if (ask > skip_limit)
+ ask = skip_limit;
+ get = (self->archive->client.skipper)(&self->archive->archive,
+ self->data, ask);
+ if (get == 0)
+ return (total);
+ request -= get;
+ self->archive->archive.raw_position += get;
+ total += get;
+ }
+}
+
+static int
+client_close_proxy(struct archive_read_filter *self)
+{
+ int r = ARCHIVE_OK;
+
+ if (self->archive->client.closer != NULL)
+ r = (self->archive->client.closer)((struct archive *)self->archive,
+ self->data);
+ self->data = NULL;
+ return (r);
+}
+
+
int
archive_read_open2(struct archive *_a, void *client_data,
archive_open_callback *client_opener,
@@ -116,28 +295,17 @@ archive_read_open2(struct archive *_a, void *client_data,
archive_close_callback *client_closer)
{
struct archive_read *a = (struct archive_read *)_a;
- const void *buffer;
- ssize_t bytes_read;
+ struct archive_read_filter *filter;
int e;
- __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open");
+ __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
+ "archive_read_open");
+ archive_clear_error(&a->archive);
if (client_reader == NULL)
__archive_errx(1,
"No reader function provided to archive_read_open");
- /*
- * Set these NULL initially. If the open or initial read fails,
- * we'll leave them NULL to indicate that the file is invalid.
- * (In particular, this helps ensure that the closer doesn't
- * get called more than once.)
- */
- a->client_opener = NULL;
- a->client_reader = NULL;
- a->client_skipper = NULL;
- a->client_closer = NULL;
- a->client_data = NULL;
-
/* Open data source. */
if (client_opener != NULL) {
e =(client_opener)(&a->archive, client_data);
@@ -149,147 +317,107 @@ archive_read_open2(struct archive *_a, void *client_data,
}
}
- /* Read first block now for compress format detection. */
- bytes_read = (client_reader)(&a->archive, client_data, &buffer);
+ /* Save the client functions and mock up the initial source. */
+ a->client.reader = client_reader;
+ a->client.skipper = client_skipper;
+ a->client.closer = client_closer;
- if (bytes_read < 0) {
- /* If the first read fails, close before returning error. */
- if (client_closer)
- (client_closer)(&a->archive, client_data);
- /* client_reader should have already set error information. */
+ filter = calloc(1, sizeof(*filter));
+ if (filter == NULL)
return (ARCHIVE_FATAL);
- }
-
- /* Now that the client callbacks have worked, remember them. */
- a->client_opener = client_opener; /* Do we need to remember this? */
- a->client_reader = client_reader;
- a->client_skipper = client_skipper;
- a->client_closer = client_closer;
- a->client_data = client_data;
-
- /* Select a decompression routine. */
- choose_decompressor(a, buffer, (size_t)bytes_read);
- if (a->decompressor == NULL)
- return (ARCHIVE_FATAL);
-
- /* Initialize decompression routine with the first block of data. */
- e = (a->decompressor->init)(a, buffer, (size_t)bytes_read);
-
+ filter->bidder = NULL;
+ filter->upstream = NULL;
+ filter->archive = a;
+ filter->data = client_data;
+ filter->read = client_read_proxy;
+ filter->skip = client_skip_proxy;
+ filter->close = client_close_proxy;
+ filter->name = "none";
+ filter->code = ARCHIVE_COMPRESSION_NONE;
+ a->filter = filter;
+
+ /* Build out the input pipeline. */
+ e = build_stream(a);
if (e == ARCHIVE_OK)
a->archive.state = ARCHIVE_STATE_HEADER;
- /*
- * If the decompressor didn't register a skip function, provide a
- * dummy compression-layer skip function.
- */
- if (a->decompressor->skip == NULL)
- a->decompressor->skip = dummy_skip;
-
return (e);
}
/*
- * Allow each registered decompression routine to bid on whether it
- * wants to handle this stream. Return index of winning bidder.
+ * Allow each registered stream transform to bid on whether
+ * it wants to handle this stream. Repeat until we've finished
+ * building the pipeline.
*/
-static void
-choose_decompressor(struct archive_read *a,
- const void *buffer, size_t bytes_read)
+static int
+build_stream(struct archive_read *a)
{
- int decompression_slots, i, bid, best_bid;
- struct decompressor_t *decompressor, *best_decompressor;
+ int number_bidders, i, bid, best_bid;
+ struct archive_read_filter_bidder *bidder, *best_bidder;
+ struct archive_read_filter *filter;
+ ssize_t avail;
+ int r;
- decompression_slots = sizeof(a->decompressors) /
- sizeof(a->decompressors[0]);
+ for (;;) {
+ number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
- best_bid = 0;
- a->decompressor = NULL;
- best_decompressor = NULL;
+ best_bid = 0;
+ best_bidder = NULL;
- decompressor = a->decompressors;
- for (i = 0; i < decompression_slots; i++) {
- if (decompressor->bid) {
- bid = (decompressor->bid)(buffer, bytes_read);
- if (bid > best_bid || best_decompressor == NULL) {
- best_bid = bid;
- best_decompressor = decompressor;
+ bidder = a->bidders;
+ for (i = 0; i < number_bidders; i++, bidder++) {
+ if (bidder->bid != NULL) {
+ bid = (bidder->bid)(bidder, a->filter);
+ if (bid > best_bid) {
+ best_bid = bid;
+ best_bidder = bidder;
+ }
}
}
- decompressor ++;
- }
-
- /*
- * There were no bidders; this is a serious programmer error
- * and demands a quick and definitive abort.
- */
- if (best_decompressor == NULL)
- __archive_errx(1, "No decompressors were registered; you "
- "must call at least one "
- "archive_read_support_compression_XXX function in order "
- "to successfully read an archive.");
-
- /*
- * There were bidders, but no non-zero bids; this means we can't
- * support this stream.
- */
- if (best_bid < 1) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
- "Unrecognized archive format");
- return;
- }
-
- /* Record the best decompressor for this stream. */
- a->decompressor = best_decompressor;
-}
-/*
- * Dummy skip function, for use if the compression layer doesn't provide
- * one: This code just reads data and discards it.
- */
-static off_t
-dummy_skip(struct archive_read * a, off_t request)
-{
- const void * dummy_buffer;
- ssize_t bytes_read;
- off_t bytes_skipped;
+ /* If no bidder, we're done. */
+ if (best_bidder == NULL) {
+ a->archive.compression_name = a->filter->name;
+ a->archive.compression_code = a->filter->code;
+ return (ARCHIVE_OK);
+ }
- for (bytes_skipped = 0; request > 0;) {
- bytes_read = (a->decompressor->read_ahead)(a, &dummy_buffer, 1);
- if (bytes_read < 0)
- return (bytes_read);
- if (bytes_read == 0) {
- /* Premature EOF. */
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Truncated input file (need to skip %jd bytes)",
- (intmax_t)request);
+ filter
+ = (struct archive_read_filter *)calloc(1, sizeof(*filter));
+ if (filter == NULL)
+ return (ARCHIVE_FATAL);
+ filter->bidder = best_bidder;
+ filter->archive = a;
+ filter->upstream = a->filter;
+ r = (best_bidder->init)(filter);
+ if (r != ARCHIVE_OK) {
+ free(filter);
+ return (r);
+ }
+ a->filter = filter;
+ /* Verify the filter by asking it for some data. */
+ __archive_read_filter_ahead(filter, 1, &avail);
+ if (avail < 0) {
+ cleanup_filters(a);
return (ARCHIVE_FATAL);
}
- if (bytes_read > request)
- bytes_read = (ssize_t)request;
- (a->decompressor->consume)(a, (size_t)bytes_read);
- request -= bytes_read;
- bytes_skipped += bytes_read;
}
-
- return (bytes_skipped);
}
/*
* Read header of next entry.
*/
int
-archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
+archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
{
struct archive_read *a = (struct archive_read *)_a;
- struct archive_entry *entry;
int slot, ret;
__archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
"archive_read_next_header");
- *entryp = NULL;
- entry = a->entry;
+ ++_a->file_count;
archive_entry_clear(entry);
archive_clear_error(&a->archive);
@@ -347,12 +475,22 @@ archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
break;
}
- *entryp = entry;
a->read_data_output_offset = 0;
a->read_data_remaining = 0;
return (ret);
}
+int
+archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
+{
+ int ret;
+ struct archive_read *a = (struct archive_read *)_a;
+ *entryp = NULL;
+ ret = archive_read_next_header2(_a, a->entry);
+ *entryp = a->entry;
+ return ret;
+}
+
/*
* Allow each registered format to bid on whether it wants to handle
* the next entry. Return index of winning bidder.
@@ -581,8 +719,8 @@ archive_read_data_block(struct archive *_a,
* Don't assume we actually read anything or performed any non-trivial
* initialization.
*/
-int
-archive_read_close(struct archive *_a)
+static int
+_archive_read_close(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
int r = ARCHIVE_OK, r1 = ARCHIVE_OK;
@@ -590,44 +728,58 @@ archive_read_close(struct archive *_a)
__archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_ANY, "archive_read_close");
+ archive_clear_error(&a->archive);
a->archive.state = ARCHIVE_STATE_CLOSED;
+
/* Call cleanup functions registered by optional components. */
if (a->cleanup_archive_extract != NULL)
r = (a->cleanup_archive_extract)(a);
/* TODO: Clean up the formatters. */
- /* Clean up the decompressors. */
- n = sizeof(a->decompressors)/sizeof(a->decompressors[0]);
+ /* Release the filter objects. */
+ r1 = cleanup_filters(a);
+ if (r1 < r)
+ r = r1;
+
+ /* Release the bidder objects. */
+ n = sizeof(a->bidders)/sizeof(a->bidders[0]);
for (i = 0; i < n; i++) {
- if (a->decompressors[i].finish != NULL) {
- r1 = (a->decompressors[i].finish)(a);
+ if (a->bidders[i].free != NULL) {
+ r1 = (a->bidders[i].free)(&a->bidders[i]);
if (r1 < r)
r = r1;
}
}
- /* Close the client stream. */
- if (a->client_closer != NULL) {
- r1 = ((a->client_closer)(&a->archive, a->client_data));
- if (r1 < r)
- r = r1;
- }
-
return (r);
}
+static int
+cleanup_filters(struct archive_read *a)
+{
+ int r = ARCHIVE_OK;
+ /* Clean up the filter pipeline. */
+ while (a->filter != NULL) {
+ struct archive_read_filter *t = a->filter->upstream;
+ if (a->filter->close != NULL) {
+ int r1 = (a->filter->close)(a->filter);
+ if (r1 < r)
+ r = r1;
+ }
+ free(a->filter->buffer);
+ free(a->filter);
+ a->filter = t;
+ }
+ return r;
+}
+
/*
* Release memory and other resources.
*/
-#if ARCHIVE_API_VERSION > 1
-int
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
-void
-#endif
-archive_read_finish(struct archive *_a)
+static int
+_archive_read_finish(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
int i;
@@ -664,7 +816,9 @@ archive_read_finish(struct archive *_a)
int
__archive_read_register_format(struct archive_read *a,
void *format_data,
+ const char *name,
int (*bid)(struct archive_read *),
+ int (*options)(struct archive_read *, const char *, const char *),
int (*read_header)(struct archive_read *, struct archive_entry *),
int (*read_data)(struct archive_read *, const void **, size_t *, off_t *),
int (*read_data_skip)(struct archive_read *),
@@ -683,11 +837,13 @@ __archive_read_register_format(struct archive_read *a,
return (ARCHIVE_WARN); /* We've already installed */
if (a->formats[i].bid == NULL) {
a->formats[i].bid = bid;
+ a->formats[i].options = options;
a->formats[i].read_header = read_header;
a->formats[i].read_data = read_data;
a->formats[i].read_data_skip = read_data_skip;
a->formats[i].cleanup = cleanup;
a->formats[i].data = format_data;
+ a->formats[i].name = name;
return (ARCHIVE_OK);
}
}
@@ -700,26 +856,21 @@ __archive_read_register_format(struct archive_read *a,
* Used internally by decompression routines to register their bid and
* initialization functions.
*/
-struct decompressor_t *
-__archive_read_register_compression(struct archive_read *a,
- int (*bid)(const void *, size_t),
- int (*init)(struct archive_read *, const void *, size_t))
+struct archive_read_filter_bidder *
+__archive_read_get_bidder(struct archive_read *a)
{
int i, number_slots;
__archive_check_magic(&a->archive,
ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
- "__archive_read_register_compression");
+ "__archive_read_get_bidder");
- number_slots = sizeof(a->decompressors) / sizeof(a->decompressors[0]);
+ number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
for (i = 0; i < number_slots; i++) {
- if (a->decompressors[i].bid == bid)
- return (a->decompressors + i);
- if (a->decompressors[i].bid == NULL) {
- a->decompressors[i].bid = bid;
- a->decompressors[i].init = init;
- return (a->decompressors + i);
+ if (a->bidders[i].bid == NULL) {
+ memset(a->bidders + i, 0, sizeof(a->bidders[0]));
+ return (a->bidders + i);
}
}
@@ -727,13 +878,372 @@ __archive_read_register_compression(struct archive_read *a,
return (NULL); /* Never actually executed. */
}
-/* used internally to simplify read-ahead */
+/*
+ * The next three functions comprise the peek/consume internal I/O
+ * system used by archive format readers. This system allows fairly
+ * flexible read-ahead and allows the I/O code to operate in a
+ * zero-copy manner most of the time.
+ *
+ * In the ideal case, filters generate blocks of data
+ * and __archive_read_ahead() just returns pointers directly into
+ * those blocks. Then __archive_read_consume() just bumps those
+ * pointers. Only if your request would span blocks does the I/O
+ * layer use a copy buffer to provide you with a contiguous block of
+ * data. The __archive_read_skip() is an optimization; it scans ahead
+ * very quickly (it usually translates into a seek() operation if
+ * you're reading uncompressed disk files).
+ *
+ * A couple of useful idioms:
+ * * "I just want some data." Ask for 1 byte and pay attention to
+ * the "number of bytes available" from __archive_read_ahead().
+ * You can consume more than you asked for; you just can't consume
+ * more than is available. If you consume everything that's
+ * immediately available, the next read_ahead() call will pull
+ * the next block.
+ * * "I want to output a large block of data." As above, ask for 1 byte,
+ * emit all that's available (up to whatever limit you have), then
+ * repeat until you're done.
+ * * "I want to peek ahead by a large amount." Ask for 4k or so, then
+ * double and repeat until you get an error or have enough. Note
+ * that the I/O layer will likely end up expanding its copy buffer
+ * to fit your request, so use this technique cautiously. This
+ * technique is used, for example, by some of the format tasting
+ * code that has uncertain look-ahead needs.
+ *
+ * TODO: Someday, provide a more generic __archive_read_seek() for
+ * those cases where it's useful. This is tricky because there are lots
+ * of cases where seek() is not available (reading gzip data from a
+ * network socket, for instance), so there needs to be a good way to
+ * communicate whether seek() is available and users of that interface
+ * need to use non-seeking strategies whenever seek() is not available.
+ */
+
+/*
+ * Looks ahead in the input stream:
+ * * If 'avail' pointer is provided, that returns number of bytes available
+ * in the current buffer, which may be much larger than requested.
+ * * If end-of-file, *avail gets set to zero.
+ * * If error, *avail gets error code.
+ * * If request can be met, returns pointer to data, returns NULL
+ * if request is not met.
+ *
+ * Note: If you just want "some data", ask for 1 byte and pay attention
+ * to *avail, which will have the actual amount available. If you
+ * know exactly how many bytes you need, just ask for that and treat
+ * a NULL return as an error.
+ *
+ * Important: This does NOT move the file pointer. See
+ * __archive_read_consume() below.
+ */
+
+/*
+ * This is tricky. We need to provide our clients with pointers to
+ * contiguous blocks of memory but we want to avoid copying whenever
+ * possible.
+ *
+ * Mostly, this code returns pointers directly into the block of data
+ * provided by the client_read routine. It can do this unless the
+ * request would split across blocks. In that case, we have to copy
+ * into an internal buffer to combine reads.
+ */
+const void *
+__archive_read_ahead(struct archive_read *a, size_t min, ssize_t *avail)
+{
+ return (__archive_read_filter_ahead(a->filter, min, avail));
+}
+
const void *
-__archive_read_ahead(struct archive_read *a, size_t len)
+__archive_read_filter_ahead(struct archive_read_filter *filter,
+ size_t min, ssize_t *avail)
{
- const void *h;
+ ssize_t bytes_read;
+ size_t tocopy;
- if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len)
+ if (filter->fatal) {
+ if (avail)
+ *avail = ARCHIVE_FATAL;
return (NULL);
- return (h);
+ }
+
+ /*
+ * Keep pulling more data until we can satisfy the request.
+ */
+ for (;;) {
+
+ /*
+ * If we can satisfy from the copy buffer (and the
+ * copy buffer isn't empty), we're done. In particular,
+ * note that min == 0 is a perfectly well-defined
+ * request.
+ */
+ if (filter->avail >= min && filter->avail > 0) {
+ if (avail != NULL)
+ *avail = filter->avail;
+ return (filter->next);
+ }
+
+ /*
+ * We can satisfy directly from client buffer if everything
+ * currently in the copy buffer is still in the client buffer.
+ */
+ if (filter->client_total >= filter->client_avail + filter->avail
+ && filter->client_avail + filter->avail >= min) {
+ /* "Roll back" to client buffer. */
+ filter->client_avail += filter->avail;
+ filter->client_next -= filter->avail;
+ /* Copy buffer is now empty. */
+ filter->avail = 0;
+ filter->next = filter->buffer;
+ /* Return data from client buffer. */
+ if (avail != NULL)
+ *avail = filter->client_avail;
+ return (filter->client_next);
+ }
+
+ /* Move data forward in copy buffer if necessary. */
+ if (filter->next > filter->buffer &&
+ filter->next + min > filter->buffer + filter->buffer_size) {
+ if (filter->avail > 0)
+ memmove(filter->buffer, filter->next, filter->avail);
+ filter->next = filter->buffer;
+ }
+
+ /* If we've used up the client data, get more. */
+ if (filter->client_avail <= 0) {
+ if (filter->end_of_file) {
+ if (avail != NULL)
+ *avail = 0;
+ return (NULL);
+ }
+ bytes_read = (filter->read)(filter,
+ &filter->client_buff);
+ if (bytes_read < 0) { /* Read error. */
+ filter->client_total = filter->client_avail = 0;
+ filter->client_next = filter->client_buff = NULL;
+ filter->fatal = 1;
+ if (avail != NULL)
+ *avail = ARCHIVE_FATAL;
+ return (NULL);
+ }
+ if (bytes_read == 0) { /* Premature end-of-file. */
+ filter->client_total = filter->client_avail = 0;
+ filter->client_next = filter->client_buff = NULL;
+ filter->end_of_file = 1;
+ /* Return whatever we do have. */
+ if (avail != NULL)
+ *avail = filter->avail;
+ return (NULL);
+ }
+ filter->position += bytes_read;
+ filter->client_total = bytes_read;
+ filter->client_avail = filter->client_total;
+ filter->client_next = filter->client_buff;
+ }
+ else
+ {
+ /*
+ * We can't satisfy the request from the copy
+ * buffer or the existing client data, so we
+ * need to copy more client data over to the
+ * copy buffer.
+ */
+
+ /* Ensure the buffer is big enough. */
+ if (min > filter->buffer_size) {
+ size_t s, t;
+ char *p;
+
+ /* Double the buffer; watch for overflow. */
+ s = t = filter->buffer_size;
+ if (s == 0)
+ s = min;
+ while (s < min) {
+ t *= 2;
+ if (t <= s) { /* Integer overflow! */
+ archive_set_error(
+ &filter->archive->archive,
+ ENOMEM,
+ "Unable to allocate copy buffer");
+ filter->fatal = 1;
+ if (avail != NULL)
+ *avail = ARCHIVE_FATAL;
+ return (NULL);
+ }
+ s = t;
+ }
+ /* Now s >= min, so allocate a new buffer. */
+ p = (char *)malloc(s);
+ if (p == NULL) {
+ archive_set_error(
+ &filter->archive->archive,
+ ENOMEM,
+ "Unable to allocate copy buffer");
+ filter->fatal = 1;
+ if (avail != NULL)
+ *avail = ARCHIVE_FATAL;
+ return (NULL);
+ }
+ /* Move data into newly-enlarged buffer. */
+ if (filter->avail > 0)
+ memmove(p, filter->next, filter->avail);
+ free(filter->buffer);
+ filter->next = filter->buffer = p;
+ filter->buffer_size = s;
+ }
+
+ /* We can add client data to copy buffer. */
+ /* First estimate: copy to fill rest of buffer. */
+ tocopy = (filter->buffer + filter->buffer_size)
+ - (filter->next + filter->avail);
+ /* Don't waste time buffering more than we need to. */
+ if (tocopy + filter->avail > min)
+ tocopy = min - filter->avail;
+ /* Don't copy more than is available. */
+ if (tocopy > filter->client_avail)
+ tocopy = filter->client_avail;
+
+ memcpy(filter->next + filter->avail, filter->client_next,
+ tocopy);
+ /* Remove this data from client buffer. */
+ filter->client_next += tocopy;
+ filter->client_avail -= tocopy;
+ /* add it to copy buffer. */
+ filter->avail += tocopy;
+ }
+ }
+}
+
+/*
+ * Move the file pointer forward. This should be called after
+ * __archive_read_ahead() returns data to you. Don't try to move
+ * ahead by more than the amount of data available according to
+ * __archive_read_ahead().
+ */
+/*
+ * Mark the appropriate data as used. Note that the request here will
+ * often be much smaller than the size of the previous read_ahead
+ * request.
+ */
+ssize_t
+__archive_read_consume(struct archive_read *a, size_t request)
+{
+ ssize_t r;
+ r = __archive_read_filter_consume(a->filter, request);
+ a->archive.file_position += r;
+ return (r);
+}
+
+ssize_t
+__archive_read_filter_consume(struct archive_read_filter * filter,
+ size_t request)
+{
+ if (filter->avail > 0) {
+ /* Read came from copy buffer. */
+ filter->next += request;
+ filter->avail -= request;
+ } else {
+ /* Read came from client buffer. */
+ filter->client_next += request;
+ filter->client_avail -= request;
+ }
+ return (request);
+}
+
+/*
+ * Move the file pointer ahead by an arbitrary amount. If you're
+ * reading uncompressed data from a disk file, this will actually
+ * translate into a seek() operation. Even in cases where seek()
+ * isn't feasible, this at least pushes the read-and-discard loop
+ * down closer to the data source.
+ */
+int64_t
+__archive_read_skip(struct archive_read *a, int64_t request)
+{
+ int64_t skipped = __archive_read_skip_lenient(a, request);
+ if (skipped == request)
+ return (skipped);
+ /* We hit EOF before we satisfied the skip request. */
+ if (skipped < 0) // Map error code to 0 for error message below.
+ skipped = 0;
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Truncated input file (needed %jd bytes, only %jd available)",
+ (intmax_t)request, (intmax_t)skipped);
+ return (ARCHIVE_FATAL);
+}
+
+int64_t
+__archive_read_skip_lenient(struct archive_read *a, int64_t request)
+{
+ int64_t skipped = __archive_read_filter_skip(a->filter, request);
+ if (skipped > 0)
+ a->archive.file_position += skipped;
+ return (skipped);
+}
+
+int64_t
+__archive_read_filter_skip(struct archive_read_filter *filter, int64_t request)
+{
+ int64_t bytes_skipped, total_bytes_skipped = 0;
+ size_t min;
+
+ if (filter->fatal)
+ return (-1);
+ /*
+ * If there is data in the buffers already, use that first.
+ */
+ if (filter->avail > 0) {
+ min = minimum(request, (off_t)filter->avail);
+ bytes_skipped = __archive_read_filter_consume(filter, min);
+ request -= bytes_skipped;
+ total_bytes_skipped += bytes_skipped;
+ }
+ if (filter->client_avail > 0) {
+ min = minimum(request, (int64_t)filter->client_avail);
+ bytes_skipped = __archive_read_filter_consume(filter, min);
+ request -= bytes_skipped;
+ total_bytes_skipped += bytes_skipped;
+ }
+ if (request == 0)
+ return (total_bytes_skipped);
+ /*
+ * If a client_skipper was provided, try that first.
+ */
+#if ARCHIVE_API_VERSION < 2
+ if ((filter->skip != NULL) && (request < SSIZE_MAX)) {
+#else
+ if (filter->skip != NULL) {
+#endif
+ bytes_skipped = (filter->skip)(filter, request);
+ if (bytes_skipped < 0) { /* error */
+ filter->client_total = filter->client_avail = 0;
+ filter->client_next = filter->client_buff = NULL;
+ filter->fatal = 1;
+ return (bytes_skipped);
+ }
+ total_bytes_skipped += bytes_skipped;
+ request -= bytes_skipped;
+ filter->client_next = filter->client_buff;
+ filter->client_avail = filter->client_total = 0;
+ }
+ /*
+ * Note that client_skipper will usually not satisfy the
+ * full request (due to low-level blocking concerns),
+ * so even if client_skipper is provided, we may still
+ * have to use ordinary reads to finish out the request.
+ */
+ while (request > 0) {
+ ssize_t bytes_read;
+ (void)__archive_read_filter_ahead(filter, 1, &bytes_read);
+ if (bytes_read < 0)
+ return (bytes_read);
+ if (bytes_read == 0) {
+ return (total_bytes_skipped);
+ }
+ min = (size_t)(minimum(bytes_read, request));
+ bytes_read = __archive_read_filter_consume(filter, min);
+ total_bytes_skipped += bytes_read;
+ request -= bytes_read;
+ }
+ return (total_bytes_skipped);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk.3 b/archivers/libarchive/files/libarchive/archive_read_disk.3
new file mode 100644
index 00000000000..b3a09b52839
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_disk.3
@@ -0,0 +1,308 @@
+.\" Copyright (c) 2003-2009 Tim Kientzle
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: head/lib/libarchive/archive_read_disk.3 190957 2009-04-12 05:04:02Z kientzle $
+.\"
+.Dd March 10, 2009
+.Dt archive_read_disk 3
+.Os
+.Sh NAME
+.Nm archive_read_disk_new ,
+.Nm archive_read_disk_set_symlink_logical ,
+.Nm archive_read_disk_set_symlink_physical ,
+.Nm archive_read_disk_set_symlink_hybrid ,
+.Nm archive_read_disk_entry_from_file ,
+.Nm archive_read_disk_gname ,
+.Nm archive_read_disk_uname ,
+.Nm archive_read_disk_set_uname_lookup ,
+.Nm archive_read_disk_set_gname_lookup ,
+.Nm archive_read_disk_set_standard_lookup ,
+.Nm archive_read_close ,
+.Nm archive_read_finish
+.Nd functions for reading objects from disk
+.Sh SYNOPSIS
+.In archive.h
+.Ft struct archive *
+.Fn archive_read_disk_new "void"
+.Ft int
+.Fn archive_read_disk_set_symlink_logical "struct archive *"
+.Ft int
+.Fn archive_read_disk_set_symlink_physical "struct archive *"
+.Ft int
+.Fn archive_read_disk_set_symlink_hybrid "struct archive *"
+.Ft int
+.Fn archive_read_disk_gname "struct archive *" "gid_t"
+.Ft int
+.Fn archive_read_disk_uname "struct archive *" "uid_t"
+.Ft int
+.Fo archive_read_disk_set_gname_lookup
+.Fa "struct archive *"
+.Fa "void *"
+.Fa "const char *(*lookup)(void *, gid_t)"
+.Fa "void (*cleanup)(void *)"
+.Fc
+.Ft int
+.Fo archive_read_disk_set_uname_lookup
+.Fa "struct archive *"
+.Fa "void *"
+.Fa "const char *(*lookup)(void *, uid_t)"
+.Fa "void (*cleanup)(void *)"
+.Fc
+.Ft int
+.Fn archive_read_disk_set_standard_lookup "struct archive *"
+.Ft int
+.Fo archive_read_disk_entry_from_file
+.Fa "struct archive *"
+.Fa "struct archive_entry *"
+.Fa "int fd"
+.Fa "const struct stat *"
+.Fc
+.Ft int
+.Fn archive_read_close "struct archive *"
+.Ft int
+.Fn archive_read_finish "struct archive *"
+.Sh DESCRIPTION
+These functions provide an API for reading information about
+objects on disk.
+In particular, they provide an interface for populating
+.Tn struct archive_entry
+objects.
+.Bl -tag -width indent
+.It Fn archive_read_disk_new
+Allocates and initializes a
+.Tn struct archive
+object suitable for reading object information from disk.
+.It Xo
+.Fn archive_read_disk_set_symlink_logical ,
+.Fn archive_read_disk_set_symlink_physical ,
+.Fn archive_read_disk_set_symlink_hybrid
+.Xc
+This sets the mode used for handling symbolic links.
+The
+.Dq logical
+mode follows all symbolic links.
+The
+.Dq physical
+mode does not follow any symbolic links.
+The
+.Dq hybrid
+mode currently behaves identically to the
+.Dq logical
+mode.
+.It Xo
+.Fn archive_read_disk_gname ,
+.Fn archive_read_disk_uname
+.Xc
+Returns a user or group name given a gid or uid value.
+By default, these always return a NULL string.
+.It Xo
+.Fn archive_read_disk_set_gname_lookup ,
+.Fn archive_read_disk_set_uname_lookup
+.Xc
+These allow you to override the functions used for
+user and group name lookups.
+You may also provide a
+.Tn void *
+pointer to a private data structure and a cleanup function for
+that data.
+The cleanup function will be invoked when the
+.Tn struct archive
+object is destroyed or when new lookup functions are registered.
+.It Fn archive_read_disk_set_standard_lookup
+This convenience function installs a standard set of user
+and group name lookup functions.
+These functions use
+.Xr getpwid 3
+and
+.Xr getgrid 3
+to convert ids to names, defaulting to NULL if the names cannot
+be looked up.
+These functions also implement a simple memory cache to reduce
+the number of calls to
+.Xr getpwid 3
+and
+.Xr getgrid 3 .
+.It Fn archive_read_disk_entry_from_file
+Populates a
+.Tn struct archive_entry
+object with information about a particular file.
+The
+.Tn archive_entry
+object must have already been created with
+.Xr archive_entry_new 3
+and at least one of the source path or path fields must already be set.
+(If both are set, the source path will be used.)
+.Pp
+Information is read from disk using the path name from the
+.Tn struct archive_entry
+object.
+If a file descriptor is provided, some information will be obtained using
+that file descriptor, on platforms that support the appropriate
+system calls.
+.Pp
+If a pointer to a
+.Tn struct stat
+is provided, information from that structure will be used instead
+of reading from the disk where appropriate.
+This can provide performance benefits in scenarios where
+.Tn struct stat
+information has already been read from the disk as a side effect
+of some other operation.
+(For example, directory traversal libraries often provide this information.)
+.Pp
+Where necessary, user and group ids are converted to user and group names
+using the currently registered lookup functions above.
+This affects the file ownership fields and ACL values in the
+.Tn struct archive_entry
+object.
+.It Fn archive_read_close
+This currently does nothing.
+.It Fn archive_write_finish
+Invokes
+.Fn archive_write_close
+if it was not invoked manually, then releases all resources.
+.El
+More information about the
+.Va struct archive
+object and the overall design of the library can be found in the
+.Xr libarchive 3
+overview.
+.Sh EXAMPLE
+The following illustrates basic usage of the library by
+showing how to use it to copy an item on disk into an archive.
+.Bd -literal -offset indent
+void
+file_to_archive(struct archive *a, const char *name)
+{
+ char buff[8192];
+ size_t bytes_read;
+ struct archive *ard;
+ struct archive_entry *entry;
+ int fd;
+
+ ard = archive_read_disk_new();
+ archive_read_disk_set_standard_lookup(ard);
+ entry = archive_entry_new();
+ fd = open(name, O_RDONLY);
+ if (fd < 0)
+ return;
+ archive_entry_copy_sourcepath(entry, name);
+ archive_read_disk_entry_from_file(ard, entry, fd, NULL);
+ archive_write_header(a, entry);
+ while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
+ archive_write_data(a, buff, bytes_read);
+ archive_write_finish_entry(a);
+ archive_read_finish(ard);
+ archive_entry_free(entry);
+}
+.Ed
+.Sh RETURN VALUES
+Most functions return
+.Cm ARCHIVE_OK
+(zero) on success, or one of several negative
+error codes for errors.
+Specific error codes include:
+.Cm ARCHIVE_RETRY
+for operations that might succeed if retried,
+.Cm ARCHIVE_WARN
+for unusual conditions that do not prevent further operations, and
+.Cm ARCHIVE_FATAL
+for serious errors that make remaining operations impossible.
+The
+.Xr archive_errno 3
+and
+.Xr archive_error_string 3
+functions can be used to retrieve an appropriate error code and a
+textual error message.
+(See
+.Xr archive_util 3
+for details.)
+.Pp
+.Fn archive_read_disk_new
+returns a pointer to a newly-allocated
+.Tn struct archive
+object or NULL if the allocation failed for any reason.
+.Pp
+.Fn archive_read_disk_gname
+and
+.Fn archive_read_disk_uname
+return
+.Tn const char *
+pointers to the textual name or NULL if the lookup failed for any reason.
+The returned pointer points to internal storage that
+may be reused on the next call to either of these functions;
+callers should copy the string if they need to continue accessing it.
+.Pp
+.Sh SEE ALSO
+.Xr archive_read 3 ,
+.Xr archive_write 3 ,
+.Xr archive_write_disk 3 ,
+.Xr tar 1 ,
+.Xr libarchive 3
+.Sh HISTORY
+The
+.Nm libarchive
+library first appeared in
+.Fx 5.3 .
+The
+.Nm archive_read_disk
+interface was added to
+.Nm libarchive 2.6
+and first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm libarchive
+library was written by
+.An Tim Kientzle Aq kientzle@freebsd.org .
+.Sh BUGS
+The
+.Dq standard
+user name and group name lookup functions are not the defaults because
+.Xr getgrid 3
+and
+.Xr getpwid 3
+are sometimes too large for particular applications.
+The current design allows the application author to use a more
+compact implementation when appropriate.
+.Pp
+The full list of metadata read from disk by
+.Fn archive_read_disk_entry_from_file
+is necessarily system-dependent.
+.Pp
+The
+.Fn archive_read_disk_entry_from_file
+function reads as much information as it can from disk.
+Some method should be provided to limit this so that clients who
+do not need ACLs, for instance, can avoid the extra work needed
+to look up such information.
+.Pp
+This API should provide a set of methods for walking a directory tree.
+That would make it a direct parallel of the
+.Xr archive_read 3
+API.
+When such methods are implemented, the
+.Dq hybrid
+symbolic link mode will make sense.
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk.c b/archivers/libarchive/files/libarchive/archive_read_disk.c
new file mode 100644
index 00000000000..8fad7f13733
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_disk.c
@@ -0,0 +1,198 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk.c 189429 2009-03-06 04:35:31Z kientzle $");
+
+#include "archive.h"
+#include "archive_string.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+
+static int _archive_read_finish(struct archive *);
+static int _archive_read_close(struct archive *);
+static const char *trivial_lookup_gname(void *, gid_t gid);
+static const char *trivial_lookup_uname(void *, uid_t uid);
+
+static struct archive_vtable *
+archive_read_disk_vtable(void)
+{
+ static struct archive_vtable av;
+ static int inited = 0;
+
+ if (!inited) {
+ av.archive_finish = _archive_read_finish;
+ av.archive_close = _archive_read_close;
+ }
+ return (&av);
+}
+
+const char *
+archive_read_disk_gname(struct archive *_a, gid_t gid)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ if (a->lookup_gname != NULL)
+ return ((*a->lookup_gname)(a->lookup_gname_data, gid));
+ return (NULL);
+}
+
+const char *
+archive_read_disk_uname(struct archive *_a, uid_t uid)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ if (a->lookup_uname != NULL)
+ return ((*a->lookup_uname)(a->lookup_uname_data, uid));
+ return (NULL);
+}
+
+int
+archive_read_disk_set_gname_lookup(struct archive *_a,
+ void *private_data,
+ const char * (*lookup_gname)(void *private, gid_t gid),
+ void (*cleanup_gname)(void *private))
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ __archive_check_magic(&a->archive, ARCHIVE_READ_DISK_MAGIC,
+ ARCHIVE_STATE_ANY, "archive_read_disk_set_gname_lookup");
+
+ if (a->cleanup_gname != NULL && a->lookup_gname_data != NULL)
+ (a->cleanup_gname)(a->lookup_gname_data);
+
+ a->lookup_gname = lookup_gname;
+ a->cleanup_gname = cleanup_gname;
+ a->lookup_gname_data = private_data;
+ return (ARCHIVE_OK);
+}
+
+int
+archive_read_disk_set_uname_lookup(struct archive *_a,
+ void *private_data,
+ const char * (*lookup_uname)(void *private, uid_t uid),
+ void (*cleanup_uname)(void *private))
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ __archive_check_magic(&a->archive, ARCHIVE_READ_DISK_MAGIC,
+ ARCHIVE_STATE_ANY, "archive_read_disk_set_uname_lookup");
+
+ if (a->cleanup_uname != NULL && a->lookup_uname_data != NULL)
+ (a->cleanup_uname)(a->lookup_uname_data);
+
+ a->lookup_uname = lookup_uname;
+ a->cleanup_uname = cleanup_uname;
+ a->lookup_uname_data = private_data;
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Create a new archive_read_disk object and initialize it with global state.
+ */
+struct archive *
+archive_read_disk_new(void)
+{
+ struct archive_read_disk *a;
+
+ a = (struct archive_read_disk *)malloc(sizeof(*a));
+ if (a == NULL)
+ return (NULL);
+ memset(a, 0, sizeof(*a));
+ a->archive.magic = ARCHIVE_READ_DISK_MAGIC;
+ /* We're ready to write a header immediately. */
+ a->archive.state = ARCHIVE_STATE_HEADER;
+ a->archive.vtable = archive_read_disk_vtable();
+ a->lookup_uname = trivial_lookup_uname;
+ a->lookup_gname = trivial_lookup_gname;
+ return (&a->archive);
+}
+
+static int
+_archive_read_finish(struct archive *_a)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+
+ if (a->cleanup_gname != NULL && a->lookup_gname_data != NULL)
+ (a->cleanup_gname)(a->lookup_gname_data);
+ if (a->cleanup_uname != NULL && a->lookup_uname_data != NULL)
+ (a->cleanup_uname)(a->lookup_uname_data);
+ archive_string_free(&a->archive.error_string);
+ free(a);
+ return (ARCHIVE_OK);
+}
+
+static int
+_archive_read_close(struct archive *_a)
+{
+ (void)_a; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+
+int
+archive_read_disk_set_symlink_logical(struct archive *_a)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ a->symlink_mode = 'L';
+ a->follow_symlinks = 1;
+ return (ARCHIVE_OK);
+}
+
+int
+archive_read_disk_set_symlink_physical(struct archive *_a)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ a->symlink_mode = 'P';
+ a->follow_symlinks = 0;
+ return (ARCHIVE_OK);
+}
+
+int
+archive_read_disk_set_symlink_hybrid(struct archive *_a)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ a->symlink_mode = 'H';
+ a->follow_symlinks = 1; /* Follow symlinks initially. */
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Trivial implementations of gname/uname lookup functions.
+ * These are normally overridden by the client, but these stub
+ * versions ensure that we always have something that works.
+ */
+static const char *
+trivial_lookup_gname(void *private_data, gid_t gid)
+{
+ (void)private_data; /* UNUSED */
+ (void)gid; /* UNUSED */
+ return (NULL);
+}
+
+static const char *
+trivial_lookup_uname(void *private_data, uid_t uid)
+{
+ (void)private_data; /* UNUSED */
+ (void)uid; /* UNUSED */
+ return (NULL);
+}
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c b/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c
new file mode 100644
index 00000000000..e3795dec0a4
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c
@@ -0,0 +1,563 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 201084 2009-12-28 02:14:09Z kientzle $");
+
+#ifdef HAVE_SYS_TYPES_H
+/* Mac OSX requires sys/types.h before sys/acl.h. */
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+#ifdef HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#include "archive.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+
+/*
+ * Linux and FreeBSD plug this obvious hole in POSIX.1e in
+ * different ways.
+ */
+#if HAVE_ACL_GET_PERM
+#define ACL_GET_PERM acl_get_perm
+#elif HAVE_ACL_GET_PERM_NP
+#define ACL_GET_PERM acl_get_perm_np
+#endif
+
+static int setup_acls_posix1e(struct archive_read_disk *,
+ struct archive_entry *, int fd);
+static int setup_xattrs(struct archive_read_disk *,
+ struct archive_entry *, int fd);
+
+int
+archive_read_disk_entry_from_file(struct archive *_a,
+ struct archive_entry *entry,
+ int fd, const struct stat *st)
+{
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ const char *path, *name;
+ struct stat s;
+ int initial_fd = fd;
+ int r, r1;
+
+ archive_clear_error(_a);
+ path = archive_entry_sourcepath(entry);
+ if (path == NULL)
+ path = archive_entry_pathname(entry);
+
+#ifdef EXT2_IOC_GETFLAGS
+ /* Linux requires an extra ioctl to pull the flags. Although
+ * this is an extra step, it has a nice side-effect: We get an
+ * open file descriptor which we can use in the subsequent lookups. */
+ if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
+ if (fd < 0)
+ fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY);
+ if (fd >= 0) {
+ unsigned long stflags;
+ int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
+ if (r == 0 && stflags != 0)
+ archive_entry_set_fflags(entry, stflags, 0);
+ }
+ }
+#endif
+
+ if (st == NULL) {
+ /* TODO: On Windows, use GetFileInfoByHandle() here.
+ * Using Windows stat() call is badly broken, but
+ * even the stat() wrapper has problems because
+ * 'struct stat' is broken on Windows.
+ */
+#if HAVE_FSTAT
+ if (fd >= 0) {
+ if (fstat(fd, &s) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Can't fstat");
+ return (ARCHIVE_FAILED);
+ }
+ } else
+#endif
+#if HAVE_LSTAT
+ if (!a->follow_symlinks) {
+ if (lstat(path, &s) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Can't lstat %s", path);
+ return (ARCHIVE_FAILED);
+ }
+ } else
+#endif
+ if (stat(path, &s) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Can't lstat %s", path);
+ return (ARCHIVE_FAILED);
+ }
+ st = &s;
+ }
+ archive_entry_copy_stat(entry, st);
+
+ /* Lookup uname/gname */
+ name = archive_read_disk_uname(_a, archive_entry_uid(entry));
+ if (name != NULL)
+ archive_entry_copy_uname(entry, name);
+ name = archive_read_disk_gname(_a, archive_entry_gid(entry));
+ if (name != NULL)
+ archive_entry_copy_gname(entry, name);
+
+#ifdef HAVE_STRUCT_STAT_ST_FLAGS
+ /* On FreeBSD, we get flags for free with the stat. */
+ /* TODO: Does this belong in copy_stat()? */
+ if (st->st_flags != 0)
+ archive_entry_set_fflags(entry, st->st_flags, 0);
+#endif
+
+#ifdef HAVE_READLINK
+ if (S_ISLNK(st->st_mode)) {
+ char linkbuffer[PATH_MAX + 1];
+ int lnklen = readlink(path, linkbuffer, PATH_MAX);
+ if (lnklen < 0) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't read link data");
+ return (ARCHIVE_FAILED);
+ }
+ linkbuffer[lnklen] = 0;
+ archive_entry_set_symlink(entry, linkbuffer);
+ }
+#endif
+
+ r = setup_acls_posix1e(a, entry, fd);
+ r1 = setup_xattrs(a, entry, fd);
+ if (r1 < r)
+ r = r1;
+ /* If we opened the file earlier in this function, close it. */
+ if (initial_fd != fd)
+ close(fd);
+ return (r);
+}
+
+#ifdef HAVE_POSIX_ACL
+static void setup_acl_posix1e(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
+
+static int
+setup_acls_posix1e(struct archive_read_disk *a,
+ struct archive_entry *entry, int fd)
+{
+ const char *accpath;
+ acl_t acl;
+
+ accpath = archive_entry_sourcepath(entry);
+ if (accpath == NULL)
+ accpath = archive_entry_pathname(entry);
+
+ archive_entry_acl_clear(entry);
+
+ /* Retrieve access ACL from file. */
+ if (fd >= 0)
+ acl = acl_get_fd(fd);
+#if HAVE_ACL_GET_LINK_NP
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
+#endif
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
+ if (acl != NULL) {
+ setup_acl_posix1e(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ acl_free(acl);
+ }
+
+ /* Only directories can have default ACLs. */
+ if (S_ISDIR(archive_entry_mode(entry))) {
+ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
+ if (acl != NULL) {
+ setup_acl_posix1e(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ acl_free(acl);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Translate POSIX.1e ACL into libarchive internal structure.
+ */
+static void
+setup_acl_posix1e(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int archive_entry_acl_type)
+{
+ acl_tag_t acl_tag;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int s, ae_id, ae_tag, ae_perm;
+ const char *ae_name;
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ while (s == 1) {
+ ae_id = -1;
+ ae_name = NULL;
+
+ acl_get_tag_type(acl_entry, &acl_tag);
+ if (acl_tag == ACL_USER) {
+ ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry);
+ ae_name = archive_read_disk_uname(&a->archive, ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ } else if (acl_tag == ACL_GROUP) {
+ ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry);
+ ae_name = archive_read_disk_gname(&a->archive, ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ } else if (acl_tag == ACL_MASK) {
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ } else if (acl_tag == ACL_USER_OBJ) {
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ } else if (acl_tag == ACL_GROUP_OBJ) {
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ } else if (acl_tag == ACL_OTHER) {
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ } else {
+ /* Skip types that libarchive can't support. */
+ continue;
+ }
+
+ acl_get_permset(acl_entry, &acl_permset);
+ ae_perm = 0;
+ /*
+ * acl_get_perm() is spelled differently on different
+ * platforms; see above.
+ */
+ if (ACL_GET_PERM(acl_permset, ACL_EXECUTE))
+ ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ if (ACL_GET_PERM(acl_permset, ACL_READ))
+ ae_perm |= ARCHIVE_ENTRY_ACL_READ;
+ if (ACL_GET_PERM(acl_permset, ACL_WRITE))
+ ae_perm |= ARCHIVE_ENTRY_ACL_WRITE;
+
+ archive_entry_acl_add_entry(entry,
+ archive_entry_acl_type, ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ }
+}
+#else
+static int
+setup_acls_posix1e(struct archive_read_disk *a,
+ struct archive_entry *entry, int fd)
+{
+ (void)a; /* UNUSED */
+ (void)entry; /* UNUSED */
+ (void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+#endif
+
+#if HAVE_LISTXATTR && HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR
+
+/*
+ * Linux extended attribute support.
+ *
+ * TODO: By using a stack-allocated buffer for the first
+ * call to getxattr(), we might be able to avoid the second
+ * call entirely. We only need the second call if the
+ * stack-allocated buffer is too small. But a modest buffer
+ * of 1024 bytes or so will often be big enough. Same applies
+ * to listxattr().
+ */
+
+
+static int
+setup_xattr(struct archive_read_disk *a,
+ struct archive_entry *entry, const char *name, int fd)
+{
+ ssize_t size;
+ void *value = NULL;
+ const char *accpath;
+
+ (void)fd; /* UNUSED */
+
+ accpath = archive_entry_sourcepath(entry);
+ if (accpath == NULL)
+ accpath = archive_entry_pathname(entry);
+
+ if (!a->follow_symlinks)
+ size = lgetxattr(accpath, name, NULL, 0);
+ else
+ size = getxattr(accpath, name, NULL, 0);
+
+ if (size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't query extended attribute");
+ return (ARCHIVE_WARN);
+ }
+
+ if (size > 0 && (value = malloc(size)) == NULL) {
+ archive_set_error(&a->archive, errno, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+
+ if (!a->follow_symlinks)
+ size = lgetxattr(accpath, name, value, size);
+ else
+ size = getxattr(accpath, name, value, size);
+
+ if (size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't read extended attribute");
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_xattr_add_entry(entry, name, value, size);
+
+ free(value);
+ return (ARCHIVE_OK);
+}
+
+static int
+setup_xattrs(struct archive_read_disk *a,
+ struct archive_entry *entry, int fd)
+{
+ char *list, *p;
+ const char *path;
+ ssize_t list_size;
+
+
+ path = archive_entry_sourcepath(entry);
+ if (path == NULL)
+ path = archive_entry_pathname(entry);
+
+ if (!a->follow_symlinks)
+ list_size = llistxattr(path, NULL, 0);
+ else
+ list_size = listxattr(path, NULL, 0);
+
+ if (list_size == -1) {
+ if (errno == ENOTSUP)
+ return (ARCHIVE_OK);
+ archive_set_error(&a->archive, errno,
+ "Couldn't list extended attributes");
+ return (ARCHIVE_WARN);
+ }
+
+ if (list_size == 0)
+ return (ARCHIVE_OK);
+
+ if ((list = malloc(list_size)) == NULL) {
+ archive_set_error(&a->archive, errno, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+
+ if (!a->follow_symlinks)
+ list_size = llistxattr(path, list, list_size);
+ else
+ list_size = listxattr(path, list, list_size);
+
+ if (list_size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't retrieve extended attributes");
+ free(list);
+ return (ARCHIVE_WARN);
+ }
+
+ for (p = list; (p - list) < list_size; p += strlen(p) + 1) {
+ if (strncmp(p, "system.", 7) == 0 ||
+ strncmp(p, "xfsroot.", 8) == 0)
+ continue;
+ setup_xattr(a, entry, p, fd);
+ }
+
+ free(list);
+ return (ARCHIVE_OK);
+}
+
+#elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE
+
+/*
+ * FreeBSD extattr interface.
+ */
+
+/* TODO: Implement this. Follow the Linux model above, but
+ * with FreeBSD-specific system calls, of course. Be careful
+ * to not include the system extattrs that hold ACLs; we handle
+ * those separately.
+ */
+int
+setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
+ int namespace, const char *name, const char *fullname, int fd);
+
+int
+setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
+ int namespace, const char *name, const char *fullname, int fd)
+{
+ ssize_t size;
+ void *value = NULL;
+ const char *accpath;
+
+ (void)fd; /* UNUSED */
+
+ accpath = archive_entry_sourcepath(entry);
+ if (accpath == NULL)
+ accpath = archive_entry_pathname(entry);
+
+ if (!a->follow_symlinks)
+ size = extattr_get_link(accpath, namespace, name, NULL, 0);
+ else
+ size = extattr_get_file(accpath, namespace, name, NULL, 0);
+
+ if (size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't query extended attribute");
+ return (ARCHIVE_WARN);
+ }
+
+ if (size > 0 && (value = malloc(size)) == NULL) {
+ archive_set_error(&a->archive, errno, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+
+ if (!a->follow_symlinks)
+ size = extattr_get_link(accpath, namespace, name, value, size);
+ else
+ size = extattr_get_file(accpath, namespace, name, value, size);
+
+ if (size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't read extended attribute");
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_xattr_add_entry(entry, fullname, value, size);
+
+ free(value);
+ return (ARCHIVE_OK);
+}
+
+static int
+setup_xattrs(struct archive_read_disk *a,
+ struct archive_entry *entry, int fd)
+{
+ char buff[512];
+ char *list, *p;
+ ssize_t list_size;
+ const char *path;
+ int namespace = EXTATTR_NAMESPACE_USER;
+
+ path = archive_entry_sourcepath(entry);
+ if (path == NULL)
+ path = archive_entry_pathname(entry);
+
+ if (!a->follow_symlinks)
+ list_size = extattr_list_link(path, namespace, NULL, 0);
+ else
+ list_size = extattr_list_file(path, namespace, NULL, 0);
+
+ if (list_size == -1 && errno == EOPNOTSUPP)
+ return (ARCHIVE_OK);
+ if (list_size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't list extended attributes");
+ return (ARCHIVE_WARN);
+ }
+
+ if (list_size == 0)
+ return (ARCHIVE_OK);
+
+ if ((list = malloc(list_size)) == NULL) {
+ archive_set_error(&a->archive, errno, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+
+ if (!a->follow_symlinks)
+ list_size = extattr_list_link(path, namespace, list, list_size);
+ else
+ list_size = extattr_list_file(path, namespace, list, list_size);
+
+ if (list_size == -1) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't retrieve extended attributes");
+ free(list);
+ return (ARCHIVE_WARN);
+ }
+
+ p = list;
+ while ((p - list) < list_size) {
+ size_t len = 255 & (int)*p;
+ char *name;
+
+ strcpy(buff, "user.");
+ name = buff + strlen(buff);
+ memcpy(name, p + 1, len);
+ name[len] = '\0';
+ setup_xattr(a, entry, namespace, name, buff, fd);
+ p += 1 + len;
+ }
+
+ free(list);
+ return (ARCHIVE_OK);
+}
+
+#else
+
+/*
+ * Generic (stub) extended attribute support.
+ */
+static int
+setup_xattrs(struct archive_read_disk *a,
+ struct archive_entry *entry, int fd)
+{
+ (void)a; /* UNUSED */
+ (void)entry; /* UNUSED */
+ (void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk_private.h b/archivers/libarchive/files/libarchive/archive_read_disk_private.h
new file mode 100644
index 00000000000..b674b7106d7
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_disk_private.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: head/lib/libarchive/archive_read_disk_private.h 201105 2009-12-28 03:20:54Z kientzle $
+ */
+
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
+#ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
+#define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
+
+struct archive_read_disk {
+ struct archive archive;
+
+ /*
+ * Symlink mode is one of 'L'ogical, 'P'hysical, or 'H'ybrid,
+ * following an old BSD convention. 'L' follows all symlinks,
+ * 'P' follows none, 'H' follows symlinks only for the first
+ * item.
+ */
+ char symlink_mode;
+
+ /*
+ * Since symlink interaction changes, we need to track whether
+ * we're following symlinks for the current item. 'L' mode above
+ * sets this true, 'P' sets it false, 'H' changes it as we traverse.
+ */
+ char follow_symlinks; /* Either 'L' or 'P'. */
+
+ const char * (*lookup_gname)(void *private, gid_t gid);
+ void (*cleanup_gname)(void *private);
+ void *lookup_gname_data;
+ const char * (*lookup_uname)(void *private, gid_t gid);
+ void (*cleanup_uname)(void *private);
+ void *lookup_uname_data;
+};
+
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk_set_standard_lookup.c b/archivers/libarchive/files/libarchive/archive_read_disk_set_standard_lookup.c
new file mode 100644
index 00000000000..94f4a3087bd
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_disk_set_standard_lookup.c
@@ -0,0 +1,272 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_set_standard_lookup.c 201109 2009-12-28 03:30:31Z kientzle $");
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "archive.h"
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+int
+archive_read_disk_set_standard_lookup(struct archive *a)
+{
+ archive_set_error(a, -1, "Standard lookups not available on Windows");
+ return (ARCHIVE_FATAL);
+}
+#else /* ! (_WIN32 && !__CYGWIN__) */
+#define name_cache_size 127
+
+static const char * const NO_NAME = "(noname)";
+
+struct name_cache {
+ struct archive *archive;
+ char *buff;
+ size_t buff_size;
+ int probes;
+ int hits;
+ size_t size;
+ struct {
+ id_t id;
+ const char *name;
+ } cache[name_cache_size];
+};
+
+static const char * lookup_gname(void *, gid_t);
+static const char * lookup_uname(void *, uid_t);
+static void cleanup(void *);
+static const char * lookup_gname_helper(struct name_cache *, id_t gid);
+static const char * lookup_uname_helper(struct name_cache *, id_t uid);
+
+/*
+ * Installs functions that use getpwuid()/getgrgid()---along with
+ * a simple cache to accelerate such lookups---into the archive_read_disk
+ * object. This is in a separate file because getpwuid()/getgrgid()
+ * can pull in a LOT of library code (including NIS/LDAP functions, which
+ * pull in DNS resolveers, etc). This can easily top 500kB, which makes
+ * it inappropriate for some space-constrained applications.
+ *
+ * Applications that are size-sensitive may want to just use the
+ * real default functions (defined in archive_read_disk.c) that just
+ * use the uid/gid without the lookup. Or define your own custom functions
+ * if you prefer.
+ */
+int
+archive_read_disk_set_standard_lookup(struct archive *a)
+{
+ struct name_cache *ucache = malloc(sizeof(struct name_cache));
+ struct name_cache *gcache = malloc(sizeof(struct name_cache));
+
+ if (ucache == NULL || gcache == NULL) {
+ archive_set_error(a, ENOMEM,
+ "Can't allocate uname/gname lookup cache");
+ free(ucache);
+ free(gcache);
+ return (ARCHIVE_FATAL);
+ }
+
+ memset(ucache, 0, sizeof(*ucache));
+ ucache->archive = a;
+ ucache->size = name_cache_size;
+ memset(gcache, 0, sizeof(*gcache));
+ gcache->archive = a;
+ gcache->size = name_cache_size;
+
+ archive_read_disk_set_gname_lookup(a, gcache, lookup_gname, cleanup);
+ archive_read_disk_set_uname_lookup(a, ucache, lookup_uname, cleanup);
+
+ return (ARCHIVE_OK);
+}
+
+static void
+cleanup(void *data)
+{
+ struct name_cache *cache = (struct name_cache *)data;
+ size_t i;
+
+ if (cache != NULL) {
+ for (i = 0; i < cache->size; i++) {
+ if (cache->cache[i].name != NULL &&
+ cache->cache[i].name != NO_NAME)
+ free((void *)(uintptr_t)cache->cache[i].name);
+ }
+ free(cache->buff);
+ free(cache);
+ }
+}
+
+/*
+ * Lookup uid/gid from uname/gname, return NULL if no match.
+ */
+static const char *
+lookup_name(struct name_cache *cache,
+ const char * (*lookup_fn)(struct name_cache *, id_t), id_t id)
+{
+ const char *name;
+ int slot;
+
+
+ cache->probes++;
+
+ slot = id % cache->size;
+ if (cache->cache[slot].name != NULL) {
+ if (cache->cache[slot].id == id) {
+ cache->hits++;
+ if (cache->cache[slot].name == NO_NAME)
+ return (NULL);
+ return (cache->cache[slot].name);
+ }
+ if (cache->cache[slot].name != NO_NAME)
+ free((void *)(uintptr_t)cache->cache[slot].name);
+ cache->cache[slot].name = NULL;
+ }
+
+ name = (lookup_fn)(cache, id);
+ if (name == NULL) {
+ /* Cache and return the negative response. */
+ cache->cache[slot].name = NO_NAME;
+ cache->cache[slot].id = id;
+ return (NULL);
+ }
+
+ cache->cache[slot].name = name;
+ cache->cache[slot].id = id;
+ return (cache->cache[slot].name);
+}
+
+static const char *
+lookup_uname(void *data, uid_t uid)
+{
+ struct name_cache *uname_cache = (struct name_cache *)data;
+ return (lookup_name(uname_cache,
+ &lookup_uname_helper, (id_t)uid));
+}
+
+static const char *
+lookup_uname_helper(struct name_cache *cache, id_t id)
+{
+ struct passwd pwent, *result;
+ int r;
+
+ if (cache->buff_size == 0) {
+ cache->buff_size = 256;
+ cache->buff = malloc(cache->buff_size);
+ }
+ if (cache->buff == NULL)
+ return (NULL);
+ for (;;) {
+ result = &pwent; /* Old getpwuid_r ignores last arg. */
+ r = getpwuid_r((uid_t)id, &pwent,
+ cache->buff, cache->buff_size, &result);
+ if (r == 0)
+ break;
+ if (r != ERANGE)
+ break;
+ /* ERANGE means our buffer was too small, but POSIX
+ * doesn't tell us how big the buffer should be, so
+ * we just double it and try again. Because the buffer
+ * is kept around in the cache object, we shouldn't
+ * have to do this very often. */
+ cache->buff_size *= 2;
+ cache->buff = realloc(cache->buff, cache->buff_size);
+ if (cache->buff == NULL)
+ break;
+ }
+ if (r != 0) {
+ archive_set_error(cache->archive, errno,
+ "Can't lookup user for id %d", (int)id);
+ return (NULL);
+ }
+ if (result == NULL)
+ return (NULL);
+
+ return strdup(result->pw_name);
+}
+
+static const char *
+lookup_gname(void *data, gid_t gid)
+{
+ struct name_cache *gname_cache = (struct name_cache *)data;
+ return (lookup_name(gname_cache,
+ &lookup_gname_helper, (id_t)gid));
+}
+
+static const char *
+lookup_gname_helper(struct name_cache *cache, id_t id)
+{
+ struct group grent, *result;
+ int r;
+
+ if (cache->buff_size == 0) {
+ cache->buff_size = 256;
+ cache->buff = malloc(cache->buff_size);
+ }
+ if (cache->buff == NULL)
+ return (NULL);
+ for (;;) {
+ result = &grent; /* Old getgrgid_r ignores last arg. */
+ r = getgrgid_r((gid_t)id, &grent,
+ cache->buff, cache->buff_size, &result);
+ if (r == 0)
+ break;
+ if (r != ERANGE)
+ break;
+ /* ERANGE means our buffer was too small, but POSIX
+ * doesn't tell us how big the buffer should be, so
+ * we just double it and try again. */
+ cache->buff_size *= 2;
+ cache->buff = realloc(cache->buff, cache->buff_size);
+ if (cache->buff == NULL)
+ break;
+ }
+ if (r != 0) {
+ archive_set_error(cache->archive, errno,
+ "Can't lookup group for id %d", (int)id);
+ return (NULL);
+ }
+ if (result == NULL)
+ return (NULL);
+
+ return strdup(result->gr_name);
+}
+#endif /* ! (_WIN32 && !__CYGWIN__) */
diff --git a/archivers/libarchive/files/libarchive/archive_read_open_fd.c b/archivers/libarchive/files/libarchive/archive_read_open_fd.c
index 2ebd46d6cdf..33b7cba1b9b 100644
--- a/archivers/libarchive/files/libarchive/archive_read_open_fd.c
+++ b/archivers/libarchive/files/libarchive/archive_read_open_fd.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.13 2007/06/26 03:06:48 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_fd.c 201103 2009-12-28 03:13:49Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -32,6 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.13 2007/06/26
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -52,7 +58,6 @@ struct read_fd_data {
};
static int file_close(struct archive *, void *);
-static int file_open(struct archive *, void *);
static ssize_t file_read(struct archive *, void *, const void **buff);
#if ARCHIVE_API_VERSION < 2
static ssize_t file_skip(struct archive *, void *, size_t request);
@@ -63,50 +68,45 @@ static off_t file_skip(struct archive *, void *, off_t request);
int
archive_read_open_fd(struct archive *a, int fd, size_t block_size)
{
+ struct stat st;
struct read_fd_data *mine;
+ void *b;
- mine = (struct read_fd_data *)malloc(sizeof(*mine));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
+ archive_clear_error(a);
+ if (fstat(fd, &st) != 0) {
+ archive_set_error(a, errno, "Can't stat fd %d", fd);
return (ARCHIVE_FATAL);
}
- mine->block_size = block_size;
- mine->buffer = malloc(mine->block_size);
- if (mine->buffer == NULL) {
+
+ mine = (struct read_fd_data *)malloc(sizeof(*mine));
+ b = malloc(block_size);
+ if (mine == NULL || b == NULL) {
archive_set_error(a, ENOMEM, "No memory");
free(mine);
+ free(b);
return (ARCHIVE_FATAL);
}
+ mine->block_size = block_size;
+ mine->buffer = b;
mine->fd = fd;
- /* lseek() hardly ever works, so disable it by default. See below. */
- mine->can_skip = 0;
- return (archive_read_open2(a, mine, file_open, file_read, file_skip, file_close));
-}
-
-static int
-file_open(struct archive *a, void *client_data)
-{
- struct read_fd_data *mine = (struct read_fd_data *)client_data;
- struct stat st;
-
- if (fstat(mine->fd, &st) != 0) {
- archive_set_error(a, errno, "Can't stat fd %d", mine->fd);
- return (ARCHIVE_FATAL);
- }
-
+ /*
+ * Skip support is a performance optimization for anything
+ * that supports lseek(). On FreeBSD, only regular files and
+ * raw disk devices support lseek() and there's no portable
+ * way to determine if a device is a raw disk device, so we
+ * only enable this optimization for regular files.
+ */
if (S_ISREG(st.st_mode)) {
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
- /*
- * Enabling skip here is a performance optimization for
- * anything that supports lseek(). On FreeBSD, only
- * regular files and raw disk devices support lseek() and
- * there's no portable way to determine if a device is
- * a raw disk device, so we only enable this optimization
- * for regular files.
- */
mine->can_skip = 1;
- }
- return (ARCHIVE_OK);
+ } else
+ mine->can_skip = 0;
+#if defined(__CYGWIN__) || defined(_WIN32)
+ setmode(mine->fd, O_BINARY);
+#endif
+
+ return (archive_read_open2(a, mine,
+ NULL, file_read, file_skip, file_close));
}
static ssize_t
@@ -180,8 +180,7 @@ file_close(struct archive *a, void *client_data)
struct read_fd_data *mine = (struct read_fd_data *)client_data;
(void)a; /* UNUSED */
- if (mine->buffer != NULL)
- free(mine->buffer);
+ free(mine->buffer);
free(mine);
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_open_file.c b/archivers/libarchive/files/libarchive/archive_read_open_file.c
index 55c431c7da6..095ae6eb5ce 100644
--- a/archivers/libarchive/files/libarchive/archive_read_open_file.c
+++ b/archivers/libarchive/files/libarchive/archive_read_open_file.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_file.c,v 1.20 2007/06/26 03:06:48 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_file.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -35,6 +35,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_file.c,v 1.20 2007/06/2
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -55,7 +58,6 @@ struct read_FILE_data {
};
static int file_close(struct archive *, void *);
-static int file_open(struct archive *, void *);
static ssize_t file_read(struct archive *, void *, const void **buff);
#if ARCHIVE_API_VERSION < 2
static ssize_t file_skip(struct archive *, void *, size_t request);
@@ -66,45 +68,41 @@ static off_t file_skip(struct archive *, void *, off_t request);
int
archive_read_open_FILE(struct archive *a, FILE *f)
{
+ struct stat st;
struct read_FILE_data *mine;
+ size_t block_size = 128 * 1024;
+ void *b;
+ archive_clear_error(a);
mine = (struct read_FILE_data *)malloc(sizeof(*mine));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- mine->block_size = 128 * 1024;
- mine->buffer = malloc(mine->block_size);
- if (mine->buffer == NULL) {
+ b = malloc(block_size);
+ if (mine == NULL || b == NULL) {
archive_set_error(a, ENOMEM, "No memory");
free(mine);
+ free(b);
return (ARCHIVE_FATAL);
}
+ mine->block_size = block_size;
+ mine->buffer = b;
mine->f = f;
- /* Suppress skip by default. See below. */
- mine->can_skip = 0;
- return (archive_read_open2(a, mine, file_open, file_read,
- file_skip, file_close));
-}
-
-static int
-file_open(struct archive *a, void *client_data)
-{
- struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
- struct stat st;
-
/*
- * If we can't fstat() the file, it may just be that
- * it's not a file. (FILE * objects can wrap many kinds
- * of I/O streams.)
+ * If we can't fstat() the file, it may just be that it's not
+ * a file. (FILE * objects can wrap many kinds of I/O
+ * streams, some of which don't support fileno()).)
*/
if (fstat(fileno(mine->f), &st) == 0 && S_ISREG(st.st_mode)) {
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
- /* Enable the seek optimization for regular files. */
+ /* Enable the seek optimization only for regular files. */
mine->can_skip = 1;
- }
+ } else
+ mine->can_skip = 0;
- return (ARCHIVE_OK);
+#if defined(__CYGWIN__) || defined(_WIN32)
+ setmode(fileno(mine->f), O_BINARY);
+#endif
+
+ return (archive_read_open2(a, mine, NULL, file_read,
+ file_skip, file_close));
}
static ssize_t
diff --git a/archivers/libarchive/files/libarchive/archive_read_open_filename.c b/archivers/libarchive/files/libarchive/archive_read_open_filename.c
index 3d6376fbcfa..607b80c56c7 100644
--- a/archivers/libarchive/files/libarchive/archive_read_open_filename.c
+++ b/archivers/libarchive/files/libarchive/archive_read_open_filename.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.21 2008/02/19 06:10:48 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_filename.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -35,6 +35,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.21 2008/
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -61,7 +64,6 @@ struct read_file_data {
};
static int file_close(struct archive *, void *);
-static int file_open(struct archive *, void *);
static ssize_t file_read(struct archive *, void *, const void **buff);
#if ARCHIVE_API_VERSION < 2
static ssize_t file_skip(struct archive *, void *, size_t request);
@@ -80,78 +82,75 @@ int
archive_read_open_filename(struct archive *a, const char *filename,
size_t block_size)
{
+ struct stat st;
struct read_file_data *mine;
+ void *b;
+ int fd;
+ archive_clear_error(a);
if (filename == NULL || filename[0] == '\0') {
- mine = (struct read_file_data *)malloc(sizeof(*mine));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- mine->filename[0] = '\0';
+ /* We used to invoke archive_read_open_fd(a,0,block_size)
+ * here, but that doesn't (and shouldn't) handle the
+ * end-of-file flush when reading stdout from a pipe.
+ * Basically, read_open_fd() is intended for folks who
+ * are willing to handle such details themselves. This
+ * API is intended to be a little smarter for folks who
+ * want easy handling of the common case.
+ */
+ filename = ""; /* Normalize NULL to "" */
+ fd = 0;
+#if defined(__CYGWIN__) || defined(_WIN32)
+ setmode(0, O_BINARY);
+#endif
} else {
- mine = (struct read_file_data *)malloc(sizeof(*mine) + strlen(filename));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
+ fd = open(filename, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ archive_set_error(a, errno,
+ "Failed to open '%s'", filename);
return (ARCHIVE_FATAL);
}
- strcpy(mine->filename, filename);
}
- mine->block_size = block_size;
- mine->buffer = NULL;
- mine->fd = -1;
- /* lseek() almost never works; disable it by default. See below. */
- mine->can_skip = 0;
- return (archive_read_open2(a, mine, file_open, file_read, file_skip, file_close));
-}
-
-static int
-file_open(struct archive *a, void *client_data)
-{
- struct read_file_data *mine = (struct read_file_data *)client_data;
- struct stat st;
-
- mine->buffer = malloc(mine->block_size);
- if (mine->buffer == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
+ if (fstat(fd, &st) != 0) {
+ archive_set_error(a, errno, "Can't stat '%s'", filename);
return (ARCHIVE_FATAL);
}
- if (mine->filename[0] != '\0')
- mine->fd = open(mine->filename, O_RDONLY | O_BINARY);
- else
- mine->fd = 0; /* Fake "open" for stdin. */
- if (mine->fd < 0) {
- archive_set_error(a, errno, "Failed to open '%s'",
- mine->filename);
+
+ mine = (struct read_file_data *)calloc(1,
+ sizeof(*mine) + strlen(filename));
+ b = malloc(block_size);
+ if (mine == NULL || b == NULL) {
+ archive_set_error(a, ENOMEM, "No memory");
+ free(mine);
+ free(b);
return (ARCHIVE_FATAL);
}
- if (fstat(mine->fd, &st) == 0) {
- /* If we're reading a file from disk, ensure that we don't
- overwrite it with an extracted file. */
- if (S_ISREG(st.st_mode)) {
- archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
- /*
- * Enabling skip here is a performance
- * optimization for anything that supports
- * lseek(). On FreeBSD, only regular files
- * and raw disk devices support lseek() and
- * there's no portable way to determine if a
- * device is a raw disk device, so we only
- * enable this optimization for regular files.
- */
- mine->can_skip = 1;
- }
- /* Remember mode so close can decide whether to flush. */
- mine->st_mode = st.st_mode;
- } else {
- if (mine->filename[0] == '\0')
- archive_set_error(a, errno, "Can't stat stdin");
- else
- archive_set_error(a, errno, "Can't stat '%s'",
- mine->filename);
- return (ARCHIVE_FATAL);
+ strcpy(mine->filename, filename);
+ mine->block_size = block_size;
+ mine->buffer = b;
+ mine->fd = fd;
+ /* Remember mode so close can decide whether to flush. */
+ mine->st_mode = st.st_mode;
+ /* If we're reading a file from disk, ensure that we don't
+ overwrite it with an extracted file. */
+ if (S_ISREG(st.st_mode)) {
+ archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
+ /*
+ * Enabling skip here is a performance optimization
+ * for anything that supports lseek(). On FreeBSD
+ * (and probably many other systems), only regular
+ * files and raw disk devices support lseek() (on
+ * other input types, lseek() returns success but
+ * doesn't actually change the file pointer, which
+ * just completely screws up the position-tracking
+ * logic). In addition, I've yet to find a portable
+ * way to determine if a device is a raw disk device.
+ * So I don't see a way to do much better than to only
+ * enable this optimization for regular files.
+ */
+ mine->can_skip = 1;
}
- return (0);
+ return (archive_read_open2(a, mine,
+ NULL, file_read, file_skip, file_close));
}
static ssize_t
@@ -238,30 +237,32 @@ file_close(struct archive *a, void *client_data)
(void)a; /* UNUSED */
- /*
- * Sometimes, we should flush the input before closing.
- * Regular files: faster to just close without flush.
- * Devices: must not flush (user might need to
- * read the "next" item on a non-rewind device).
- * Pipes and sockets: must flush (otherwise, the
- * program feeding the pipe or socket may complain).
- * Here, I flush everything except for regular files and
- * device nodes.
- */
- if (!S_ISREG(mine->st_mode)
- && !S_ISCHR(mine->st_mode)
- && !S_ISBLK(mine->st_mode)) {
- ssize_t bytesRead;
- do {
- bytesRead = read(mine->fd, mine->buffer,
- mine->block_size);
- } while (bytesRead > 0);
+ /* Only flush and close if open succeeded. */
+ if (mine->fd >= 0) {
+ /*
+ * Sometimes, we should flush the input before closing.
+ * Regular files: faster to just close without flush.
+ * Devices: must not flush (user might need to
+ * read the "next" item on a non-rewind device).
+ * Pipes and sockets: must flush (otherwise, the
+ * program feeding the pipe or socket may complain).
+ * Here, I flush everything except for regular files and
+ * device nodes.
+ */
+ if (!S_ISREG(mine->st_mode)
+ && !S_ISCHR(mine->st_mode)
+ && !S_ISBLK(mine->st_mode)) {
+ ssize_t bytesRead;
+ do {
+ bytesRead = read(mine->fd, mine->buffer,
+ mine->block_size);
+ } while (bytesRead > 0);
+ }
+ /* If a named file was opened, then it needs to be closed. */
+ if (mine->filename[0] != '\0')
+ close(mine->fd);
}
- /* If a named file was opened, then it needs to be closed. */
- if (mine->filename[0] != '\0')
- close(mine->fd);
- if (mine->buffer != NULL)
- free(mine->buffer);
+ free(mine->buffer);
free(mine);
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_private.h b/archivers/libarchive/files/libarchive/archive_read_private.h
index f4d0274b509..5a850189042 100644
--- a/archivers/libarchive/files/libarchive/archive_read_private.h
+++ b/archivers/libarchive/files/libarchive/archive_read_private.h
@@ -22,9 +22,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_read_private.h,v 1.6 2008/03/15 11:09:16 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_read_private.h 201088 2009-12-28 02:18:55Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED
#define ARCHIVE_READ_PRIVATE_H_INCLUDED
@@ -32,6 +36,86 @@
#include "archive_string.h"
#include "archive_private.h"
+struct archive_read;
+struct archive_read_filter_bidder;
+struct archive_read_filter;
+
+/*
+ * How bidding works for filters:
+ * * The bid manager reads the first block from the current source.
+ * * It shows that block to each registered bidder.
+ * * The bid manager creates a new filter structure for the winning
+ * bidder and gives the winning bidder a chance to initialize it.
+ * * The new filter becomes the top filter in the archive_read structure
+ * and we repeat the process.
+ * This ends only when no bidder provides a non-zero bid.
+ */
+struct archive_read_filter_bidder {
+ /* Configuration data for the bidder. */
+ void *data;
+ /* Taste the upstream filter to see if we handle this. */
+ int (*bid)(struct archive_read_filter_bidder *,
+ struct archive_read_filter *);
+ /* Initialize a newly-created filter. */
+ int (*init)(struct archive_read_filter *);
+ /* Set an option for the filter bidder. */
+ int (*options)(struct archive_read_filter_bidder *,
+ const char *key, const char *value);
+ /* Release the bidder's configuration data. */
+ int (*free)(struct archive_read_filter_bidder *);
+};
+
+/*
+ * This structure is allocated within the archive_read core
+ * and initialized by archive_read and the init() method of the
+ * corresponding bidder above.
+ */
+struct archive_read_filter {
+ /* Essentially all filters will need these values, so
+ * just declare them here. */
+ struct archive_read_filter_bidder *bidder; /* My bidder. */
+ struct archive_read_filter *upstream; /* Who I read from. */
+ struct archive_read *archive; /* Associated archive. */
+ /* Return next block. */
+ ssize_t (*read)(struct archive_read_filter *, const void **);
+ /* Skip forward this many bytes. */
+ int64_t (*skip)(struct archive_read_filter *self, int64_t request);
+ /* Close (just this filter) and free(self). */
+ int (*close)(struct archive_read_filter *self);
+ /* My private data. */
+ void *data;
+
+ const char *name;
+ int code;
+
+ /* Used by reblocking logic. */
+ char *buffer;
+ size_t buffer_size;
+ char *next; /* Current read location. */
+ size_t avail; /* Bytes in my buffer. */
+ const void *client_buff; /* Client buffer information. */
+ size_t client_total;
+ const char *client_next;
+ size_t client_avail;
+ int64_t position;
+ char end_of_file;
+ char fatal;
+};
+
+/*
+ * The client looks a lot like a filter, so we just wrap it here.
+ *
+ * TODO: Make archive_read_filter and archive_read_client identical so
+ * that users of the library can easily register their own
+ * transformation filters. This will probably break the API/ABI and
+ * so should be deferred at least until libarchive 3.0.
+ */
+struct archive_read_client {
+ archive_read_callback *reader;
+ archive_skip_callback *skipper;
+ archive_close_callback *closer;
+};
+
struct archive_read {
struct archive archive;
@@ -50,48 +134,19 @@ struct archive_read {
off_t read_data_output_offset;
size_t read_data_remaining;
- /* Callbacks to open/read/write/close archive stream. */
- archive_open_callback *client_opener;
- archive_read_callback *client_reader;
- archive_skip_callback *client_skipper;
- archive_close_callback *client_closer;
- void *client_data;
+ /* Callbacks to open/read/write/close client archive stream. */
+ struct archive_read_client client;
+
+ /* Registered filter bidders. */
+ struct archive_read_filter_bidder bidders[8];
+
+ /* Last filter in chain */
+ struct archive_read_filter *filter;
/* File offset of beginning of most recently-read header. */
off_t header_position;
/*
- * Decompressors have a very specific lifecycle:
- * public setup function initializes a slot in this table
- * 'config' holds minimal configuration data
- * bid() examines a block of data and returns a bid [1]
- * init() is called for successful bidder
- * 'data' is initialized by init()
- * read() returns a pointer to the next block of data
- * consume() indicates how much data is used
- * skip() ignores bytes of data
- * finish() cleans up and frees 'data' and 'config'
- *
- * [1] General guideline: bid the number of bits that you actually
- * test, e.g., 16 if you test a 2-byte magic value.
- */
- struct decompressor_t {
- void *config;
- void *data;
- int (*bid)(const void *buff, size_t);
- int (*init)(struct archive_read *,
- const void *buff, size_t);
- int (*finish)(struct archive_read *);
- ssize_t (*read_ahead)(struct archive_read *,
- const void **, size_t);
- ssize_t (*consume)(struct archive_read *, size_t);
- off_t (*skip)(struct archive_read *, off_t);
- } decompressors[4];
-
- /* Pointer to current decompressor. */
- struct decompressor_t *decompressor;
-
- /*
* Format detection is mostly the same as compression
* detection, with one significant difference: The bidders
* use the read_ahead calls above to examine the stream rather
@@ -101,12 +156,15 @@ struct archive_read {
struct archive_format_descriptor {
void *data;
+ const char *name;
int (*bid)(struct archive_read *);
+ int (*options)(struct archive_read *, const char *key,
+ const char *value);
int (*read_header)(struct archive_read *, struct archive_entry *);
int (*read_data)(struct archive_read *, const void **, size_t *, off_t *);
int (*read_data_skip)(struct archive_read *);
int (*cleanup)(struct archive_read *);
- } formats[8];
+ } formats[9];
struct archive_format_descriptor *format; /* Active format. */
/*
@@ -118,18 +176,24 @@ struct archive_read {
int __archive_read_register_format(struct archive_read *a,
void *format_data,
+ const char *name,
int (*bid)(struct archive_read *),
+ int (*options)(struct archive_read *, const char *, const char *),
int (*read_header)(struct archive_read *, struct archive_entry *),
int (*read_data)(struct archive_read *, const void **, size_t *, off_t *),
int (*read_data_skip)(struct archive_read *),
int (*cleanup)(struct archive_read *));
-struct decompressor_t
- *__archive_read_register_compression(struct archive_read *a,
- int (*bid)(const void *, size_t),
- int (*init)(struct archive_read *, const void *, size_t));
-
-const void
- *__archive_read_ahead(struct archive_read *, size_t);
-
+struct archive_read_filter_bidder
+ *__archive_read_get_bidder(struct archive_read *a);
+
+const void *__archive_read_ahead(struct archive_read *, size_t, ssize_t *);
+const void *__archive_read_filter_ahead(struct archive_read_filter *,
+ size_t, ssize_t *);
+ssize_t __archive_read_consume(struct archive_read *, size_t);
+ssize_t __archive_read_filter_consume(struct archive_read_filter *, size_t);
+int64_t __archive_read_skip(struct archive_read *, int64_t);
+int64_t __archive_read_skip_lenient(struct archive_read *, int64_t);
+int64_t __archive_read_filter_skip(struct archive_read_filter *, int64_t);
+int __archive_read_program(struct archive_read_filter *, const char *);
#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_all.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_all.c
index da2b246bed5..a6db7364d09 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_all.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_all.c
@@ -24,20 +24,37 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_all.c,v 1.6 2007/01/09 08:05:55 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_all.c 201248 2009-12-30 06:12:03Z kientzle $");
#include "archive.h"
int
archive_read_support_compression_all(struct archive *a)
{
-#if HAVE_BZLIB_H
+ /* Bzip falls back to "bunzip2" command-line */
archive_read_support_compression_bzip2(a);
-#endif
/* The decompress code doesn't use an outside library. */
archive_read_support_compression_compress(a);
-#if HAVE_ZLIB_H
+ /* Gzip decompress falls back to "gunzip" command-line. */
archive_read_support_compression_gzip(a);
-#endif
+ /* The LZMA file format has a very weak signature, so it
+ * may not be feasible to keep this here, but we'll try.
+ * This will come back out if there are problems. */
+ /* Lzma falls back to "unlzma" command-line program. */
+ archive_read_support_compression_lzma(a);
+ /* Xz falls back to "unxz" command-line program. */
+ archive_read_support_compression_xz(a);
+ /* The decode code doesn't use an outside library. */
+ archive_read_support_compression_uu(a);
+ /* The decode code doesn't use an outside library. */
+ archive_read_support_compression_rpm(a);
+
+ /* Note: We always return ARCHIVE_OK here, even if some of the
+ * above return ARCHIVE_WARN. The intent here is to enable
+ * "as much as possible." Clients who need specific
+ * compression should enable those individually so they can
+ * verify the level of support. */
+ /* Clear any warning messages set by the above functions. */
+ archive_clear_error(a);
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
index 824b0cdeb56..1e45f22023c 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
@@ -25,7 +25,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.18 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_bzip2.c 201108 2009-12-28 03:28:21Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -51,30 +51,54 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,
#if HAVE_BZLIB_H
struct private_data {
bz_stream stream;
- char *uncompressed_buffer;
- size_t uncompressed_buffer_size;
- char *read_next;
- int64_t total_out;
+ char *out_block;
+ size_t out_block_size;
+ char valid; /* True = decompressor is initialized */
char eof; /* True = found end of compressed data. */
};
-static int finish(struct archive_read *);
-static ssize_t read_ahead(struct archive_read *, const void **, size_t);
-static ssize_t read_consume(struct archive_read *, size_t);
-static int drive_decompressor(struct archive_read *a, struct private_data *);
+/* Bzip2 filter */
+static ssize_t bzip2_filter_read(struct archive_read_filter *, const void **);
+static int bzip2_filter_close(struct archive_read_filter *);
#endif
-/* These two functions are defined even if we lack the library. See below. */
-static int bid(const void *, size_t);
-static int init(struct archive_read *, const void *, size_t);
+/*
+ * Note that we can detect bzip2 archives even if we can't decompress
+ * them. (In fact, we like detecting them because we can give better
+ * error messages.) So the bid framework here gets compiled even
+ * if bzlib is unavailable.
+ */
+static int bzip2_reader_bid(struct archive_read_filter_bidder *, struct archive_read_filter *);
+static int bzip2_reader_init(struct archive_read_filter *);
+static int bzip2_reader_free(struct archive_read_filter_bidder *);
int
archive_read_support_compression_bzip2(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
- if (__archive_read_register_compression(a, bid, init) != NULL)
- return (ARCHIVE_OK);
- return (ARCHIVE_FATAL);
+ struct archive_read_filter_bidder *reader = __archive_read_get_bidder(a);
+
+ if (reader == NULL)
+ return (ARCHIVE_FATAL);
+
+ reader->data = NULL;
+ reader->bid = bzip2_reader_bid;
+ reader->init = bzip2_reader_init;
+ reader->options = NULL;
+ reader->free = bzip2_reader_free;
+#if HAVE_BZLIB_H
+ return (ARCHIVE_OK);
+#else
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+ "Using external bunzip2 program");
+ return (ARCHIVE_WARN);
+#endif
+}
+
+static int
+bzip2_reader_free(struct archive_read_filter_bidder *self){
+ (void)self; /* UNUSED */
+ return (ARCHIVE_OK);
}
/*
@@ -85,59 +109,38 @@ archive_read_support_compression_bzip2(struct archive *_a)
* from verifying as much as we would like.
*/
static int
-bid(const void *buff, size_t len)
+bzip2_reader_bid(struct archive_read_filter_bidder *self, struct archive_read_filter *filter)
{
const unsigned char *buffer;
+ ssize_t avail;
int bits_checked;
- if (len < 1)
- return (0);
-
- buffer = (const unsigned char *)buff;
- bits_checked = 0;
- if (buffer[0] != 'B') /* Verify first ID byte. */
- return (0);
- bits_checked += 8;
- if (len < 2)
- return (bits_checked);
+ (void)self; /* UNUSED */
- if (buffer[1] != 'Z') /* Verify second ID byte. */
+ /* Minimal bzip2 archive is 14 bytes. */
+ buffer = __archive_read_filter_ahead(filter, 14, &avail);
+ if (buffer == NULL)
return (0);
- bits_checked += 8;
- if (len < 3)
- return (bits_checked);
- if (buffer[2] != 'h') /* Verify third ID byte. */
+ /* First three bytes must be "BZh" */
+ bits_checked = 0;
+ if (buffer[0] != 'B' || buffer[1] != 'Z' || buffer[2] != 'h')
return (0);
- bits_checked += 8;
- if (len < 4)
- return (bits_checked);
+ bits_checked += 24;
+ /* Next follows a compression flag which must be an ASCII digit. */
if (buffer[3] < '1' || buffer[3] > '9')
return (0);
bits_checked += 5;
- if (len < 5)
- return (bits_checked);
/* After BZh[1-9], there must be either a data block
* which begins with 0x314159265359 or an end-of-data
* marker of 0x177245385090. */
-
- if (buffer[4] == 0x31) {
- /* Verify the data block signature. */
- size_t s = len;
- if (s > 10) s = 10;
- if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", s - 4) != 0)
- return (0);
- bits_checked += 8 * (s - 4);
- } else if (buffer[4] == 0x17) {
- /* Verify the end-of-data marker. */
- size_t s = len;
- if (s > 10) s = 10;
- if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", s - 4) != 0)
- return (0);
- bits_checked += 8 * (s - 4);
- } else
+ if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", 6) == 0)
+ bits_checked += 48;
+ else if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", 6) == 0)
+ bits_checked += 48;
+ else
return (0);
return (bits_checked);
@@ -151,15 +154,17 @@ bid(const void *buff, size_t len)
* and emit a useful message.
*/
static int
-init(struct archive_read *a, const void *buff, size_t n)
+bzip2_reader_init(struct archive_read_filter *self)
{
- (void)a; /* UNUSED */
- (void)buff; /* UNUSED */
- (void)n; /* UNUSED */
-
- archive_set_error(&a->archive, -1,
- "This version of libarchive was compiled without bzip2 support");
- return (ARCHIVE_FATAL);
+ int r;
+
+ r = __archive_read_program(self, "bunzip2");
+ /* Note: We set the format here even if __archive_read_program()
+ * above fails. We do, after all, know what the format is
+ * even if we weren't able to read it. */
+ self->code = ARCHIVE_COMPRESSION_BZIP2;
+ self->name = "bzip2";
+ return (r);
}
@@ -169,258 +174,180 @@ init(struct archive_read *a, const void *buff, size_t n)
* Setup the callbacks.
*/
static int
-init(struct archive_read *a, const void *buff, size_t n)
+bzip2_reader_init(struct archive_read_filter *self)
{
+ static const size_t out_block_size = 64 * 1024;
+ void *out_block;
struct private_data *state;
- int ret;
- a->archive.compression_code = ARCHIVE_COMPRESSION_BZIP2;
- a->archive.compression_name = "bzip2";
+ self->code = ARCHIVE_COMPRESSION_BZIP2;
+ self->name = "bzip2";
- state = (struct private_data *)malloc(sizeof(*state));
- if (state == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate data for %s decompression",
- a->archive.compression_name);
- return (ARCHIVE_FATAL);
- }
- memset(state, 0, sizeof(*state));
-
- state->uncompressed_buffer_size = 64 * 1024;
- state->uncompressed_buffer = (char *)malloc(state->uncompressed_buffer_size);
- state->stream.next_out = state->uncompressed_buffer;
- state->read_next = state->uncompressed_buffer;
- state->stream.avail_out = state->uncompressed_buffer_size;
-
- if (state->uncompressed_buffer == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate %s decompression buffers",
- a->archive.compression_name);
+ state = (struct private_data *)calloc(sizeof(*state), 1);
+ out_block = (unsigned char *)malloc(out_block_size);
+ if (self == NULL || state == NULL || out_block == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for bzip2 decompression");
+ free(out_block);
free(state);
return (ARCHIVE_FATAL);
}
- /*
- * A bug in bzlib.h: stream.next_in should be marked 'const'
- * but isn't (the library never alters data through the
- * next_in pointer, only reads it). The result: this ugly
- * cast to remove 'const'.
- */
- state->stream.next_in = (char *)(uintptr_t)(const void *)buff;
- state->stream.avail_in = n;
-
- a->decompressor->read_ahead = read_ahead;
- a->decompressor->consume = read_consume;
- a->decompressor->skip = NULL; /* not supported */
- a->decompressor->finish = finish;
-
- /* Initialize compression library. */
- ret = BZ2_bzDecompressInit(&(state->stream),
- 0 /* library verbosity */,
- 0 /* don't use slow low-mem algorithm */);
-
- /* If init fails, try using low-memory algorithm instead. */
- if (ret == BZ_MEM_ERROR) {
- ret = BZ2_bzDecompressInit(&(state->stream),
- 0 /* library verbosity */,
- 1 /* do use slow low-mem algorithm */);
- }
-
- if (ret == BZ_OK) {
- a->decompressor->data = state;
- return (ARCHIVE_OK);
- }
+ self->data = state;
+ state->out_block_size = out_block_size;
+ state->out_block = out_block;
+ self->read = bzip2_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = bzip2_filter_close;
- /* Library setup failed: Clean up. */
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Internal error initializing %s library",
- a->archive.compression_name);
- free(state->uncompressed_buffer);
- free(state);
-
- /* Override the error message if we know what really went wrong. */
- switch (ret) {
- case BZ_PARAM_ERROR:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Internal error initializing compression library: "
- "invalid setup parameter");
- break;
- case BZ_MEM_ERROR:
- archive_set_error(&a->archive, ENOMEM,
- "Internal error initializing compression library: "
- "out of memory");
- break;
- case BZ_CONFIG_ERROR:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Internal error initializing compression library: "
- "mis-compiled library");
- break;
- }
-
- return (ARCHIVE_FATAL);
+ return (ARCHIVE_OK);
}
/*
- * Return a block of data from the decompression buffer. Decompress more
- * as necessary.
+ * Return the next block of decompressed data.
*/
static ssize_t
-read_ahead(struct archive_read *a, const void **p, size_t min)
+bzip2_filter_read(struct archive_read_filter *self, const void **p)
{
struct private_data *state;
- size_t read_avail, was_avail;
- int ret;
-
- state = (struct private_data *)a->decompressor->data;
- if (!a->client_reader) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "No read callback is registered? "
- "This is probably an internal programming error.");
- return (ARCHIVE_FATAL);
- }
+ size_t decompressed;
+ const char *read_buf;
+ ssize_t ret;
- read_avail = state->stream.next_out - state->read_next;
+ state = (struct private_data *)self->data;
- if (read_avail + state->stream.avail_out < min) {
- memmove(state->uncompressed_buffer, state->read_next,
- read_avail);
- state->read_next = state->uncompressed_buffer;
- state->stream.next_out = state->read_next + read_avail;
- state->stream.avail_out
- = state->uncompressed_buffer_size - read_avail;
+ if (state->eof) {
+ *p = NULL;
+ return (0);
}
- while (read_avail < min && /* Haven't satisfied min. */
- read_avail < state->uncompressed_buffer_size) { /* !full */
- was_avail = read_avail;
- if ((ret = drive_decompressor(a, state)) < ARCHIVE_OK)
- return (ret);
- if (ret == ARCHIVE_EOF)
- break; /* Break on EOF even if we haven't met min. */
- read_avail = state->stream.next_out - state->read_next;
- if (was_avail == read_avail) /* No progress? */
- break;
- }
+ /* Empty our output buffer. */
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
- *p = state->read_next;
- return (read_avail);
-}
+ /* Try to fill the output buffer. */
+ for (;;) {
+ if (!state->valid) {
+ if (bzip2_reader_bid(self->bidder, self->upstream) == 0) {
+ state->eof = 1;
+ *p = state->out_block;
+ decompressed = state->stream.next_out
+ - state->out_block;
+ return (decompressed);
+ }
+ /* Initialize compression library. */
+ ret = BZ2_bzDecompressInit(&(state->stream),
+ 0 /* library verbosity */,
+ 0 /* don't use low-mem algorithm */);
+
+ /* If init fails, try low-memory algorithm instead. */
+ if (ret == BZ_MEM_ERROR)
+ ret = BZ2_bzDecompressInit(&(state->stream),
+ 0 /* library verbosity */,
+ 1 /* do use low-mem algo */);
+
+ if (ret != BZ_OK) {
+ const char *detail = NULL;
+ int err = ARCHIVE_ERRNO_MISC;
+ switch (ret) {
+ case BZ_PARAM_ERROR:
+ detail = "invalid setup parameter";
+ break;
+ case BZ_MEM_ERROR:
+ err = ENOMEM;
+ detail = "out of memory";
+ break;
+ case BZ_CONFIG_ERROR:
+ detail = "mis-compiled library";
+ break;
+ }
+ archive_set_error(&self->archive->archive, err,
+ "Internal error initializing decompressor%s%s",
+ detail == NULL ? "" : ": ",
+ detail);
+ return (ARCHIVE_FATAL);
+ }
+ state->valid = 1;
+ }
-/*
- * Mark a previously-returned block of data as read.
- */
-static ssize_t
-read_consume(struct archive_read *a, size_t n)
-{
- struct private_data *state;
+ /* stream.next_in is really const, but bzlib
+ * doesn't declare it so. <sigh> */
+ read_buf =
+ __archive_read_filter_ahead(self->upstream, 1, &ret);
+ if (read_buf == NULL)
+ return (ARCHIVE_FATAL);
+ state->stream.next_in = (char *)(uintptr_t)read_buf;
+ state->stream.avail_in = ret;
+ /* There is no more data, return whatever we have. */
+ if (ret == 0) {
+ state->eof = 1;
+ *p = state->out_block;
+ decompressed = state->stream.next_out
+ - state->out_block;
+ return (decompressed);
+ }
- state = (struct private_data *)a->decompressor->data;
- a->archive.file_position += n;
- state->read_next += n;
- if (state->read_next > state->stream.next_out)
- __archive_errx(1, "Request to consume too many "
- "bytes from bzip2 decompressor");
- return (n);
-}
+ /* Decompress as much as we can in one pass. */
+ ret = BZ2_bzDecompress(&(state->stream));
+ __archive_read_filter_consume(self->upstream,
+ state->stream.next_in - read_buf);
-/*
- * Clean up the decompressor.
- */
-static int
-finish(struct archive_read *a)
-{
- struct private_data *state;
- int ret;
-
- state = (struct private_data *)a->decompressor->data;
- ret = ARCHIVE_OK;
- switch (BZ2_bzDecompressEnd(&(state->stream))) {
- case BZ_OK:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Failed to clean up %s compressor",
- a->archive.compression_name);
- ret = ARCHIVE_FATAL;
+ switch (ret) {
+ case BZ_STREAM_END: /* Found end of stream. */
+ switch (BZ2_bzDecompressEnd(&(state->stream))) {
+ case BZ_OK:
+ break;
+ default:
+ archive_set_error(&(self->archive->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up decompressor");
+ return (ARCHIVE_FATAL);
+ }
+ state->valid = 0;
+ /* FALLTHROUGH */
+ case BZ_OK: /* Decompressor made some progress. */
+ /* If we filled our buffer, update stats and return. */
+ if (state->stream.avail_out == 0) {
+ *p = state->out_block;
+ decompressed = state->stream.next_out
+ - state->out_block;
+ return (decompressed);
+ }
+ break;
+ default: /* Return an error. */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC, "bzip decompression failed");
+ return (ARCHIVE_FATAL);
+ }
}
-
- free(state->uncompressed_buffer);
- free(state);
-
- a->decompressor->data = NULL;
- return (ret);
}
/*
- * Utility function to pull data through decompressor, reading input
- * blocks as necessary.
+ * Clean up the decompressor.
*/
static int
-drive_decompressor(struct archive_read *a, struct private_data *state)
+bzip2_filter_close(struct archive_read_filter *self)
{
- ssize_t ret;
- int decompressed, total_decompressed;
- char *output;
- const void *read_buf;
-
- if (state->eof)
- return (ARCHIVE_EOF);
- total_decompressed = 0;
- for (;;) {
- if (state->stream.avail_in == 0) {
- read_buf = state->stream.next_in;
- ret = (a->client_reader)(&a->archive, a->client_data,
- &read_buf);
- state->stream.next_in = (void *)(uintptr_t)read_buf;
- if (ret < 0) {
- /*
- * TODO: Find a better way to handle
- * this read failure.
- */
- goto fatal;
- }
- if (ret == 0 && total_decompressed == 0) {
- archive_set_error(&a->archive, EIO,
- "Premature end of %s compressed data",
- a->archive.compression_name);
- return (ARCHIVE_FATAL);
- }
- a->archive.raw_position += ret;
- state->stream.avail_in = ret;
- }
-
- {
- output = state->stream.next_out;
-
- /* Decompress some data. */
- ret = BZ2_bzDecompress(&(state->stream));
- decompressed = state->stream.next_out - output;
+ struct private_data *state;
+ int ret = ARCHIVE_OK;
- /* Accumulate the total bytes of output. */
- state->total_out += decompressed;
- total_decompressed += decompressed;
+ state = (struct private_data *)self->data;
- switch (ret) {
- case BZ_OK: /* Decompressor made some progress. */
- if (decompressed > 0)
- return (ARCHIVE_OK);
- break;
- case BZ_STREAM_END: /* Found end of stream. */
- state->eof = 1;
- return (ARCHIVE_OK);
- default:
- /* Any other return value is an error. */
- goto fatal;
- }
+ if (state->valid) {
+ switch (BZ2_bzDecompressEnd(&state->stream)) {
+ case BZ_OK:
+ break;
+ default:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up decompressor");
+ ret = ARCHIVE_FATAL;
}
}
- return (ARCHIVE_OK);
- /* Return a fatal error. */
-fatal:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "%s decompression failed", a->archive.compression_name);
- return (ARCHIVE_FATAL);
+ free(state->out_block);
+ free(state);
+ return (ret);
}
#endif /* HAVE_BZLIB_H */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_compress.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_compress.c
index 050099b210e..2461975e59b 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_compress.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_compress.c
@@ -64,7 +64,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_compress.c,v 1.10 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_compress.c 201094 2009-12-28 02:29:21Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -100,11 +100,8 @@ struct private_data {
size_t bytes_in_section;
/* Output variables. */
- size_t uncompressed_buffer_size;
- void *uncompressed_buffer;
- unsigned char *read_next; /* Data for client. */
- unsigned char *next_out; /* Where to write new data. */
- size_t avail_out; /* Space at end of buffer. */
+ size_t out_block_size;
+ void *out_block;
/* Decompression status variables. */
int use_reset_code;
@@ -133,21 +130,31 @@ struct private_data {
unsigned char stack[65300];
};
-static int bid(const void *, size_t);
-static int finish(struct archive_read *);
-static int init(struct archive_read *, const void *, size_t);
-static ssize_t read_ahead(struct archive_read *, const void **, size_t);
-static ssize_t read_consume(struct archive_read *, size_t);
-static int getbits(struct archive_read *, struct private_data *, int n);
-static int next_code(struct archive_read *a, struct private_data *state);
+static int compress_bidder_bid(struct archive_read_filter_bidder *, struct archive_read_filter *);
+static int compress_bidder_init(struct archive_read_filter *);
+static int compress_bidder_free(struct archive_read_filter_bidder *);
+
+static ssize_t compress_filter_read(struct archive_read_filter *, const void **);
+static int compress_filter_close(struct archive_read_filter *);
+
+static int getbits(struct archive_read_filter *, int n);
+static int next_code(struct archive_read_filter *);
int
archive_read_support_compression_compress(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
- if (__archive_read_register_compression(a, bid, init) != NULL)
- return (ARCHIVE_OK);
- return (ARCHIVE_FATAL);
+ struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = compress_bidder_bid;
+ bidder->init = compress_bidder_init;
+ bidder->options = NULL;
+ bidder->free = compress_bidder_free;
+ return (ARCHIVE_OK);
}
/*
@@ -158,27 +165,28 @@ archive_read_support_compression_compress(struct archive *_a)
* from verifying as much as we would like.
*/
static int
-bid(const void *buff, size_t len)
+compress_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
{
const unsigned char *buffer;
+ ssize_t avail;
int bits_checked;
- if (len < 1)
+ (void)self; /* UNUSED */
+
+ buffer = __archive_read_filter_ahead(filter, 2, &avail);
+
+ if (buffer == NULL)
return (0);
- buffer = (const unsigned char *)buff;
bits_checked = 0;
if (buffer[0] != 037) /* Verify first ID byte. */
return (0);
bits_checked += 8;
- if (len < 2)
- return (bits_checked);
if (buffer[1] != 0235) /* Verify second ID byte. */
return (0);
bits_checked += 8;
- if (len < 3)
- return (bits_checked);
/*
* TODO: Verify more.
@@ -191,60 +199,40 @@ bid(const void *buff, size_t len)
* Setup the callbacks.
*/
static int
-init(struct archive_read *a, const void *buff, size_t n)
+compress_bidder_init(struct archive_read_filter *self)
{
struct private_data *state;
+ static const size_t out_block_size = 64 * 1024;
+ void *out_block;
int code;
- a->archive.compression_code = ARCHIVE_COMPRESSION_COMPRESS;
- a->archive.compression_name = "compress (.Z)";
-
- a->decompressor->read_ahead = read_ahead;
- a->decompressor->consume = read_consume;
- a->decompressor->skip = NULL; /* not supported */
- a->decompressor->finish = finish;
+ self->code = ARCHIVE_COMPRESSION_COMPRESS;
+ self->name = "compress (.Z)";
- state = (struct private_data *)malloc(sizeof(*state));
- if (state == NULL) {
- archive_set_error(&a->archive, ENOMEM,
+ state = (struct private_data *)calloc(sizeof(*state), 1);
+ out_block = malloc(out_block_size);
+ if (state == NULL || out_block == NULL) {
+ free(out_block);
+ free(state);
+ archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for %s decompression",
- a->archive.compression_name);
+ self->name);
return (ARCHIVE_FATAL);
}
- memset(state, 0, sizeof(*state));
- a->decompressor->data = state;
- state->uncompressed_buffer_size = 64 * 1024;
- state->uncompressed_buffer = malloc(state->uncompressed_buffer_size);
+ self->data = state;
+ state->out_block_size = out_block_size;
+ state->out_block = out_block;
+ self->read = compress_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = compress_filter_close;
- if (state->uncompressed_buffer == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate %s decompression buffers",
- a->archive.compression_name);
- goto fatal;
- }
+ /* XXX MOVE THE FOLLOWING OUT OF INIT() XXX */
- state->next_in = (const unsigned char *)buff;
- state->avail_in = n;
- state->read_next = state->next_out = (unsigned char *)state->uncompressed_buffer;
- state->avail_out = state->uncompressed_buffer_size;
-
- code = getbits(a, state, 8);
- if (code != 037) /* This should be impossible. */
- goto fatal;
-
- code = getbits(a, state, 8);
- if (code != 0235) {
- /* This can happen if the library is receiving 1-byte
- * blocks and gzip and compress are both enabled.
- * You can't distinguish gzip and compress only from
- * the first byte. */
- archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
- "Compress signature did not match.");
- goto fatal;
- }
+ (void)getbits(self, 8); /* Skip first signature byte. */
+ (void)getbits(self, 8); /* Skip second signature byte. */
- code = getbits(a, state, 8);
+ code = getbits(self, 8);
state->maxcode_bits = code & 0x1f;
state->maxcode = (1 << state->maxcode_bits);
state->use_reset_code = code & 0x80;
@@ -261,12 +249,9 @@ init(struct archive_read *a, const void *buff, size_t n)
state->prefix[code] = 0;
state->suffix[code] = code;
}
- next_code(a, state);
- return (ARCHIVE_OK);
+ next_code(self);
-fatal:
- finish(a);
- return (ARCHIVE_FATAL);
+ return (ARCHIVE_OK);
}
/*
@@ -274,93 +259,57 @@ fatal:
* as necessary.
*/
static ssize_t
-read_ahead(struct archive_read *a, const void **p, size_t min)
+compress_filter_read(struct archive_read_filter *self, const void **pblock)
{
struct private_data *state;
- size_t read_avail;
+ unsigned char *p, *start, *end;
int ret;
- state = (struct private_data *)a->decompressor->data;
- if (!a->client_reader) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "No read callback is registered? "
- "This is probably an internal programming error.");
- return (ARCHIVE_FATAL);
- }
-
- read_avail = state->next_out - state->read_next;
-
- if (read_avail < min && state->end_of_stream) {
- if (state->end_of_stream == ARCHIVE_EOF)
- return (0);
- else
- return (-1);
+ state = (struct private_data *)self->data;
+ if (state->end_of_stream) {
+ *pblock = NULL;
+ return (0);
}
-
- if (read_avail < min) {
- memmove(state->uncompressed_buffer, state->read_next,
- read_avail);
- state->read_next = (unsigned char *)state->uncompressed_buffer;
- state->next_out = state->read_next + read_avail;
- state->avail_out
- = state->uncompressed_buffer_size - read_avail;
-
- while (read_avail < state->uncompressed_buffer_size
- && !state->end_of_stream) {
- if (state->stackp > state->stack) {
- *state->next_out++ = *--state->stackp;
- state->avail_out--;
- read_avail++;
- } else {
- ret = next_code(a, state);
- if (ret == ARCHIVE_EOF)
- state->end_of_stream = ret;
- else if (ret != ARCHIVE_OK)
- return (ret);
- }
+ p = start = (unsigned char *)state->out_block;
+ end = start + state->out_block_size;
+
+ while (p < end && !state->end_of_stream) {
+ if (state->stackp > state->stack) {
+ *p++ = *--state->stackp;
+ } else {
+ ret = next_code(self);
+ if (ret == -1)
+ state->end_of_stream = ret;
+ else if (ret != ARCHIVE_OK)
+ return (ret);
}
}
- *p = state->read_next;
- return (read_avail);
+ *pblock = start;
+ return (p - start);
}
/*
- * Mark a previously-returned block of data as read.
+ * Clean up the reader.
*/
-static ssize_t
-read_consume(struct archive_read *a, size_t n)
+static int
+compress_bidder_free(struct archive_read_filter_bidder *self)
{
- struct private_data *state;
-
- state = (struct private_data *)a->decompressor->data;
- a->archive.file_position += n;
- state->read_next += n;
- if (state->read_next > state->next_out)
- __archive_errx(1, "Request to consume too many "
- "bytes from compress decompressor");
- return (n);
+ self->data = NULL;
+ return (ARCHIVE_OK);
}
/*
- * Clean up the decompressor.
+ * Close and release the filter.
*/
static int
-finish(struct archive_read *a)
+compress_filter_close(struct archive_read_filter *self)
{
- struct private_data *state;
- int ret = ARCHIVE_OK;
+ struct private_data *state = (struct private_data *)self->data;
- state = (struct private_data *)a->decompressor->data;
-
- if (state != NULL) {
- if (state->uncompressed_buffer != NULL)
- free(state->uncompressed_buffer);
- free(state);
- }
-
- a->decompressor->data = NULL;
- return (ret);
+ free(state->out_block);
+ free(state);
+ return (ARCHIVE_OK);
}
/*
@@ -369,14 +318,15 @@ finish(struct archive_read *a)
* format error, ARCHIVE_EOF if we hit end of data, ARCHIVE_OK otherwise.
*/
static int
-next_code(struct archive_read *a, struct private_data *state)
+next_code(struct archive_read_filter *self)
{
+ struct private_data *state = (struct private_data *)self->data;
int code, newcode;
static int debug_buff[1024];
static unsigned debug_index;
- code = newcode = getbits(a, state, state->bits);
+ code = newcode = getbits(self, state->bits);
if (code < 0)
return (code);
@@ -398,7 +348,7 @@ next_code(struct archive_read *a, struct private_data *state)
skip_bytes %= state->bits;
state->bits_avail = 0; /* Discard rest of this byte. */
while (skip_bytes-- > 0) {
- code = getbits(a, state, 8);
+ code = getbits(self, 8);
if (code < 0)
return (code);
}
@@ -408,12 +358,13 @@ next_code(struct archive_read *a, struct private_data *state)
state->section_end_code = (1 << state->bits) - 1;
state->free_ent = 257;
state->oldcode = -1;
- return (next_code(a, state));
+ return (next_code(self));
}
if (code > state->free_ent) {
/* An invalid code is a fatal error. */
- archive_set_error(&a->archive, -1, "Invalid compressed data");
+ archive_set_error(&(self->archive->archive), -1,
+ "Invalid compressed data");
return (ARCHIVE_FATAL);
}
@@ -457,27 +408,27 @@ next_code(struct archive_read *a, struct private_data *state)
* -1 indicates end of available data.
*/
static int
-getbits(struct archive_read *a, struct private_data *state, int n)
+getbits(struct archive_read_filter *self, int n)
{
- int code, ret;
+ struct private_data *state = (struct private_data *)self->data;
+ int code;
+ ssize_t ret;
static const int mask[] = {
0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
- const void *read_buf;
while (state->bits_avail < n) {
if (state->avail_in <= 0) {
- read_buf = state->next_in;
- ret = (a->client_reader)(&a->archive, a->client_data,
- &read_buf);
- state->next_in = read_buf;
- if (ret < 0)
- return (ARCHIVE_FATAL);
+ state->next_in
+ = __archive_read_filter_ahead(self->upstream,
+ 1, &ret);
if (ret == 0)
- return (ARCHIVE_EOF);
- a->archive.raw_position += ret;
+ return (-1);
+ if (ret < 0 || state->next_in == NULL)
+ return (ARCHIVE_FATAL);
state->avail_in = ret;
+ __archive_read_filter_consume(self->upstream, ret);
}
state->bit_buffer |= *state->next_in++ << state->bits_avail;
state->avail_in--;
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
index 2dac54da0cd..8cc924c9fc1 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
@@ -25,7 +25,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.16 2008/02/19 05:44:59 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_gzip.c 201082 2009-12-28 02:05:28Z kientzle $");
#ifdef HAVE_ERRNO_H
@@ -51,499 +51,415 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v
#ifdef HAVE_ZLIB_H
struct private_data {
z_stream stream;
- unsigned char *uncompressed_buffer;
- size_t uncompressed_buffer_size;
- unsigned char *read_next;
+ char in_stream;
+ unsigned char *out_block;
+ size_t out_block_size;
int64_t total_out;
unsigned long crc;
- char header_done;
char eof; /* True = found end of compressed data. */
};
-static int finish(struct archive_read *);
-static ssize_t read_ahead(struct archive_read *, const void **, size_t);
-static ssize_t read_consume(struct archive_read *, size_t);
-static int drive_decompressor(struct archive_read *a, struct private_data *);
+/* Gzip Filter. */
+static ssize_t gzip_filter_read(struct archive_read_filter *, const void **);
+static int gzip_filter_close(struct archive_read_filter *);
#endif
-/* These two functions are defined even if we lack the library. See below. */
-static int bid(const void *, size_t);
-static int init(struct archive_read *, const void *, size_t);
+/*
+ * Note that we can detect gzip archives even if we can't decompress
+ * them. (In fact, we like detecting them because we can give better
+ * error messages.) So the bid framework here gets compiled even
+ * if zlib is unavailable.
+ *
+ * TODO: If zlib is unavailable, gzip_bidder_init() should
+ * use the compress_program framework to try to fire up an external
+ * gunzip program.
+ */
+static int gzip_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *);
+static int gzip_bidder_init(struct archive_read_filter *);
int
archive_read_support_compression_gzip(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
- if (__archive_read_register_compression(a, bid, init) != NULL)
- return (ARCHIVE_OK);
- return (ARCHIVE_FATAL);
+ struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = gzip_bidder_bid;
+ bidder->init = gzip_bidder_init;
+ bidder->options = NULL;
+ bidder->free = NULL; /* No data, so no cleanup necessary. */
+ /* Signal the extent of gzip support with the return value here. */
+#if HAVE_ZLIB_H
+ return (ARCHIVE_OK);
+#else
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+ "Using external gunzip program");
+ return (ARCHIVE_WARN);
+#endif
}
/*
- * Test whether we can handle this data.
+ * Read and verify the header.
*
- * This logic returns zero if any part of the signature fails. It
- * also tries to Do The Right Thing if a very short buffer prevents us
- * from verifying as much as we would like.
+ * Returns zero if the header couldn't be validated, else returns
+ * number of bytes in header. If pbits is non-NULL, it receives a
+ * count of bits verified, suitable for use by bidder.
*/
static int
-bid(const void *buff, size_t len)
+peek_at_header(struct archive_read_filter *filter, int *pbits)
{
- const unsigned char *buffer;
- int bits_checked;
-
- if (len < 1)
+ const unsigned char *p;
+ ssize_t avail, len;
+ int bits = 0;
+ int header_flags;
+
+ /* Start by looking at the first ten bytes of the header, which
+ * is all fixed layout. */
+ len = 10;
+ p = __archive_read_filter_ahead(filter, len, &avail);
+ if (p == NULL || avail == 0)
return (0);
-
- buffer = (const unsigned char *)buff;
- bits_checked = 0;
- if (buffer[0] != 037) /* Verify first ID byte. */
+ if (p[0] != 037)
return (0);
- bits_checked += 8;
- if (len < 2)
- return (bits_checked);
-
- if (buffer[1] != 0213) /* Verify second ID byte. */
+ bits += 8;
+ if (p[1] != 0213)
return (0);
- bits_checked += 8;
- if (len < 3)
- return (bits_checked);
-
- if (buffer[2] != 8) /* Compression must be 'deflate'. */
+ bits += 8;
+ if (p[2] != 8) /* We only support deflation. */
return (0);
- bits_checked += 8;
- if (len < 4)
- return (bits_checked);
+ bits += 8;
+ if ((p[3] & 0xE0)!= 0) /* No reserved flags set. */
+ return (0);
+ bits += 3;
+ header_flags = p[3];
+ /* Bytes 4-7 are mod time. */
+ /* Byte 8 is deflate flags. */
+ /* XXXX TODO: return deflate flags back to consume_header for use
+ in initializing the decompressor. */
+ /* Byte 9 is OS. */
+
+ /* Optional extra data: 2 byte length plus variable body. */
+ if (header_flags & 4) {
+ p = __archive_read_filter_ahead(filter, len + 2, &avail);
+ if (p == NULL)
+ return (0);
+ len += ((int)p[len + 1] << 8) | (int)p[len];
+ len += 2;
+ }
- if ((buffer[3] & 0xE0)!= 0) /* No reserved flags set. */
+ /* Null-terminated optional filename. */
+ if (header_flags & 8) {
+ do {
+ ++len;
+ if (avail < len)
+ p = __archive_read_filter_ahead(filter,
+ len, &avail);
+ if (p == NULL)
+ return (0);
+ } while (p[len - 1] != 0);
+ }
+
+ /* Null-terminated optional comment. */
+ if (header_flags & 16) {
+ do {
+ ++len;
+ if (avail < len)
+ p = __archive_read_filter_ahead(filter,
+ len, &avail);
+ if (p == NULL)
+ return (0);
+ } while (p[len - 1] != 0);
+ }
+
+ /* Optional header CRC */
+ if ((header_flags & 2)) {
+ p = __archive_read_filter_ahead(filter, len + 2, &avail);
+ if (p == NULL)
+ return (0);
+#if 0
+ int hcrc = ((int)p[len + 1] << 8) | (int)p[len];
+ int crc = /* XXX TODO: Compute header CRC. */;
+ if (crc != hcrc)
return (0);
- bits_checked += 3;
- if (len < 5)
- return (bits_checked);
+ bits += 16;
+#endif
+ len += 2;
+ }
+
+ if (pbits != NULL)
+ *pbits = bits;
+ return (len);
+}
+
+/*
+ * Bidder just verifies the header and returns the number of verified bits.
+ */
+static int
+gzip_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
+{
+ int bits_checked;
- /*
- * TODO: Verify more; in particular, gzip has an optional
- * header CRC, which would give us 16 more verified bits. We
- * may also be able to verify certain constraints on other
- * fields.
- */
+ (void)self; /* UNUSED */
- return (bits_checked);
+ if (peek_at_header(filter, &bits_checked))
+ return (bits_checked);
+ return (0);
}
#ifndef HAVE_ZLIB_H
/*
- * If we don't have the library on this system, we can't actually do the
- * decompression. We can, however, still detect compressed archives
- * and emit a useful message.
+ * If we don't have the library on this system, we can't do the
+ * decompression directly. We can, however, try to run gunzip
+ * in case that's available.
*/
static int
-init(struct archive_read *a, const void *buff, size_t n)
+gzip_bidder_init(struct archive_read_filter *self)
{
- (void)a; /* UNUSED */
- (void)buff; /* UNUSED */
- (void)n; /* UNUSED */
-
- archive_set_error(&a->archive, -1,
- "This version of libarchive was compiled without gzip support");
- return (ARCHIVE_FATAL);
+ int r;
+
+ r = __archive_read_program(self, "gunzip");
+ /* Note: We set the format here even if __archive_read_program()
+ * above fails. We do, after all, know what the format is
+ * even if we weren't able to read it. */
+ self->code = ARCHIVE_COMPRESSION_GZIP;
+ self->name = "gzip";
+ return (r);
}
-
#else
/*
- * Setup the callbacks.
+ * Initialize the filter object.
*/
static int
-init(struct archive_read *a, const void *buff, size_t n)
+gzip_bidder_init(struct archive_read_filter *self)
{
struct private_data *state;
- int ret;
+ static const size_t out_block_size = 64 * 1024;
+ void *out_block;
- a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP;
- a->archive.compression_name = "gzip";
+ self->code = ARCHIVE_COMPRESSION_GZIP;
+ self->name = "gzip";
- state = (struct private_data *)malloc(sizeof(*state));
- if (state == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate data for %s decompression",
- a->archive.compression_name);
- return (ARCHIVE_FATAL);
- }
- memset(state, 0, sizeof(*state));
-
- state->crc = crc32(0L, NULL, 0);
- state->header_done = 0; /* We've not yet begun to parse header... */
-
- state->uncompressed_buffer_size = 64 * 1024;
- state->uncompressed_buffer = (unsigned char *)malloc(state->uncompressed_buffer_size);
- state->stream.next_out = state->uncompressed_buffer;
- state->read_next = state->uncompressed_buffer;
- state->stream.avail_out = state->uncompressed_buffer_size;
-
- if (state->uncompressed_buffer == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate %s decompression buffers",
- a->archive.compression_name);
+ state = (struct private_data *)calloc(sizeof(*state), 1);
+ out_block = (unsigned char *)malloc(out_block_size);
+ if (state == NULL || out_block == NULL) {
+ free(out_block);
free(state);
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for gzip decompression");
return (ARCHIVE_FATAL);
}
- /*
- * A bug in zlib.h: stream.next_in should be marked 'const'
- * but isn't (the library never alters data through the
- * next_in pointer, only reads it). The result: this ugly
- * cast to remove 'const'.
- */
- state->stream.next_in = (Bytef *)(uintptr_t)(const void *)buff;
- state->stream.avail_in = n;
-
- a->decompressor->read_ahead = read_ahead;
- a->decompressor->consume = read_consume;
- a->decompressor->skip = NULL; /* not supported */
- a->decompressor->finish = finish;
-
- /*
- * TODO: Do I need to parse the gzip header before calling
- * inflateInit2()? In particular, one of the header bytes
- * marks "best compression" or "fastest", which may be
- * appropriate for setting the second parameter here.
- * However, I think the only penalty for not setting it
- * correctly is wasted memory. If this is necessary, it
- * should probably go into drive_decompressor() below.
- */
+ self->data = state;
+ state->out_block_size = out_block_size;
+ state->out_block = out_block;
+ self->read = gzip_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = gzip_filter_close;
+
+ state->in_stream = 0; /* We're not actually within a stream yet. */
+
+ return (ARCHIVE_OK);
+}
+
+static int
+consume_header(struct archive_read_filter *self)
+{
+ struct private_data *state;
+ ssize_t avail;
+ size_t len;
+ int ret;
+
+ state = (struct private_data *)self->data;
+
+ /* If this is a real header, consume it. */
+ len = peek_at_header(self->upstream, NULL);
+ if (len == 0)
+ return (ARCHIVE_EOF);
+ __archive_read_filter_consume(self->upstream, len);
+
+ /* Initialize CRC accumulator. */
+ state->crc = crc32(0L, NULL, 0);
/* Initialize compression library. */
+ state->stream.next_in = (unsigned char *)(uintptr_t)
+ __archive_read_filter_ahead(self->upstream, 1, &avail);
+ state->stream.avail_in = avail;
ret = inflateInit2(&(state->stream),
-15 /* Don't check for zlib header */);
- if (ret == Z_OK) {
- a->decompressor->data = state;
- return (ARCHIVE_OK);
- }
-
- /* Library setup failed: Clean up. */
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Internal error initializing %s library",
- a->archive.compression_name);
- free(state->uncompressed_buffer);
- free(state);
- /* Override the error message if we know what really went wrong. */
+ /* Decipher the error code. */
switch (ret) {
+ case Z_OK:
+ state->in_stream = 1;
+ return (ARCHIVE_OK);
case Z_STREAM_ERROR:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
"Internal error initializing compression library: "
"invalid setup parameter");
break;
case Z_MEM_ERROR:
- archive_set_error(&a->archive, ENOMEM,
+ archive_set_error(&self->archive->archive, ENOMEM,
"Internal error initializing compression library: "
"out of memory");
break;
case Z_VERSION_ERROR:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
"Internal error initializing compression library: "
"invalid library version");
break;
+ default:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing compression library: "
+ " Zlib error %d", ret);
+ break;
}
-
return (ARCHIVE_FATAL);
}
-/*
- * Return a block of data from the decompression buffer. Decompress more
- * as necessary.
- */
-static ssize_t
-read_ahead(struct archive_read *a, const void **p, size_t min)
+static int
+consume_trailer(struct archive_read_filter *self)
{
struct private_data *state;
- size_t read_avail, was_avail;
- int ret;
+ const unsigned char *p;
+ ssize_t avail;
+
+ state = (struct private_data *)self->data;
- state = (struct private_data *)a->decompressor->data;
- if (!a->client_reader) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "No read callback is registered? "
- "This is probably an internal programming error.");
+ state->in_stream = 0;
+ switch (inflateEnd(&(state->stream))) {
+ case Z_OK:
+ break;
+ default:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up gzip decompressor");
return (ARCHIVE_FATAL);
}
- read_avail = state->stream.next_out - state->read_next;
+ /* GZip trailer is a fixed 8 byte structure. */
+ p = __archive_read_filter_ahead(self->upstream, 8, &avail);
+ if (p == NULL || avail == 0)
+ return (ARCHIVE_FATAL);
- if (read_avail + state->stream.avail_out < min) {
- memmove(state->uncompressed_buffer, state->read_next,
- read_avail);
- state->read_next = state->uncompressed_buffer;
- state->stream.next_out = state->read_next + read_avail;
- state->stream.avail_out
- = state->uncompressed_buffer_size - read_avail;
- }
+ /* XXX TODO: Verify the length and CRC. */
- while (read_avail < min && /* Haven't satisfied min. */
- read_avail < state->uncompressed_buffer_size) { /* !full */
- was_avail = read_avail;
- if ((ret = drive_decompressor(a, state)) < ARCHIVE_OK)
- return (ret);
- if (ret == ARCHIVE_EOF)
- break; /* Break on EOF even if we haven't met min. */
- read_avail = state->stream.next_out - state->read_next;
- if (was_avail == read_avail) /* No progress? */
- break;
- }
+ /* We've verified the trailer, so consume it now. */
+ __archive_read_filter_consume(self->upstream, 8);
- *p = state->read_next;
- return (read_avail);
+ return (ARCHIVE_OK);
}
-/*
- * Mark a previously-returned block of data as read.
- */
static ssize_t
-read_consume(struct archive_read *a, size_t n)
+gzip_filter_read(struct archive_read_filter *self, const void **p)
{
struct private_data *state;
+ size_t decompressed;
+ ssize_t avail_in;
+ int ret;
- state = (struct private_data *)a->decompressor->data;
- a->archive.file_position += n;
- state->read_next += n;
- if (state->read_next > state->stream.next_out)
- __archive_errx(1, "Request to consume too many "
- "bytes from gzip decompressor");
- return (n);
-}
+ state = (struct private_data *)self->data;
-/*
- * Clean up the decompressor.
- */
-static int
-finish(struct archive_read *a)
-{
- struct private_data *state;
- int ret;
+ /* Empty our output buffer. */
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
- state = (struct private_data *)a->decompressor->data;
- ret = ARCHIVE_OK;
- switch (inflateEnd(&(state->stream))) {
- case Z_OK:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Failed to clean up %s compressor",
- a->archive.compression_name);
- ret = ARCHIVE_FATAL;
- }
+ /* Try to fill the output buffer. */
+ while (state->stream.avail_out > 0 && !state->eof) {
+ /* If we're not in a stream, read a header
+ * and initialize the decompression library. */
+ if (!state->in_stream) {
+ ret = consume_header(self);
+ if (ret == ARCHIVE_EOF) {
+ state->eof = 1;
+ break;
+ }
+ if (ret < ARCHIVE_OK)
+ return (ret);
+ }
- free(state->uncompressed_buffer);
- free(state);
+ /* Peek at the next available data. */
+ /* ZLib treats stream.next_in as const but doesn't declare
+ * it so, hence this ugly cast. */
+ state->stream.next_in = (unsigned char *)(uintptr_t)
+ __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+ if (state->stream.next_in == NULL)
+ return (ARCHIVE_FATAL);
+ state->stream.avail_in = avail_in;
+
+ /* Decompress and consume some of that data. */
+ ret = inflate(&(state->stream), 0);
+ switch (ret) {
+ case Z_OK: /* Decompressor made some progress. */
+ __archive_read_filter_consume(self->upstream,
+ avail_in - state->stream.avail_in);
+ break;
+ case Z_STREAM_END: /* Found end of stream. */
+ __archive_read_filter_consume(self->upstream,
+ avail_in - state->stream.avail_in);
+ /* Consume the stream trailer; release the
+ * decompression library. */
+ ret = consume_trailer(self);
+ if (ret < ARCHIVE_OK)
+ return (ret);
+ break;
+ default:
+ /* Return an error. */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "gzip decompression failed");
+ return (ARCHIVE_FATAL);
+ }
+ }
- a->decompressor->data = NULL;
- return (ret);
+ /* We've read as much as we can. */
+ decompressed = state->stream.next_out - state->out_block;
+ state->total_out += decompressed;
+ if (decompressed == 0)
+ *p = NULL;
+ else
+ *p = state->out_block;
+ return (decompressed);
}
/*
- * Utility function to pull data through decompressor, reading input
- * blocks as necessary.
+ * Clean up the decompressor.
*/
static int
-drive_decompressor(struct archive_read *a, struct private_data *state)
+gzip_filter_close(struct archive_read_filter *self)
{
- ssize_t ret;
- size_t decompressed, total_decompressed;
- int count, flags, header_state;
- unsigned char *output;
- unsigned char b;
- const void *read_buf;
-
- if (state->eof)
- return (ARCHIVE_EOF);
- flags = 0;
- count = 0;
- header_state = 0;
- total_decompressed = 0;
- for (;;) {
- if (state->stream.avail_in == 0) {
- read_buf = state->stream.next_in;
- ret = (a->client_reader)(&a->archive, a->client_data,
- &read_buf);
- state->stream.next_in = (unsigned char *)(uintptr_t)read_buf;
- if (ret < 0) {
- /*
- * TODO: Find a better way to handle
- * this read failure.
- */
- goto fatal;
- }
- if (ret == 0 && total_decompressed == 0) {
- archive_set_error(&a->archive, EIO,
- "Premature end of %s compressed data",
- a->archive.compression_name);
- return (ARCHIVE_FATAL);
- }
- a->archive.raw_position += ret;
- state->stream.avail_in = ret;
- }
+ struct private_data *state;
+ int ret;
- if (!state->header_done) {
- /*
- * If still parsing the header, interpret the
- * next byte.
- */
- b = *(state->stream.next_in++);
- state->stream.avail_in--;
-
- /*
- * Yes, this is somewhat crude, but it works,
- * GZip format isn't likely to change anytime
- * in the near future, and header parsing is
- * certainly not a performance issue, so
- * there's little point in making this more
- * elegant. Of course, if you see an easy way
- * to make this more elegant, please let me
- * know.. ;-)
- */
- switch (header_state) {
- case 0: /* First byte of signature. */
- if (b != 037)
- goto fatal;
- header_state = 1;
- break;
- case 1: /* Second byte of signature. */
- if (b != 0213)
- goto fatal;
- header_state = 2;
- break;
- case 2: /* Compression type must be 8. */
- if (b != 8)
- goto fatal;
- header_state = 3;
- break;
- case 3: /* GZip flags. */
- flags = b;
- header_state = 4;
- break;
- case 4: case 5: case 6: case 7: /* Mod time. */
- header_state++;
- break;
- case 8: /* Deflate flags. */
- header_state = 9;
- break;
- case 9: /* OS. */
- header_state = 10;
- break;
- case 10: /* Optional Extra: First byte of Length. */
- if ((flags & 4)) {
- count = 255 & (int)b;
- header_state = 11;
- break;
- }
- /*
- * Fall through if there is no
- * Optional Extra field.
- */
- case 11: /* Optional Extra: Second byte of Length. */
- if ((flags & 4)) {
- count = (0xff00 & ((int)b << 8)) | count;
- header_state = 12;
- break;
- }
- /*
- * Fall through if there is no
- * Optional Extra field.
- */
- case 12: /* Optional Extra Field: counted length. */
- if ((flags & 4)) {
- --count;
- if (count == 0) header_state = 13;
- else header_state = 12;
- break;
- }
- /*
- * Fall through if there is no
- * Optional Extra field.
- */
- case 13: /* Optional Original Filename. */
- if ((flags & 8)) {
- if (b == 0) header_state = 14;
- else header_state = 13;
- break;
- }
- /*
- * Fall through if no Optional
- * Original Filename.
- */
- case 14: /* Optional Comment. */
- if ((flags & 16)) {
- if (b == 0) header_state = 15;
- else header_state = 14;
- break;
- }
- /* Fall through if no Optional Comment. */
- case 15: /* Optional Header CRC: First byte. */
- if ((flags & 2)) {
- header_state = 16;
- break;
- }
- /* Fall through if no Optional Header CRC. */
- case 16: /* Optional Header CRC: Second byte. */
- if ((flags & 2)) {
- header_state = 17;
- break;
- }
- /* Fall through if no Optional Header CRC. */
- case 17: /* First byte of compressed data. */
- state->header_done = 1; /* done with header */
- state->stream.avail_in++;
- state->stream.next_in--;
- }
+ state = (struct private_data *)self->data;
+ ret = ARCHIVE_OK;
- /*
- * TODO: Consider moving the inflateInit2 call
- * here so it can include the compression type
- * from the header?
- */
- } else {
- output = state->stream.next_out;
-
- /* Decompress some data. */
- ret = inflate(&(state->stream), 0);
- decompressed = state->stream.next_out - output;
-
- /* Accumulate the CRC of the uncompressed data. */
- state->crc = crc32(state->crc, output, decompressed);
-
- /* Accumulate the total bytes of output. */
- state->total_out += decompressed;
- total_decompressed += decompressed;
-
- switch (ret) {
- case Z_OK: /* Decompressor made some progress. */
- if (decompressed > 0)
- return (ARCHIVE_OK);
- break;
- case Z_STREAM_END: /* Found end of stream. */
- /*
- * TODO: Verify gzip trailer
- * (uncompressed length and CRC).
- */
- state->eof = 1;
- return (ARCHIVE_OK);
- default:
- /* Any other return value is an error. */
- goto fatal;
- }
+ if (state->in_stream) {
+ switch (inflateEnd(&(state->stream))) {
+ case Z_OK:
+ break;
+ default:
+ archive_set_error(&(self->archive->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up gzip compressor");
+ ret = ARCHIVE_FATAL;
}
}
- return (ARCHIVE_OK);
- /* Return a fatal error. */
-fatal:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "%s decompression failed", a->archive.compression_name);
- return (ARCHIVE_FATAL);
+ free(state->out_block);
+ free(state);
+ return (ret);
}
#endif /* HAVE_ZLIB_H */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
index 3f17756abae..955d06d9aa1 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
@@ -24,347 +24,17 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.19 2007/12/30 04:58:21 kientzle Exp $");
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_none.c 185679 2008-12-06 06:45:15Z kientzle $");
#include "archive.h"
-#include "archive_private.h"
-#include "archive_read_private.h"
-
-struct archive_decompress_none {
- char *buffer;
- size_t buffer_size;
- char *next; /* Current read location. */
- size_t avail; /* Bytes in my buffer. */
- const void *client_buff; /* Client buffer information. */
- size_t client_total;
- const char *client_next;
- size_t client_avail;
- char end_of_file;
- char fatal;
-};
/*
- * Size of internal buffer used for combining short reads. This is
- * also an upper limit on the size of a read request. Recall,
- * however, that we can (and will!) return blocks of data larger than
- * this. The read semantics are: you ask for a minimum, I give you a
- * pointer to my best-effort match and tell you how much data is
- * there. It could be less than you asked for, it could be much more.
- * For example, a client might use mmap() to "read" the entire file as
- * a single block. In that case, I will return that entire block to
- * my clients.
+ * Uncompressed streams are handled implicitly by the read core,
+ * so this is now a no-op.
*/
-#define BUFFER_SIZE 65536
-
-#define minimum(a, b) (a < b ? a : b)
-
-static int archive_decompressor_none_bid(const void *, size_t);
-static int archive_decompressor_none_finish(struct archive_read *);
-static int archive_decompressor_none_init(struct archive_read *,
- const void *, size_t);
-static ssize_t archive_decompressor_none_read_ahead(struct archive_read *,
- const void **, size_t);
-static ssize_t archive_decompressor_none_read_consume(struct archive_read *,
- size_t);
-static off_t archive_decompressor_none_skip(struct archive_read *, off_t);
-
int
-archive_read_support_compression_none(struct archive *_a)
+archive_read_support_compression_none(struct archive *a)
{
- struct archive_read *a = (struct archive_read *)_a;
- if (__archive_read_register_compression(a,
- archive_decompressor_none_bid,
- archive_decompressor_none_init) != NULL)
- return (ARCHIVE_OK);
- return (ARCHIVE_FATAL);
-}
-
-/*
- * Try to detect an "uncompressed" archive.
- */
-static int
-archive_decompressor_none_bid(const void *buff, size_t len)
-{
- (void)buff;
- (void)len;
-
- return (1); /* Default: We'll take it if noone else does. */
-}
-
-static int
-archive_decompressor_none_init(struct archive_read *a, const void *buff, size_t n)
-{
- struct archive_decompress_none *state;
-
- a->archive.compression_code = ARCHIVE_COMPRESSION_NONE;
- a->archive.compression_name = "none";
-
- state = (struct archive_decompress_none *)malloc(sizeof(*state));
- if (!state) {
- archive_set_error(&a->archive, ENOMEM, "Can't allocate input data");
- return (ARCHIVE_FATAL);
- }
- memset(state, 0, sizeof(*state));
-
- state->buffer_size = BUFFER_SIZE;
- state->buffer = (char *)malloc(state->buffer_size);
- state->next = state->buffer;
- if (state->buffer == NULL) {
- free(state);
- archive_set_error(&a->archive, ENOMEM, "Can't allocate input buffer");
- return (ARCHIVE_FATAL);
- }
-
- /* Save reference to first block of data. */
- state->client_buff = buff;
- state->client_total = n;
- state->client_next = state->client_buff;
- state->client_avail = state->client_total;
-
- a->decompressor->data = state;
- a->decompressor->read_ahead = archive_decompressor_none_read_ahead;
- a->decompressor->consume = archive_decompressor_none_read_consume;
- a->decompressor->skip = archive_decompressor_none_skip;
- a->decompressor->finish = archive_decompressor_none_finish;
-
- return (ARCHIVE_OK);
-}
-
-/*
- * We just pass through pointers to the client buffer if we can.
- * If the client buffer is short, then we copy stuff to our internal
- * buffer to combine reads.
- */
-static ssize_t
-archive_decompressor_none_read_ahead(struct archive_read *a, const void **buff,
- size_t min)
-{
- struct archive_decompress_none *state;
- ssize_t bytes_read;
-
- state = (struct archive_decompress_none *)a->decompressor->data;
- if (state->fatal)
- return (-1);
-
- /*
- * Don't make special efforts to handle requests larger than
- * the copy buffer.
- */
- if (min > state->buffer_size)
- min = state->buffer_size;
-
- /*
- * Keep pulling more data until we can satisfy the request.
- */
- for (;;) {
-
- /*
- * If we can satisfy from the copy buffer, we're done.
- */
- if (state->avail >= min) {
- *buff = state->next;
- return (state->avail);
- }
-
- /*
- * We can satisfy directly from client buffer if everything
- * currently in the copy buffer is still in the client buffer.
- */
- if (state->client_total >= state->client_avail + state->avail
- && state->client_avail + state->avail >= min) {
- /* "Roll back" to client buffer. */
- state->client_avail += state->avail;
- state->client_next -= state->avail;
- /* Copy buffer is now empty. */
- state->avail = 0;
- state->next = state->buffer;
- /* Return data from client buffer. */
- *buff = state->client_next;
- return (state->client_avail);
- }
-
- /* Move data forward in copy buffer if necessary. */
- if (state->next > state->buffer &&
- state->next + min > state->buffer + state->buffer_size) {
- if (state->avail > 0)
- memmove(state->buffer, state->next, state->avail);
- state->next = state->buffer;
- }
-
- /* If we've used up the client data, get more. */
- if (state->client_avail <= 0) {
- bytes_read = (a->client_reader)(&a->archive,
- a->client_data, &state->client_buff);
- if (bytes_read < 0) { /* Read error. */
- state->client_total = state->client_avail = 0;
- state->client_next = state->client_buff = NULL;
- state->fatal = 1;
- return (-1);
- }
- if (bytes_read == 0) { /* End-of-file. */
- state->client_total = state->client_avail = 0;
- state->client_next = state->client_buff = NULL;
- state->end_of_file = 1;
- /* Return whatever we do have. */
- *buff = state->next;
- return (state->avail);
- }
- a->archive.raw_position += bytes_read;
- state->client_total = bytes_read;
- state->client_avail = state->client_total;
- state->client_next = state->client_buff;
- }
- else
- {
- /* We can add client data to copy buffer. */
- /* First estimate: copy to fill rest of buffer. */
- size_t tocopy = (state->buffer + state->buffer_size)
- - (state->next + state->avail);
- /* Don't copy more than is available. */
- if (tocopy > state->client_avail)
- tocopy = state->client_avail;
- memcpy(state->next + state->avail, state->client_next,
- tocopy);
- /* Remove this data from client buffer. */
- state->client_next += tocopy;
- state->client_avail -= tocopy;
- /* add it to copy buffer. */
- state->avail += tocopy;
- }
- }
-}
-
-/*
- * Mark the appropriate data as used. Note that the request here will
- * often be much smaller than the size of the previous read_ahead
- * request.
- */
-static ssize_t
-archive_decompressor_none_read_consume(struct archive_read *a, size_t request)
-{
- struct archive_decompress_none *state;
-
- state = (struct archive_decompress_none *)a->decompressor->data;
- if (state->avail > 0) {
- /* Read came from copy buffer. */
- state->next += request;
- state->avail -= request;
- } else {
- /* Read came from client buffer. */
- state->client_next += request;
- state->client_avail -= request;
- }
- a->archive.file_position += request;
- return (request);
-}
-
-/*
- * Skip forward by exactly the requested bytes or else return
- * ARCHIVE_FATAL. Note that this differs from the contract for
- * read_ahead, which does not guarantee a minimum count.
- */
-static off_t
-archive_decompressor_none_skip(struct archive_read *a, off_t request)
-{
- struct archive_decompress_none *state;
- off_t bytes_skipped, total_bytes_skipped = 0;
- size_t min;
-
- state = (struct archive_decompress_none *)a->decompressor->data;
- if (state->fatal)
- return (-1);
- /*
- * If there is data in the buffers already, use that first.
- */
- if (state->avail > 0) {
- min = minimum(request, (off_t)state->avail);
- bytes_skipped = archive_decompressor_none_read_consume(a, min);
- request -= bytes_skipped;
- total_bytes_skipped += bytes_skipped;
- }
- if (state->client_avail > 0) {
- min = minimum(request, (off_t)state->client_avail);
- bytes_skipped = archive_decompressor_none_read_consume(a, min);
- request -= bytes_skipped;
- total_bytes_skipped += bytes_skipped;
- }
- if (request == 0)
- return (total_bytes_skipped);
- /*
- * If a client_skipper was provided, try that first.
- */
-#if ARCHIVE_API_VERSION < 2
- if ((a->client_skipper != NULL) && (request < SSIZE_MAX)) {
-#else
- if (a->client_skipper != NULL) {
-#endif
- bytes_skipped = (a->client_skipper)(&a->archive,
- a->client_data, request);
- if (bytes_skipped < 0) { /* error */
- state->client_total = state->client_avail = 0;
- state->client_next = state->client_buff = NULL;
- state->fatal = 1;
- return (bytes_skipped);
- }
- total_bytes_skipped += bytes_skipped;
- a->archive.file_position += bytes_skipped;
- request -= bytes_skipped;
- state->client_next = state->client_buff;
- a->archive.raw_position += bytes_skipped;
- state->client_avail = state->client_total = 0;
- }
- /*
- * Note that client_skipper will usually not satisfy the
- * full request (due to low-level blocking concerns),
- * so even if client_skipper is provided, we may still
- * have to use ordinary reads to finish out the request.
- */
- while (request > 0) {
- const void* dummy_buffer;
- ssize_t bytes_read;
- bytes_read = archive_decompressor_none_read_ahead(a,
- &dummy_buffer, 1);
- if (bytes_read < 0)
- return (bytes_read);
- if (bytes_read == 0) {
- /* We hit EOF before we satisfied the skip request. */
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Truncated input file (need to skip %jd bytes)",
- (intmax_t)request);
- return (ARCHIVE_FATAL);
- }
- min = (size_t)(minimum(bytes_read, request));
- bytes_read = archive_decompressor_none_read_consume(a, min);
- total_bytes_skipped += bytes_read;
- request -= bytes_read;
- }
- return (total_bytes_skipped);
-}
-
-static int
-archive_decompressor_none_finish(struct archive_read *a)
-{
- struct archive_decompress_none *state;
-
- state = (struct archive_decompress_none *)a->decompressor->data;
- free(state->buffer);
- free(state);
- a->decompressor->data = NULL;
+ (void)a; /* UNUSED */
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c
index 4f25d6ed561..0c63f2e8312 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c
@@ -24,25 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.c,v 1.4 2008/06/15 10:45:57 kientzle Exp $");
-
-/* This capability is only available on POSIX systems. */
-#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
- !(defined(HAVE_FORK) || defined(HAVE_VFORK))
-
-/*
- * On non-Posix systems, allow the program to build, but choke if
- * this function is actually invoked.
- */
-int
-archive_read_support_compression_program(struct archive *_a, const char *cmd)
-{
- archive_set_error(_a, -1,
- "External compression programs not supported on this platform");
- return (ARCHIVE_FATAL);
-}
-
-#else
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_program.c 201112 2009-12-28 06:59:35Z kientzle $");
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
@@ -56,6 +38,9 @@ archive_read_support_compression_program(struct archive *_a, const char *cmd)
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
@@ -70,272 +55,405 @@ archive_read_support_compression_program(struct archive *_a, const char *cmd)
#include "archive_private.h"
#include "archive_read_private.h"
+int
+archive_read_support_compression_program(struct archive *a, const char *cmd)
+{
+ return (archive_read_support_compression_program_signature(a, cmd, NULL, 0));
+}
+
+
+/* This capability is only available on POSIX systems. */
+#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+ !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__))
+
+/*
+ * On non-Posix systems, allow the program to build, but choke if
+ * this function is actually invoked.
+ */
+int
+archive_read_support_compression_program_signature(struct archive *_a,
+ const char *cmd, void *signature, size_t signature_len)
+{
+ (void)_a; /* UNUSED */
+ (void)cmd; /* UNUSED */
+ (void)signature; /* UNUSED */
+ (void)signature_len; /* UNUSED */
+
+ archive_set_error(_a, -1,
+ "External compression programs not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+
+int
+__archive_read_program(struct archive_read_filter *self, const char *cmd)
+{
+ (void)self; /* UNUSED */
+ (void)cmd; /* UNUSED */
+
+ archive_set_error(&self->archive->archive, -1,
+ "External compression programs not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+
+#else
+
#include "filter_fork.h"
-struct archive_decompress_program {
+/*
+ * The bidder object stores the command and the signature to watch for.
+ * The 'inhibit' entry here is used to ensure that unchecked filters never
+ * bid twice in the same pipeline.
+ */
+struct program_bidder {
+ char *cmd;
+ void *signature;
+ size_t signature_len;
+ int inhibit;
+};
+
+static int program_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *upstream);
+static int program_bidder_init(struct archive_read_filter *);
+static int program_bidder_free(struct archive_read_filter_bidder *);
+
+/*
+ * The actual filter needs to track input and output data.
+ */
+struct program_filter {
char *description;
pid_t child;
+ int exit_status;
+ int waitpid_return;
int child_stdin, child_stdout;
- char *child_out_buf;
- char *child_out_buf_next;
- size_t child_out_buf_len, child_out_buf_avail;
-
- const char *child_in_buf;
- size_t child_in_buf_avail;
+ char *out_buf;
+ size_t out_buf_len;
};
-static int archive_decompressor_program_bid(const void *, size_t);
-static int archive_decompressor_program_finish(struct archive_read *);
-static int archive_decompressor_program_init(struct archive_read *,
- const void *, size_t);
-static ssize_t archive_decompressor_program_read_ahead(struct archive_read *,
- const void **, size_t);
-static ssize_t archive_decompressor_program_read_consume(struct archive_read *,
- size_t);
+static ssize_t program_filter_read(struct archive_read_filter *,
+ const void **);
+static int program_filter_close(struct archive_read_filter *);
int
-archive_read_support_compression_program(struct archive *_a, const char *cmd)
+archive_read_support_compression_program_signature(struct archive *_a,
+ const char *cmd, const void *signature, size_t signature_len)
{
struct archive_read *a = (struct archive_read *)_a;
- struct decompressor_t *decompressor;
+ struct archive_read_filter_bidder *bidder;
+ struct program_bidder *state;
+
+ /*
+ * Get a bidder object from the read core.
+ */
+ bidder = __archive_read_get_bidder(a);
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
- if (cmd == NULL || *cmd == '\0')
- return (ARCHIVE_WARN);
+ /*
+ * Allocate our private state.
+ */
+ state = (struct program_bidder *)calloc(sizeof (*state), 1);
+ if (state == NULL)
+ return (ARCHIVE_FATAL);
+ state->cmd = strdup(cmd);
+ if (signature != NULL && signature_len > 0) {
+ state->signature_len = signature_len;
+ state->signature = malloc(signature_len);
+ memcpy(state->signature, signature, signature_len);
+ }
- decompressor = __archive_read_register_compression(a,
- archive_decompressor_program_bid,
- archive_decompressor_program_init);
- if (decompressor == NULL)
- return (ARCHIVE_WARN);
+ /*
+ * Fill in the bidder object.
+ */
+ bidder->data = state;
+ bidder->bid = program_bidder_bid;
+ bidder->init = program_bidder_init;
+ bidder->options = NULL;
+ bidder->free = program_bidder_free;
+ return (ARCHIVE_OK);
+}
- decompressor->config = strdup(cmd);
+static int
+program_bidder_free(struct archive_read_filter_bidder *self)
+{
+ struct program_bidder *state = (struct program_bidder *)self->data;
+ free(state->cmd);
+ free(state->signature);
+ free(self->data);
return (ARCHIVE_OK);
}
/*
- * If the user used us to register, they must really want us to
- * handle it, so this module always bids INT_MAX.
+ * If we do have a signature, bid only if that matches.
+ *
+ * If there's no signature, we bid INT_MAX the first time
+ * we're called, then never bid again.
*/
static int
-archive_decompressor_program_bid(const void *buff, size_t len)
+program_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *upstream)
{
- (void)buff; /* UNUSED */
- (void)len; /* UNUSED */
+ struct program_bidder *state = self->data;
+ const char *p;
+
+ /* If we have a signature, use that to match. */
+ if (state->signature_len > 0) {
+ p = __archive_read_filter_ahead(upstream,
+ state->signature_len, NULL);
+ if (p == NULL)
+ return (0);
+ /* No match, so don't bid. */
+ if (memcmp(p, state->signature, state->signature_len) != 0)
+ return (0);
+ return ((int)state->signature_len * 8);
+ }
- return (INT_MAX); /* Default: We'll take it. */
+ /* Otherwise, bid once and then never bid again. */
+ if (state->inhibit)
+ return (0);
+ state->inhibit = 1;
+ return (INT_MAX);
}
-static ssize_t
-child_read(struct archive_read *a, char *buf, size_t buf_len)
+/*
+ * Shut down the child, return ARCHIVE_OK if it exited normally.
+ *
+ * Note that the return value is sticky; if we're called again,
+ * we won't reap the child again, but we will return the same status
+ * (including error message if the child came to a bad end).
+ */
+static int
+child_stop(struct archive_read_filter *self, struct program_filter *state)
{
- struct archive_decompress_program *state = a->decompressor->data;
- ssize_t ret, requested;
- const void *child_buf;
+ /* Close our side of the I/O with the child. */
+ if (state->child_stdin != -1) {
+ close(state->child_stdin);
+ state->child_stdin = -1;
+ }
+ if (state->child_stdout != -1) {
+ close(state->child_stdout);
+ state->child_stdout = -1;
+ }
- if (state->child_stdout == -1)
- return (-1);
+ if (state->child != 0) {
+ /* Reap the child. */
+ do {
+ state->waitpid_return
+ = waitpid(state->child, &state->exit_status, 0);
+ } while (state->waitpid_return == -1 && errno == EINTR);
+ state->child = 0;
+ }
- if (buf_len == 0)
- return (-1);
+ if (state->waitpid_return < 0) {
+ /* waitpid() failed? This is ugly. */
+ archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+ "Child process exited badly");
+ return (ARCHIVE_WARN);
+ }
-restart_read:
- requested = buf_len > SSIZE_MAX ? SSIZE_MAX : buf_len;
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ if (WIFSIGNALED(state->exit_status)) {
+#ifdef SIGPIPE
+ /* If the child died because we stopped reading before
+ * it was done, that's okay. Some archive formats
+ * have padding at the end that we routinely ignore. */
+ /* The alternative to this would be to add a step
+ * before close(child_stdout) above to read from the
+ * child until the child has no more to write. */
+ if (WTERMSIG(state->exit_status) == SIGPIPE)
+ return (ARCHIVE_OK);
+#endif
+ archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+ "Child process exited with signal %d",
+ WTERMSIG(state->exit_status));
+ return (ARCHIVE_WARN);
+ }
+#endif /* !_WIN32 || __CYGWIN__ */
- do {
- ret = read(state->child_stdout, buf, requested);
- } while (ret == -1 && errno == EINTR);
+ if (WIFEXITED(state->exit_status)) {
+ if (WEXITSTATUS(state->exit_status) == 0)
+ return (ARCHIVE_OK);
- if (ret > 0)
- return (ret);
- if (ret == 0 || (ret == -1 && errno == EPIPE)) {
- close(state->child_stdout);
- state->child_stdout = -1;
- return (0);
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Child process exited with status %d",
+ WEXITSTATUS(state->exit_status));
+ return (ARCHIVE_WARN);
}
- if (ret == -1 && errno != EAGAIN)
- return (-1);
- if (state->child_in_buf_avail == 0) {
- child_buf = state->child_in_buf;
- ret = (a->client_reader)(&a->archive,
- a->client_data,&child_buf);
- state->child_in_buf = (const char *)child_buf;
+ return (ARCHIVE_WARN);
+}
+
+/*
+ * Use select() to decide whether the child is ready for read or write.
+ */
+static ssize_t
+child_read(struct archive_read_filter *self, char *buf, size_t buf_len)
+{
+ struct program_filter *state = self->data;
+ ssize_t ret, requested, avail;
+ const char *p;
+
+ requested = buf_len > SSIZE_MAX ? SSIZE_MAX : buf_len;
- if (ret < 0) {
+ for (;;) {
+ do {
+ ret = read(state->child_stdout, buf, requested);
+ } while (ret == -1 && errno == EINTR);
+
+ if (ret > 0)
+ return (ret);
+ if (ret == 0 || (ret == -1 && errno == EPIPE))
+ /* Child has closed its output; reap the child
+ * and return the status. */
+ return (child_stop(self, state));
+ if (ret == -1 && errno != EAGAIN)
+ return (-1);
+
+ if (state->child_stdin == -1) {
+ /* Block until child has some I/O ready. */
+ __archive_check_child(state->child_stdin,
+ state->child_stdout);
+ continue;
+ }
+
+ /* Get some more data from upstream. */
+ p = __archive_read_filter_ahead(self->upstream, 1, &avail);
+ if (p == NULL) {
close(state->child_stdin);
state->child_stdin = -1;
fcntl(state->child_stdout, F_SETFL, 0);
- return (-1);
+ if (avail < 0)
+ return (avail);
+ continue;
}
- if (ret == 0) {
+
+ do {
+ ret = write(state->child_stdin, p, avail);
+ } while (ret == -1 && errno == EINTR);
+
+ if (ret > 0) {
+ /* Consume whatever we managed to write. */
+ __archive_read_filter_consume(self->upstream, ret);
+ } else if (ret == -1 && errno == EAGAIN) {
+ /* Block until child has some I/O ready. */
+ __archive_check_child(state->child_stdin,
+ state->child_stdout);
+ } else {
+ /* Write failed. */
close(state->child_stdin);
state->child_stdin = -1;
fcntl(state->child_stdout, F_SETFL, 0);
- goto restart_read;
+ /* If it was a bad error, we're done; otherwise
+ * it was EPIPE or EOF, and we can still read
+ * from the child. */
+ if (ret == -1 && errno != EPIPE)
+ return (-1);
}
- state->child_in_buf_avail = ret;
- }
-
- if (state->child_stdin == -1) {
- fcntl(state->child_stdout, F_SETFL, 0);
- __archive_check_child(state->child_stdin, state->child_stdout);
- goto restart_read;
- }
-
- do {
- ret = write(state->child_stdin, state->child_in_buf,
- state->child_in_buf_avail);
- } while (ret == -1 && errno == EINTR);
-
- if (ret > 0) {
- state->child_in_buf += ret;
- state->child_in_buf_avail -= ret;
- goto restart_read;
- } else if (ret == -1 && errno == EAGAIN) {
- __archive_check_child(state->child_stdin, state->child_stdout);
- goto restart_read;
- } else if (ret == 0 || (ret == -1 && errno == EPIPE)) {
- close(state->child_stdin);
- state->child_stdin = -1;
- fcntl(state->child_stdout, F_SETFL, 0);
- goto restart_read;
- } else {
- close(state->child_stdin);
- state->child_stdin = -1;
- fcntl(state->child_stdout, F_SETFL, 0);
- return (-1);
}
}
-static int
-archive_decompressor_program_init(struct archive_read *a, const void *buff, size_t n)
+int
+__archive_read_program(struct archive_read_filter *self, const char *cmd)
{
- struct archive_decompress_program *state;
- const char *cmd = a->decompressor->config;
+ struct program_filter *state;
+ static const size_t out_buf_len = 65536;
+ char *out_buf;
+ char *description;
const char *prefix = "Program: ";
-
- state = (struct archive_decompress_program *)malloc(sizeof(*state));
- if (!state) {
- archive_set_error(&a->archive, ENOMEM,
+ state = (struct program_filter *)calloc(1, sizeof(*state));
+ out_buf = (char *)malloc(out_buf_len);
+ description = (char *)malloc(strlen(prefix) + strlen(cmd) + 1);
+ if (state == NULL || out_buf == NULL || description == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate input data");
+ free(state);
+ free(out_buf);
+ free(description);
return (ARCHIVE_FATAL);
}
- a->archive.compression_code = ARCHIVE_COMPRESSION_PROGRAM;
- state->description = (char *)malloc(strlen(prefix) + strlen(cmd) + 1);
+ self->code = ARCHIVE_COMPRESSION_PROGRAM;
+ state->description = description;
strcpy(state->description, prefix);
strcat(state->description, cmd);
- a->archive.compression_name = state->description;
-
- state->child_out_buf_next = state->child_out_buf = malloc(65536);
- if (!state->child_out_buf) {
- free(state);
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate filter buffer");
- return (ARCHIVE_FATAL);
- }
- state->child_out_buf_len = 65536;
- state->child_out_buf_avail = 0;
+ self->name = state->description;
- state->child_in_buf = buff;
- state->child_in_buf_avail = n;
+ state->out_buf = out_buf;
+ state->out_buf_len = out_buf_len;
if ((state->child = __archive_create_child(cmd,
&state->child_stdin, &state->child_stdout)) == -1) {
- free(state->child_out_buf);
+ free(state->out_buf);
free(state);
- archive_set_error(&a->archive, EINVAL,
+ archive_set_error(&self->archive->archive, EINVAL,
"Can't initialise filter");
return (ARCHIVE_FATAL);
}
- a->decompressor->data = state;
- a->decompressor->read_ahead = archive_decompressor_program_read_ahead;
- a->decompressor->consume = archive_decompressor_program_read_consume;
- a->decompressor->skip = NULL;
- a->decompressor->finish = archive_decompressor_program_finish;
+ self->data = state;
+ self->read = program_filter_read;
+ self->skip = NULL;
+ self->close = program_filter_close;
/* XXX Check that we can read at least one byte? */
return (ARCHIVE_OK);
}
-static ssize_t
-archive_decompressor_program_read_ahead(struct archive_read *a, const void **buff,
- size_t min)
+static int
+program_bidder_init(struct archive_read_filter *self)
{
- struct archive_decompress_program *state;
- ssize_t bytes_read;
-
- state = (struct archive_decompress_program *)a->decompressor->data;
+ struct program_bidder *bidder_state;
- if (min > state->child_out_buf_len)
- min = state->child_out_buf_len;
-
- while (state->child_stdout != -1 && min > state->child_out_buf_avail) {
- if (state->child_out_buf != state->child_out_buf_next) {
- memmove(state->child_out_buf, state->child_out_buf_next,
- state->child_out_buf_avail);
- state->child_out_buf_next = state->child_out_buf;
- }
-
- bytes_read = child_read(a,
- state->child_out_buf + state->child_out_buf_avail,
- state->child_out_buf_len - state->child_out_buf_avail);
- if (bytes_read == -1)
- return (-1);
- if (bytes_read == 0)
- break;
- state->child_out_buf_avail += bytes_read;
- a->archive.raw_position += bytes_read;
- }
-
- *buff = state->child_out_buf_next;
- return (state->child_out_buf_avail);
+ bidder_state = (struct program_bidder *)self->bidder->data;
+ return (__archive_read_program(self, bidder_state->cmd));
}
static ssize_t
-archive_decompressor_program_read_consume(struct archive_read *a, size_t request)
+program_filter_read(struct archive_read_filter *self, const void **buff)
{
- struct archive_decompress_program *state;
-
- state = (struct archive_decompress_program *)a->decompressor->data;
-
- state->child_out_buf_next += request;
- state->child_out_buf_avail -= request;
+ struct program_filter *state;
+ ssize_t bytes;
+ size_t total;
+ char *p;
+
+ state = (struct program_filter *)self->data;
+
+ total = 0;
+ p = state->out_buf;
+ while (state->child_stdout != -1 && total < state->out_buf_len) {
+ bytes = child_read(self, p, state->out_buf_len - total);
+ if (bytes < 0)
+ /* No recovery is possible if we can no longer
+ * read from the child. */
+ return (ARCHIVE_FATAL);
+ if (bytes == 0)
+ /* We got EOF from the child. */
+ break;
+ total += bytes;
+ p += bytes;
+ }
- a->archive.file_position += request;
- return (request);
+ *buff = state->out_buf;
+ return (total);
}
static int
-archive_decompressor_program_finish(struct archive_read *a)
+program_filter_close(struct archive_read_filter *self)
{
- struct archive_decompress_program *state;
- int status;
-
- state = (struct archive_decompress_program *)a->decompressor->data;
+ struct program_filter *state;
+ int e;
- /* Release our configuration data. */
- free(a->decompressor->config);
- a->decompressor->config = NULL;
-
- /* Shut down the child. */
- if (state->child_stdin != -1)
- close(state->child_stdin);
- if (state->child_stdout != -1)
- close(state->child_stdout);
- while (waitpid(state->child, &status, 0) == -1 && errno == EINTR)
- continue;
+ state = (struct program_filter *)self->data;
+ e = child_stop(self, state);
/* Release our private data. */
- free(state->child_out_buf);
+ free(state->out_buf);
free(state->description);
free(state);
- a->decompressor->data = NULL;
- return (ARCHIVE_OK);
+ return (e);
}
#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_rpm.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_rpm.c
new file mode 100644
index 00000000000..051baa5e122
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_rpm.c
@@ -0,0 +1,287 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include "archive.h"
+#include "archive_endian.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+struct rpm {
+ int64_t total_in;
+ size_t hpos;
+ size_t hlen;
+ unsigned char header[16];
+ enum {
+ ST_LEAD, /* Skipping 'Lead' section. */
+ ST_HEADER, /* Reading 'Header' section;
+ * first 16 bytes. */
+ ST_HEADER_DATA, /* Skipping 'Header' section. */
+ ST_PADDING, /* Skipping padding data after the
+ * 'Header' section. */
+ ST_ARCHIVE /* Reading 'Archive' section. */
+ } state;
+ int first_header;
+};
+#define RPM_LEAD_SIZE 96 /* Size of 'Lead' section. */
+
+static int rpm_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *);
+static int rpm_bidder_init(struct archive_read_filter *);
+
+static ssize_t rpm_filter_read(struct archive_read_filter *,
+ const void **);
+static int rpm_filter_close(struct archive_read_filter *);
+
+int
+archive_read_support_compression_rpm(struct archive *_a)
+{
+ struct archive_read *a = (struct archive_read *)_a;
+ struct archive_read_filter_bidder *bidder;
+
+ bidder = __archive_read_get_bidder(a);
+ archive_clear_error(_a);
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = rpm_bidder_bid;
+ bidder->init = rpm_bidder_init;
+ bidder->options = NULL;
+ bidder->free = NULL;
+ return (ARCHIVE_OK);
+}
+
+static int
+rpm_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
+{
+ const unsigned char *b;
+ ssize_t avail;
+ int bits_checked;
+
+ (void)self; /* UNUSED */
+
+ b = __archive_read_filter_ahead(filter, 8, &avail);
+ if (b == NULL)
+ return (0);
+
+ bits_checked = 0;
+ /*
+ * Verify Header Magic Bytes : 0xed 0xab 0xee 0xdb
+ */
+ if (b[0] != 0xed)
+ return (0);
+ bits_checked += 8;
+ if (b[1] != 0xab)
+ return (0);
+ bits_checked += 8;
+ if (b[2] != 0xee)
+ return (0);
+ bits_checked += 8;
+ if (b[3] != 0xdb)
+ return (0);
+ bits_checked += 8;
+ /*
+ * Check major version.
+ */
+ if (b[4] != 3 && b[4] != 4)
+ return (0);
+ bits_checked += 8;
+ /*
+ * Check package type; binary or source.
+ */
+ if (b[6] != 0)
+ return (0);
+ bits_checked += 8;
+ if (b[7] != 0 && b[7] != 1)
+ return (0);
+ bits_checked += 8;
+
+ return (bits_checked);
+}
+
+static int
+rpm_bidder_init(struct archive_read_filter *self)
+{
+ struct rpm *rpm;
+
+ self->code = ARCHIVE_COMPRESSION_RPM;
+ self->name = "rpm";
+ self->read = rpm_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = rpm_filter_close;
+
+ rpm = (struct rpm *)calloc(sizeof(*rpm), 1);
+ if (rpm == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for rpm");
+ return (ARCHIVE_FATAL);
+ }
+
+ self->data = rpm;
+ rpm->state = ST_LEAD;
+
+ return (ARCHIVE_OK);
+}
+
+static ssize_t
+rpm_filter_read(struct archive_read_filter *self, const void **buff)
+{
+ struct rpm *rpm;
+ const unsigned char *b;
+ ssize_t avail_in, total;
+ size_t used, n;
+ uint32_t section;
+ uint32_t bytes;
+
+ rpm = (struct rpm *)self->data;
+ *buff = NULL;
+ total = avail_in = 0;
+ b = NULL;
+ used = 0;
+ do {
+ if (b == NULL) {
+ b = __archive_read_filter_ahead(self->upstream, 1,
+ &avail_in);
+ if (b == NULL) {
+ if (avail_in < 0)
+ return (ARCHIVE_FATAL);
+ else
+ break;
+ }
+ }
+
+ switch (rpm->state) {
+ case ST_LEAD:
+ if (rpm->total_in + avail_in < RPM_LEAD_SIZE)
+ used += avail_in;
+ else {
+ n = RPM_LEAD_SIZE - rpm->total_in;
+ used += n;
+ b += n;
+ rpm->state = ST_HEADER;
+ rpm->hpos = 0;
+ rpm->hlen = 0;
+ rpm->first_header = 1;
+ }
+ break;
+ case ST_HEADER:
+ n = 16 - rpm->hpos;
+ if (n > avail_in - used)
+ n = avail_in - used;
+ memcpy(rpm->header+rpm->hpos, b, n);
+ b += n;
+ used += n;
+ rpm->hpos += n;
+
+ if (rpm->hpos == 16) {
+ if (rpm->header[0] != 0x8e ||
+ rpm->header[1] != 0xad ||
+ rpm->header[2] != 0xe8 ||
+ rpm->header[3] != 0x01) {
+ if (rpm->first_header) {
+ archive_set_error(
+ &self->archive->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Unrecoginized rpm header");
+ return (ARCHIVE_FATAL);
+ }
+ rpm->state = ST_ARCHIVE;
+ *buff = rpm->header;
+ total = rpm->hpos;
+ break;
+ }
+ /* Calculate 'Header' length. */
+ section = archive_be32dec(rpm->header+8);
+ bytes = archive_be32dec(rpm->header+12);
+ rpm->hlen = 16 + section * 16 + bytes;
+ rpm->state = ST_HEADER_DATA;
+ rpm->first_header = 0;
+ }
+ break;
+ case ST_HEADER_DATA:
+ n = rpm->hlen - rpm->hpos;
+ if (n > avail_in - used)
+ n = avail_in - used;
+ b += n;
+ used += n;
+ rpm->hpos += n;
+ if (rpm->hpos == rpm->hlen)
+ rpm->state = ST_PADDING;
+ break;
+ case ST_PADDING:
+ while (used < (size_t)avail_in) {
+ if (*b != 0) {
+ /* Read next header. */
+ rpm->state = ST_HEADER;
+ rpm->hpos = 0;
+ rpm->hlen = 0;
+ break;
+ }
+ b++;
+ used++;
+ }
+ break;
+ case ST_ARCHIVE:
+ *buff = b;
+ total = avail_in;
+ used = avail_in;
+ break;
+ }
+ if (used == (size_t)avail_in) {
+ rpm->total_in += used;
+ __archive_read_filter_consume(self->upstream, used);
+ b = NULL;
+ used = 0;
+ }
+ } while (total == 0 && avail_in > 0);
+
+ if (used > 0 && b != NULL) {
+ rpm->total_in += used;
+ __archive_read_filter_consume(self->upstream, used);
+ }
+ return (total);
+}
+
+static int
+rpm_filter_close(struct archive_read_filter *self)
+{
+ struct rpm *rpm;
+
+ rpm = (struct rpm *)self->data;
+ free(rpm);
+
+ return (ARCHIVE_OK);
+}
+
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_uu.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_uu.c
new file mode 100644
index 00000000000..1e3052097dc
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_uu.c
@@ -0,0 +1,627 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_uu.c 201248 2009-12-30 06:12:03Z kientzle $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+struct uudecode {
+ int64_t total;
+ unsigned char *in_buff;
+#define IN_BUFF_SIZE (1024)
+ int in_cnt;
+ size_t in_allocated;
+ unsigned char *out_buff;
+#define OUT_BUFF_SIZE (64 * 1024)
+ int state;
+#define ST_FIND_HEAD 0
+#define ST_READ_UU 1
+#define ST_UUEND 2
+#define ST_READ_BASE64 3
+};
+
+static int uudecode_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *filter);
+static int uudecode_bidder_init(struct archive_read_filter *);
+
+static ssize_t uudecode_filter_read(struct archive_read_filter *,
+ const void **);
+static int uudecode_filter_close(struct archive_read_filter *);
+
+int
+archive_read_support_compression_uu(struct archive *_a)
+{
+ struct archive_read *a = (struct archive_read *)_a;
+ struct archive_read_filter_bidder *bidder;
+
+ bidder = __archive_read_get_bidder(a);
+ archive_clear_error(_a);
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = uudecode_bidder_bid;
+ bidder->init = uudecode_bidder_init;
+ bidder->options = NULL;
+ bidder->free = NULL;
+ return (ARCHIVE_OK);
+}
+
+static const unsigned char ascii[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\n', 0, 0, '\r', 0, 0, /* 00 - 0F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
+};
+
+static const unsigned char uuchar[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 70 - 7F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
+};
+
+static const unsigned char base64[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, /* 20 - 2F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, /* 30 - 3F */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 50 - 5F */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 70 - 7F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
+};
+
+static const int base64num[128] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 62, 0, 0, 0, 63, /* 20 - 2F */
+ 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 0, 0, 0, 0, 0, 0, /* 30 - 3F */
+ 0, 0, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, /* 40 - 4F */
+ 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 0, 0, 0, 0, 0, /* 50 - 5F */
+ 0, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, /* 60 - 6F */
+ 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 0, 0, 0, 0, 0, /* 70 - 7F */
+};
+
+static ssize_t
+get_line(const unsigned char *b, ssize_t avail, ssize_t *nlsize)
+{
+ ssize_t len;
+
+ len = 0;
+ while (len < avail) {
+ switch (ascii[*b]) {
+ case 0: /* Non-ascii character or control character. */
+ if (nlsize != NULL)
+ *nlsize = 0;
+ return (-1);
+ case '\r':
+ if (avail-len > 1 && b[1] == '\n') {
+ if (nlsize != NULL)
+ *nlsize = 2;
+ return (len+2);
+ }
+ /* FALL THROUGH */
+ case '\n':
+ if (nlsize != NULL)
+ *nlsize = 1;
+ return (len+1);
+ case 1:
+ b++;
+ len++;
+ break;
+ }
+ }
+ if (nlsize != NULL)
+ *nlsize = 0;
+ return (avail);
+}
+
+static ssize_t
+bid_get_line(struct archive_read_filter *filter,
+ const unsigned char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl)
+{
+ ssize_t len;
+ int quit;
+
+ quit = 0;
+ if (*avail == 0) {
+ *nl = 0;
+ len = 0;
+ } else
+ len = get_line(*b, *avail, nl);
+ /*
+ * Read bytes more while it does not reach the end of line.
+ */
+ while (*nl == 0 && len == *avail && !quit) {
+ ssize_t diff = *ravail - *avail;
+
+ *b = __archive_read_filter_ahead(filter, 160 + *ravail, avail);
+ if (*b == NULL) {
+ if (*ravail >= *avail)
+ return (0);
+ /* Reading bytes reaches the end of file. */
+ *b = __archive_read_filter_ahead(filter, *avail, avail);
+ quit = 1;
+ }
+ *ravail = *avail;
+ *b += diff;
+ *avail -= diff;
+ len = get_line(*b, *avail, nl);
+ }
+ return (len);
+}
+
+#define UUDECODE(c) (((c) - 0x20) & 0x3f)
+
+static int
+uudecode_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
+{
+ const unsigned char *b;
+ ssize_t avail, ravail;
+ ssize_t len, nl;
+ int l;
+ int firstline;
+
+ (void)self; /* UNUSED */
+
+ b = __archive_read_filter_ahead(filter, 1, &avail);
+ if (b == NULL)
+ return (0);
+
+ firstline = 20;
+ ravail = avail;
+ for (;;) {
+ len = bid_get_line(filter, &b, &avail, &ravail, &nl);
+ if (len < 0 || nl == 0)
+ return (0);/* Binary data. */
+ if (memcmp(b, "begin ", 6) == 0 && len - nl >= 11)
+ l = 6;
+ else if (memcmp(b, "begin-base64 ", 13) == 0 && len - nl >= 18)
+ l = 13;
+ else
+ l = 0;
+
+ if (l > 0 && (b[l] < '0' || b[l] > '7' ||
+ b[l+1] < '0' || b[l+1] > '7' ||
+ b[l+2] < '0' || b[l+2] > '7' || b[l+3] != ' '))
+ l = 0;
+
+ b += len;
+ avail -= len;
+ if (l)
+ break;
+ firstline = 0;
+ }
+ if (!avail)
+ return (0);
+ len = bid_get_line(filter, &b, &avail, &ravail, &nl);
+ if (len < 0 || nl == 0)
+ return (0);/* There are non-ascii characters. */
+ avail -= len;
+
+ if (l == 6) {
+ if (!uuchar[*b])
+ return (0);
+ /* Get a length of decoded bytes. */
+ l = UUDECODE(*b++); len--;
+ if (l > 45)
+ /* Normally, maximum length is 45(character 'M'). */
+ return (0);
+ while (l && len-nl > 0) {
+ if (l > 0) {
+ if (!uuchar[*b++])
+ return (0);
+ if (!uuchar[*b++])
+ return (0);
+ len -= 2;
+ --l;
+ }
+ if (l > 0) {
+ if (!uuchar[*b++])
+ return (0);
+ --len;
+ --l;
+ }
+ if (l > 0) {
+ if (!uuchar[*b++])
+ return (0);
+ --len;
+ --l;
+ }
+ }
+ if (len-nl < 0)
+ return (0);
+ if (len-nl == 1 &&
+ (uuchar[*b] || /* Check sum. */
+ (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */
+ ++b;
+ --len;
+ }
+ b += nl;
+ if (avail && uuchar[*b])
+ return (firstline+30);
+ }
+ if (l == 13) {
+ while (len-nl > 0) {
+ if (!base64[*b++])
+ return (0);
+ --len;
+ }
+ b += nl;
+
+ if (avail >= 5 && memcmp(b, "====\n", 5) == 0)
+ return (firstline+40);
+ if (avail >= 6 && memcmp(b, "====\r\n", 6) == 0)
+ return (firstline+40);
+ if (avail > 0 && base64[*b])
+ return (firstline+30);
+ }
+
+ return (0);
+}
+
+static int
+uudecode_bidder_init(struct archive_read_filter *self)
+{
+ struct uudecode *uudecode;
+ void *out_buff;
+ void *in_buff;
+
+ self->code = ARCHIVE_COMPRESSION_UU;
+ self->name = "uu";
+ self->read = uudecode_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = uudecode_filter_close;
+
+ uudecode = (struct uudecode *)calloc(sizeof(*uudecode), 1);
+ out_buff = malloc(OUT_BUFF_SIZE);
+ in_buff = malloc(IN_BUFF_SIZE);
+ if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for uudecode");
+ free(uudecode);
+ free(out_buff);
+ free(in_buff);
+ return (ARCHIVE_FATAL);
+ }
+
+ self->data = uudecode;
+ uudecode->in_buff = in_buff;
+ uudecode->in_cnt = 0;
+ uudecode->in_allocated = IN_BUFF_SIZE;
+ uudecode->out_buff = out_buff;
+ uudecode->state = ST_FIND_HEAD;
+
+ return (ARCHIVE_OK);
+}
+
+static int
+ensure_in_buff_size(struct archive_read_filter *self,
+ struct uudecode *uudecode, size_t size)
+{
+
+ if (size > uudecode->in_allocated) {
+ unsigned char *ptr;
+ size_t newsize;
+
+ newsize = uudecode->in_allocated << 1;
+ ptr = malloc(newsize);
+ if (ptr == NULL ||
+ newsize < uudecode->in_allocated) {
+ free(ptr);
+ archive_set_error(&self->archive->archive,
+ ENOMEM,
+ "Can't allocate data for uudecode");
+ return (ARCHIVE_FATAL);
+ }
+ if (uudecode->in_cnt)
+ memmove(ptr, uudecode->in_buff,
+ uudecode->in_cnt);
+ free(uudecode->in_buff);
+ uudecode->in_buff = ptr;
+ uudecode->in_allocated = newsize;
+ }
+ return (ARCHIVE_OK);
+}
+
+static ssize_t
+uudecode_filter_read(struct archive_read_filter *self, const void **buff)
+{
+ struct uudecode *uudecode;
+ const unsigned char *b, *d;
+ unsigned char *out;
+ ssize_t avail_in, ravail;
+ ssize_t used;
+ ssize_t total;
+ ssize_t len, llen, nl;
+
+ uudecode = (struct uudecode *)self->data;
+
+read_more:
+ d = __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+ if (d == NULL && avail_in < 0)
+ return (ARCHIVE_FATAL);
+ /* Quiet a code analyzer; make sure avail_in must be zero
+ * when d is NULL. */
+ if (d == NULL)
+ avail_in = 0;
+ used = 0;
+ total = 0;
+ out = uudecode->out_buff;
+ ravail = avail_in;
+ if (uudecode->in_cnt) {
+ /*
+ * If there is remaining data which is saved by
+ * previous calling, use it first.
+ */
+ if (ensure_in_buff_size(self, uudecode,
+ avail_in + uudecode->in_cnt) != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ memcpy(uudecode->in_buff + uudecode->in_cnt,
+ d, avail_in);
+ d = uudecode->in_buff;
+ avail_in += uudecode->in_cnt;
+ uudecode->in_cnt = 0;
+ }
+ for (;used < avail_in; d += llen, used += llen) {
+ int l, body;
+
+ b = d;
+ len = get_line(b, avail_in - used, &nl);
+ if (len < 0) {
+ /* Non-ascii character is found. */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ llen = len;
+ if (nl == 0) {
+ /*
+ * Save remaining data which does not contain
+ * NL('\n','\r').
+ */
+ if (ensure_in_buff_size(self, uudecode, len)
+ != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ if (uudecode->in_buff != b)
+ memmove(uudecode->in_buff, b, len);
+ uudecode->in_cnt = len;
+ if (total == 0) {
+ /* Do not return 0; it means end-of-file.
+ * We should try to read bytes more. */
+ __archive_read_filter_consume(
+ self->upstream, ravail);
+ goto read_more;
+ }
+ break;
+ }
+ if (total + len * 2 > OUT_BUFF_SIZE)
+ break;
+ switch (uudecode->state) {
+ default:
+ case ST_FIND_HEAD:
+ if (len - nl > 13 && memcmp(b, "begin ", 6) == 0)
+ l = 6;
+ else if (len - nl > 18 &&
+ memcmp(b, "begin-base64 ", 13) == 0)
+ l = 13;
+ else
+ l = 0;
+ if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
+ b[l+1] >= '0' && b[l+1] <= '7' &&
+ b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
+ if (l == 6)
+ uudecode->state = ST_READ_UU;
+ else
+ uudecode->state = ST_READ_BASE64;
+ }
+ break;
+ case ST_READ_UU:
+ body = len - nl;
+ if (!uuchar[*b] || body <= 0) {
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ /* Get length of undecoded bytes of curent line. */
+ l = UUDECODE(*b++);
+ body--;
+ if (l > body) {
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ if (l == 0) {
+ uudecode->state = ST_UUEND;
+ break;
+ }
+ while (l > 0) {
+ int n = 0;
+
+ if (l > 0) {
+ if (!uuchar[b[0]] || !uuchar[b[1]])
+ break;
+ n = UUDECODE(*b++) << 18;
+ n |= UUDECODE(*b++) << 12;
+ *out++ = n >> 16; total++;
+ --l;
+ }
+ if (l > 0) {
+ if (!uuchar[b[0]])
+ break;
+ n |= UUDECODE(*b++) << 6;
+ *out++ = (n >> 8) & 0xFF; total++;
+ --l;
+ }
+ if (l > 0) {
+ if (!uuchar[b[0]])
+ break;
+ n |= UUDECODE(*b++);
+ *out++ = n & 0xFF; total++;
+ --l;
+ }
+ }
+ if (l) {
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ break;
+ case ST_UUEND:
+ if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
+ uudecode->state = ST_FIND_HEAD;
+ else {
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ break;
+ case ST_READ_BASE64:
+ l = len - nl;
+ if (l >= 3 && b[0] == '=' && b[1] == '=' &&
+ b[2] == '=') {
+ uudecode->state = ST_FIND_HEAD;
+ break;
+ }
+ while (l > 0) {
+ int n = 0;
+
+ if (l > 0) {
+ if (!base64[b[0]] || !base64[b[1]])
+ break;
+ n = base64num[*b++] << 18;
+ n |= base64num[*b++] << 12;
+ *out++ = n >> 16; total++;
+ l -= 2;
+ }
+ if (l > 0) {
+ if (*b == '=')
+ break;
+ if (!base64[*b])
+ break;
+ n |= base64num[*b++] << 6;
+ *out++ = (n >> 8) & 0xFF; total++;
+ --l;
+ }
+ if (l > 0) {
+ if (*b == '=')
+ break;
+ if (!base64[*b])
+ break;
+ n |= base64num[*b++];
+ *out++ = n & 0xFF; total++;
+ --l;
+ }
+ }
+ if (l && *b != '=') {
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ }
+ break;
+ }
+ }
+
+ __archive_read_filter_consume(self->upstream, ravail);
+
+ *buff = uudecode->out_buff;
+ uudecode->total += total;
+ return (total);
+}
+
+static int
+uudecode_filter_close(struct archive_read_filter *self)
+{
+ struct uudecode *uudecode;
+
+ uudecode = (struct uudecode *)self->data;
+ free(uudecode->in_buff);
+ free(uudecode->out_buff);
+ free(uudecode);
+
+ return (ARCHIVE_OK);
+}
+
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_xz.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_xz.c
new file mode 100644
index 00000000000..28c4e2d9fc5
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_xz.c
@@ -0,0 +1,708 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2008 Tim Kientzle and Miklos Vajna
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_xz.c 201167 2009-12-29 06:06:20Z kientzle $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_LZMA_H
+#include <lzma.h>
+#elif HAVE_LZMADEC_H
+#include <lzmadec.h>
+#endif
+
+#include "archive.h"
+#include "archive_endian.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+
+struct private_data {
+ lzma_stream stream;
+ unsigned char *out_block;
+ size_t out_block_size;
+ int64_t total_out;
+ char eof; /* True = found end of compressed data. */
+};
+
+/* Combined lzma/xz filter */
+static ssize_t xz_filter_read(struct archive_read_filter *, const void **);
+static int xz_filter_close(struct archive_read_filter *);
+static int xz_lzma_bidder_init(struct archive_read_filter *);
+
+#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+
+struct private_data {
+ lzmadec_stream stream;
+ unsigned char *out_block;
+ size_t out_block_size;
+ int64_t total_out;
+ char eof; /* True = found end of compressed data. */
+};
+
+/* Lzma-only filter */
+static ssize_t lzma_filter_read(struct archive_read_filter *, const void **);
+static int lzma_filter_close(struct archive_read_filter *);
+#endif
+
+/*
+ * Note that we can detect xz and lzma compressed files even if we
+ * can't decompress them. (In fact, we like detecting them because we
+ * can give better error messages.) So the bid framework here gets
+ * compiled even if no lzma library is available.
+ */
+static int xz_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *);
+static int xz_bidder_init(struct archive_read_filter *);
+static int lzma_bidder_bid(struct archive_read_filter_bidder *,
+ struct archive_read_filter *);
+static int lzma_bidder_init(struct archive_read_filter *);
+
+int
+archive_read_support_compression_xz(struct archive *_a)
+{
+ struct archive_read *a = (struct archive_read *)_a;
+ struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+ archive_clear_error(_a);
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = xz_bidder_bid;
+ bidder->init = xz_bidder_init;
+ bidder->options = NULL;
+ bidder->free = NULL;
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+ return (ARCHIVE_OK);
+#else
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+ "Using external unxz program for xz decompression");
+ return (ARCHIVE_WARN);
+#endif
+}
+
+int
+archive_read_support_compression_lzma(struct archive *_a)
+{
+ struct archive_read *a = (struct archive_read *)_a;
+ struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+ archive_clear_error(_a);
+ if (bidder == NULL)
+ return (ARCHIVE_FATAL);
+
+ bidder->data = NULL;
+ bidder->bid = lzma_bidder_bid;
+ bidder->init = lzma_bidder_init;
+ bidder->options = NULL;
+ bidder->free = NULL;
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+ return (ARCHIVE_OK);
+#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+ return (ARCHIVE_OK);
+#else
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+ "Using external unlzma program for lzma decompression");
+ return (ARCHIVE_WARN);
+#endif
+}
+
+/*
+ * Test whether we can handle this data.
+ */
+static int
+xz_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
+{
+ const unsigned char *buffer;
+ ssize_t avail;
+ int bits_checked;
+
+ (void)self; /* UNUSED */
+
+ buffer = __archive_read_filter_ahead(filter, 6, &avail);
+ if (buffer == NULL)
+ return (0);
+
+ /*
+ * Verify Header Magic Bytes : FD 37 7A 58 5A 00
+ */
+ bits_checked = 0;
+ if (buffer[0] != 0xFD)
+ return (0);
+ bits_checked += 8;
+ if (buffer[1] != 0x37)
+ return (0);
+ bits_checked += 8;
+ if (buffer[2] != 0x7A)
+ return (0);
+ bits_checked += 8;
+ if (buffer[3] != 0x58)
+ return (0);
+ bits_checked += 8;
+ if (buffer[4] != 0x5A)
+ return (0);
+ bits_checked += 8;
+ if (buffer[5] != 0x00)
+ return (0);
+ bits_checked += 8;
+
+ return (bits_checked);
+}
+
+/*
+ * Test whether we can handle this data.
+ *
+ * <sigh> LZMA has a rather poor file signature. Zeros do not
+ * make good signature bytes as a rule, and the only non-zero byte
+ * here is an ASCII character. For example, an uncompressed tar
+ * archive whose first file is ']' would satisfy this check. It may
+ * be necessary to exclude LZMA from compression_all() because of
+ * this. Clients of libarchive would then have to explicitly enable
+ * LZMA checking instead of (or in addition to) compression_all() when
+ * they have other evidence (file name, command-line option) to go on.
+ */
+static int
+lzma_bidder_bid(struct archive_read_filter_bidder *self,
+ struct archive_read_filter *filter)
+{
+ const unsigned char *buffer;
+ ssize_t avail;
+ uint32_t dicsize;
+ uint64_t uncompressed_size;
+ int bits_checked;
+
+ (void)self; /* UNUSED */
+
+ buffer = __archive_read_filter_ahead(filter, 14, &avail);
+ if (buffer == NULL)
+ return (0);
+
+ /* First byte of raw LZMA stream is commonly 0x5d.
+ * The first byte is a special number, which consists of
+ * three parameters of LZMA compression, a number of literal
+ * context bits(which is from 0 to 8, default is 3), a number
+ * of literal pos bits(which is from 0 to 4, default is 0),
+ * a number of pos bits(which is from 0 to 4, default is 2).
+ * The first byte is made by
+ * (pos bits * 5 + literal pos bit) * 9 + * literal contest bit,
+ * and so the default value in this field is
+ * (2 * 5 + 0) * 9 + 3 = 0x5d.
+ * lzma of LZMA SDK has options to change those parameters.
+ * It means a range of this field is from 0 to 224. And lzma of
+ * XZ Utils with option -e records 0x5e in this field. */
+ /* NOTE: If this checking of the first byte increases false
+ * recognition, we should allow only 0x5d and 0x5e for the first
+ * byte of LZMA stream. */
+ bits_checked = 0;
+ if (buffer[0] > (4 * 5 + 4) * 9 + 8)
+ return (0);
+ /* Most likely value in the first byte of LZMA stream. */
+ if (buffer[0] == 0x5d || buffer[0] == 0x5e)
+ bits_checked += 8;
+
+ /* Sixth through fourteenth bytes are uncompressed size,
+ * stored in little-endian order. `-1' means uncompressed
+ * size is unknown and lzma of XZ Utils always records `-1'
+ * in this field. */
+ uncompressed_size = archive_le64dec(buffer+5);
+ if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1))
+ bits_checked += 64;
+
+ /* Second through fifth bytes are dictionary size, stored in
+ * little-endian order. The minimum dictionary size is
+ * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option
+ * -d12 and the maxinam dictionary size is 1 << 27(128MiB)
+ * which the one uses with option -d27.
+ * NOTE: A comment of LZMA SDK source code says this dictionary
+ * range is from 1 << 12 to 1 << 30. */
+ dicsize = archive_le32dec(buffer+1);
+ switch (dicsize) {
+ case 0x00001000:/* lzma of LZMA SDK option -d12. */
+ case 0x00002000:/* lzma of LZMA SDK option -d13. */
+ case 0x00004000:/* lzma of LZMA SDK option -d14. */
+ case 0x00008000:/* lzma of LZMA SDK option -d15. */
+ case 0x00010000:/* lzma of XZ Utils option -0 and -1.
+ * lzma of LZMA SDK option -d16. */
+ case 0x00020000:/* lzma of LZMA SDK option -d17. */
+ case 0x00040000:/* lzma of LZMA SDK option -d18. */
+ case 0x00080000:/* lzma of XZ Utils option -2.
+ * lzma of LZMA SDK option -d19. */
+ case 0x00100000:/* lzma of XZ Utils option -3.
+ * lzma of LZMA SDK option -d20. */
+ case 0x00200000:/* lzma of XZ Utils option -4.
+ * lzma of LZMA SDK option -d21. */
+ case 0x00400000:/* lzma of XZ Utils option -5.
+ * lzma of LZMA SDK option -d22. */
+ case 0x00800000:/* lzma of XZ Utils option -6.
+ * lzma of LZMA SDK option -d23. */
+ case 0x01000000:/* lzma of XZ Utils option -7.
+ * lzma of LZMA SDK option -d24. */
+ case 0x02000000:/* lzma of XZ Utils option -8.
+ * lzma of LZMA SDK option -d25. */
+ case 0x04000000:/* lzma of XZ Utils option -9.
+ * lzma of LZMA SDK option -d26. */
+ case 0x08000000:/* lzma of LZMA SDK option -d27. */
+ bits_checked += 32;
+ break;
+ default:
+ /* If a memory usage for encoding was not enough on
+ * the platform where LZMA stream was made, lzma of
+ * XZ Utils automatically decreased the dictionary
+ * size to enough memory for encoding by 1Mi bytes
+ * (1 << 20).*/
+ if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 &&
+ (dicsize & ((1 << 20)-1)) == 0 &&
+ bits_checked == 8 + 64) {
+ bits_checked += 32;
+ break;
+ }
+ /* Otherwise dictionary size is unlikely. But it is
+ * possible that someone makes lzma stream with
+ * liblzma/LZMA SDK in one's dictionary size. */
+ return (0);
+ }
+
+ /* TODO: The above test is still very weak. It would be
+ * good to do better. */
+
+ return (bits_checked);
+}
+
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+
+/*
+ * liblzma 4.999.7 and later support both lzma and xz streams.
+ */
+static int
+xz_bidder_init(struct archive_read_filter *self)
+{
+ self->code = ARCHIVE_COMPRESSION_XZ;
+ self->name = "xz";
+ return (xz_lzma_bidder_init(self));
+}
+
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+ self->code = ARCHIVE_COMPRESSION_LZMA;
+ self->name = "lzma";
+ return (xz_lzma_bidder_init(self));
+}
+
+/*
+ * Setup the callbacks.
+ */
+static int
+xz_lzma_bidder_init(struct archive_read_filter *self)
+{
+ static const size_t out_block_size = 64 * 1024;
+ void *out_block;
+ struct private_data *state;
+ int ret;
+
+ state = (struct private_data *)calloc(sizeof(*state), 1);
+ out_block = (unsigned char *)malloc(out_block_size);
+ if (state == NULL || out_block == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for xz decompression");
+ free(out_block);
+ free(state);
+ return (ARCHIVE_FATAL);
+ }
+
+ self->data = state;
+ state->out_block_size = out_block_size;
+ state->out_block = out_block;
+ self->read = xz_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = xz_filter_close;
+
+ state->stream.avail_in = 0;
+
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
+
+ /* Initialize compression library.
+ * TODO: I don't know what value is best for memlimit.
+ * maybe, it needs to check memory size which
+ * running system has.
+ */
+ if (self->code == ARCHIVE_COMPRESSION_XZ)
+ ret = lzma_stream_decoder(&(state->stream),
+ (1U << 30),/* memlimit */
+ LZMA_CONCATENATED);
+ else
+ ret = lzma_alone_decoder(&(state->stream),
+ (1U << 30));/* memlimit */
+
+ if (ret == LZMA_OK)
+ return (ARCHIVE_OK);
+
+ /* Library setup failed: Choose an error message and clean up. */
+ switch (ret) {
+ case LZMA_MEM_ERROR:
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Internal error initializing compression library: "
+ "Cannot allocate memory");
+ break;
+ case LZMA_OPTIONS_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing compression library: "
+ "Invalid or unsupported options");
+ break;
+ default:
+ archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+ "Internal error initializing lzma library");
+ break;
+ }
+
+ free(state->out_block);
+ free(state);
+ self->data = NULL;
+ return (ARCHIVE_FATAL);
+}
+
+/*
+ * Return the next block of decompressed data.
+ */
+static ssize_t
+xz_filter_read(struct archive_read_filter *self, const void **p)
+{
+ struct private_data *state;
+ size_t decompressed;
+ ssize_t avail_in;
+ int ret;
+
+ state = (struct private_data *)self->data;
+
+ /* Empty our output buffer. */
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
+
+ /* Try to fill the output buffer. */
+ while (state->stream.avail_out > 0 && !state->eof) {
+ state->stream.next_in =
+ __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+ if (state->stream.next_in == NULL && avail_in < 0)
+ return (ARCHIVE_FATAL);
+ state->stream.avail_in = avail_in;
+
+ /* Decompress as much as we can in one pass. */
+ ret = lzma_code(&(state->stream),
+ (state->stream.avail_in == 0)? LZMA_FINISH: LZMA_RUN);
+ switch (ret) {
+ case LZMA_STREAM_END: /* Found end of stream. */
+ state->eof = 1;
+ /* FALL THROUGH */
+ case LZMA_OK: /* Decompressor made some progress. */
+ __archive_read_filter_consume(self->upstream,
+ avail_in - state->stream.avail_in);
+ break;
+ case LZMA_MEM_ERROR:
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Lzma library error: Cannot allocate memory");
+ return (ARCHIVE_FATAL);
+ case LZMA_MEMLIMIT_ERROR:
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Lzma library error: Out of memory");
+ return (ARCHIVE_FATAL);
+ case LZMA_FORMAT_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma library error: format not recognized");
+ return (ARCHIVE_FATAL);
+ case LZMA_OPTIONS_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma library error: Invalid options");
+ return (ARCHIVE_FATAL);
+ case LZMA_DATA_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma library error: Corrupted input data");
+ return (ARCHIVE_FATAL);
+ case LZMA_BUF_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma library error: No progress is possible");
+ return (ARCHIVE_FATAL);
+ default:
+ /* Return an error. */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma decompression failed: Unknown error");
+ return (ARCHIVE_FATAL);
+ }
+ }
+
+ decompressed = state->stream.next_out - state->out_block;
+ state->total_out += decompressed;
+ if (decompressed == 0)
+ *p = NULL;
+ else
+ *p = state->out_block;
+ return (decompressed);
+}
+
+/*
+ * Clean up the decompressor.
+ */
+static int
+xz_filter_close(struct archive_read_filter *self)
+{
+ struct private_data *state;
+
+ state = (struct private_data *)self->data;
+ lzma_end(&(state->stream));
+ free(state->out_block);
+ free(state);
+ return (ARCHIVE_OK);
+}
+
+#else
+
+#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+
+/*
+ * If we have the older liblzmadec library, then we can handle
+ * LZMA streams but not XZ streams.
+ */
+
+/*
+ * Setup the callbacks.
+ */
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+ static const size_t out_block_size = 64 * 1024;
+ void *out_block;
+ struct private_data *state;
+ ssize_t ret, avail_in;
+
+ self->code = ARCHIVE_COMPRESSION_LZMA;
+ self->name = "lzma";
+
+ state = (struct private_data *)calloc(sizeof(*state), 1);
+ out_block = (unsigned char *)malloc(out_block_size);
+ if (state == NULL || out_block == NULL) {
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Can't allocate data for lzma decompression");
+ free(out_block);
+ free(state);
+ return (ARCHIVE_FATAL);
+ }
+
+ self->data = state;
+ state->out_block_size = out_block_size;
+ state->out_block = out_block;
+ self->read = lzma_filter_read;
+ self->skip = NULL; /* not supported */
+ self->close = lzma_filter_close;
+
+ /* Prime the lzma library with 18 bytes of input. */
+ state->stream.next_in = (unsigned char *)(uintptr_t)
+ __archive_read_filter_ahead(self->upstream, 18, &avail_in);
+ if (state->stream.next_in == NULL)
+ return (ARCHIVE_FATAL);
+ state->stream.avail_in = avail_in;
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
+
+ /* Initialize compression library. */
+ ret = lzmadec_init(&(state->stream));
+ __archive_read_filter_consume(self->upstream,
+ avail_in - state->stream.avail_in);
+ if (ret == LZMADEC_OK)
+ return (ARCHIVE_OK);
+
+ /* Library setup failed: Clean up. */
+ archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+ "Internal error initializing lzma library");
+
+ /* Override the error message if we know what really went wrong. */
+ switch (ret) {
+ case LZMADEC_HEADER_ERROR:
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing compression library: "
+ "invalid header");
+ break;
+ case LZMADEC_MEM_ERROR:
+ archive_set_error(&self->archive->archive, ENOMEM,
+ "Internal error initializing compression library: "
+ "out of memory");
+ break;
+ }
+
+ free(state->out_block);
+ free(state);
+ self->data = NULL;
+ return (ARCHIVE_FATAL);
+}
+
+/*
+ * Return the next block of decompressed data.
+ */
+static ssize_t
+lzma_filter_read(struct archive_read_filter *self, const void **p)
+{
+ struct private_data *state;
+ size_t decompressed;
+ ssize_t avail_in, ret;
+
+ state = (struct private_data *)self->data;
+
+ /* Empty our output buffer. */
+ state->stream.next_out = state->out_block;
+ state->stream.avail_out = state->out_block_size;
+
+ /* Try to fill the output buffer. */
+ while (state->stream.avail_out > 0 && !state->eof) {
+ state->stream.next_in = (unsigned char *)(uintptr_t)
+ __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+ if (state->stream.next_in == NULL && avail_in < 0)
+ return (ARCHIVE_FATAL);
+ state->stream.avail_in = avail_in;
+
+ /* Decompress as much as we can in one pass. */
+ ret = lzmadec_decode(&(state->stream), avail_in == 0);
+ switch (ret) {
+ case LZMADEC_STREAM_END: /* Found end of stream. */
+ state->eof = 1;
+ /* FALL THROUGH */
+ case LZMADEC_OK: /* Decompressor made some progress. */
+ __archive_read_filter_consume(self->upstream,
+ avail_in - state->stream.avail_in);
+ break;
+ case LZMADEC_BUF_ERROR: /* Insufficient input data? */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Insufficient compressed data");
+ return (ARCHIVE_FATAL);
+ default:
+ /* Return an error. */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Lzma decompression failed");
+ return (ARCHIVE_FATAL);
+ }
+ }
+
+ decompressed = state->stream.next_out - state->out_block;
+ state->total_out += decompressed;
+ if (decompressed == 0)
+ *p = NULL;
+ else
+ *p = state->out_block;
+ return (decompressed);
+}
+
+/*
+ * Clean up the decompressor.
+ */
+static int
+lzma_filter_close(struct archive_read_filter *self)
+{
+ struct private_data *state;
+ int ret;
+
+ state = (struct private_data *)self->data;
+ ret = ARCHIVE_OK;
+ switch (lzmadec_end(&(state->stream))) {
+ case LZMADEC_OK:
+ break;
+ default:
+ archive_set_error(&(self->archive->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up %s compressor",
+ self->archive->archive.compression_name);
+ ret = ARCHIVE_FATAL;
+ }
+
+ free(state->out_block);
+ free(state);
+ return (ret);
+}
+
+#else
+
+/*
+ *
+ * If we have no suitable library on this system, we can't actually do
+ * the decompression. We can, however, still detect compressed
+ * archives and emit a useful message.
+ *
+ */
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+ int r;
+
+ r = __archive_read_program(self, "unlzma");
+ /* Note: We set the format here even if __archive_read_program()
+ * above fails. We do, after all, know what the format is
+ * even if we weren't able to read it. */
+ self->code = ARCHIVE_COMPRESSION_LZMA;
+ self->name = "lzma";
+ return (r);
+}
+
+#endif /* HAVE_LZMADEC_H */
+
+
+static int
+xz_bidder_init(struct archive_read_filter *self)
+{
+ int r;
+
+ r = __archive_read_program(self, "unxz");
+ /* Note: We set the format here even if __archive_read_program()
+ * above fails. We do, after all, know what the format is
+ * even if we weren't able to read it. */
+ self->code = ARCHIVE_COMPRESSION_XZ;
+ self->name = "xz";
+ return (r);
+}
+
+
+#endif /* HAVE_LZMA_H */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_all.c b/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
index 24e31ef54f5..96778388594 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_all.c,v 1.10 2007/12/30 04:58:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_all.c 174991 2007-12-30 04:58:22Z kientzle $");
#include "archive.h"
@@ -37,6 +37,7 @@ archive_read_support_format_all(struct archive *a)
archive_read_support_format_iso9660(a);
archive_read_support_format_mtree(a);
archive_read_support_format_tar(a);
+ archive_read_support_format_xar(a);
archive_read_support_format_zip(a);
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
index baf80bd62fc..7c1ca3a0c87 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
@@ -26,7 +26,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.10 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_ar.c 201101 2009-12-28 03:06:27Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -40,6 +40,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.10 2
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#include "archive.h"
#include "archive_entry.h"
@@ -72,8 +75,6 @@ struct ar {
#define AR_fmag_offset 58
#define AR_fmag_size 2
-#define isdigit(x) (x) >= '0' && (x) <= '9'
-
static int archive_read_format_ar_bid(struct archive_read *a);
static int archive_read_format_ar_cleanup(struct archive_read *a);
static int archive_read_format_ar_read_data(struct archive_read *a,
@@ -105,7 +106,9 @@ archive_read_support_format_ar(struct archive *_a)
r = __archive_read_register_format(a,
ar,
+ "ar",
archive_read_format_ar_bid,
+ NULL,
archive_read_format_ar_read_header,
archive_read_format_ar_read_data,
archive_read_format_ar_skip,
@@ -134,8 +137,6 @@ archive_read_format_ar_cleanup(struct archive_read *a)
static int
archive_read_format_ar_bid(struct archive_read *a)
{
- struct ar *ar;
- ssize_t bytes_read;
const void *h;
if (a->archive.archive_format != 0 &&
@@ -143,14 +144,11 @@ archive_read_format_ar_bid(struct archive_read *a)
ARCHIVE_FORMAT_AR)
return(0);
- ar = (struct ar *)(a->format->data);
-
/*
* Verify the 8-byte file signature.
* TODO: Do we need to check more than this?
*/
- bytes_read = (a->decompressor->read_ahead)(a, &h, 8);
- if (bytes_read < 8)
+ if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
return (-1);
if (strncmp((const char*)h, "!<arch>\n", 8) == 0) {
return (64);
@@ -166,7 +164,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
struct ar *ar;
uint64_t number; /* Used to hold parsed numbers before validation. */
ssize_t bytes_read;
- size_t bsd_name_length, entry_size, s;
+ size_t bsd_name_length, entry_size;
char *p, *st;
const void *b;
const char *h;
@@ -179,24 +177,22 @@ archive_read_format_ar_read_header(struct archive_read *a,
* We are now at the beginning of the archive,
* so we need first consume the ar global header.
*/
- (a->decompressor->consume)(a, 8);
+ __archive_read_consume(a, 8);
/* Set a default format code for now. */
a->archive.archive_format = ARCHIVE_FORMAT_AR;
}
/* Read the header for the next file entry. */
- bytes_read = (a->decompressor->read_ahead)(a, &b, 60);
- if (bytes_read < 60) {
+ if ((b = __archive_read_ahead(a, 60, &bytes_read)) == NULL)
/* Broken header. */
return (ARCHIVE_EOF);
- }
- (a->decompressor->consume)(a, 60);
+ __archive_read_consume(a, 60);
h = (const char *)b;
/* Verify the magic signature on the file header. */
if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
archive_set_error(&a->archive, EINVAL,
- "Consistency check failed");
+ "Incorrect file header signature");
return (ARCHIVE_WARN);
}
@@ -296,16 +292,10 @@ archive_read_format_ar_read_header(struct archive_read *a,
}
ar->strtab = st;
ar->strtab_size = entry_size;
- for (s = entry_size; s > 0; s -= bytes_read) {
- bytes_read = (a->decompressor->read_ahead)(a, &b, s);
- if (bytes_read <= 0)
- return (ARCHIVE_FATAL);
- if (bytes_read > (ssize_t)s)
- bytes_read = s;
- memcpy(st, b, bytes_read);
- st += bytes_read;
- (a->decompressor->consume)(a, bytes_read);
- }
+ if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
+ return (ARCHIVE_FATAL);
+ memcpy(st, b, entry_size);
+ __archive_read_consume(a, entry_size);
/* All contents are consumed. */
ar->entry_bytes_remaining = 0;
archive_entry_set_size(entry, ar->entry_bytes_remaining);
@@ -317,8 +307,10 @@ archive_read_format_ar_read_header(struct archive_read *a,
/*
* GNU variant handles long filenames by storing /<number>
* to indicate a name stored in the filename table.
+ * XXX TODO: Verify that it's all digits... Don't be fooled
+ * by "/9xyz" XXX
*/
- if (filename[0] == '/' && isdigit(filename[1])) {
+ if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
/*
* If we can't look up the real name, warn and return
@@ -365,15 +357,12 @@ archive_read_format_ar_read_header(struct archive_read *a,
archive_entry_set_size(entry, ar->entry_bytes_remaining);
/* Read the long name into memory. */
- bytes_read = (a->decompressor->read_ahead)(a, &b, bsd_name_length);
- if (bytes_read <= 0)
- return (ARCHIVE_FATAL);
- if ((size_t)bytes_read < bsd_name_length) {
+ if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Truncated input file");
return (ARCHIVE_FATAL);
}
- (a->decompressor->consume)(a, bsd_name_length);
+ __archive_read_consume(a, bsd_name_length);
/* Store it in the entry. */
p = (char *)malloc(bsd_name_length + 1);
@@ -453,7 +442,7 @@ archive_read_format_ar_read_data(struct archive_read *a,
ar = (struct ar *)(a->format->data);
if (ar->entry_bytes_remaining > 0) {
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read == 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Truncated ar archive");
@@ -467,16 +456,16 @@ archive_read_format_ar_read_data(struct archive_read *a,
*offset = ar->entry_offset;
ar->entry_offset += bytes_read;
ar->entry_bytes_remaining -= bytes_read;
- (a->decompressor->consume)(a, (size_t)bytes_read);
+ __archive_read_consume(a, (size_t)bytes_read);
return (ARCHIVE_OK);
} else {
while (ar->entry_padding > 0) {
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
if (bytes_read > ar->entry_padding)
bytes_read = (ssize_t)ar->entry_padding;
- (a->decompressor->consume)(a, (size_t)bytes_read);
+ __archive_read_consume(a, (size_t)bytes_read);
ar->entry_padding -= bytes_read;
}
*buff = NULL;
@@ -491,20 +480,11 @@ archive_read_format_ar_skip(struct archive_read *a)
{
off_t bytes_skipped;
struct ar* ar;
- int r = ARCHIVE_OK;
- const void *b; /* Dummy variables */
- size_t s;
- off_t o;
ar = (struct ar *)(a->format->data);
- if (a->decompressor->skip == NULL) {
- while (r == ARCHIVE_OK)
- r = archive_read_format_ar_read_data(a, &b, &s, &o);
- return (r);
- }
- bytes_skipped = (a->decompressor->skip)(a, ar->entry_bytes_remaining +
- ar->entry_padding);
+ bytes_skipped = __archive_read_skip(a,
+ ar->entry_bytes_remaining + ar->entry_padding);
if (bytes_skipped < 0)
return (ARCHIVE_FATAL);
@@ -533,11 +513,10 @@ ar_parse_gnu_filename_table(struct archive_read *a)
}
}
/*
- * Sanity check, last two chars must be `/\n' or '\n\n',
- * depending on whether the string table is padded by a '\n'
- * (string table produced by GNU ar always has a even size).
+ * GNU ar always pads the table to an even size.
+ * The pad character is either '\n' or '`'.
*/
- if (p != ar->strtab + size && *p != '\n')
+ if (p != ar->strtab + size && *p != '\n' && *p != '`')
goto bad_string_table;
/* Enforce zero termination. */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c b/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
index 2c50abc6b88..1def0006a6e 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.26 2008/01/15 04:56:48 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_cpio.c 201163 2009-12-29 05:50:34Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -92,7 +92,7 @@ struct links_entry {
struct links_entry *previous;
int links;
dev_t dev;
- ino_t ino;
+ int64_t ino;
char *name;
};
@@ -150,7 +150,9 @@ archive_read_support_format_cpio(struct archive *_a)
r = __archive_read_register_format(a,
cpio,
+ "cpio",
archive_read_format_cpio_bid,
+ NULL,
archive_read_format_cpio_read_header,
archive_read_format_cpio_read_data,
NULL,
@@ -165,7 +167,6 @@ archive_read_support_format_cpio(struct archive *_a)
static int
archive_read_format_cpio_bid(struct archive_read *a)
{
- int bytes_read;
const void *h;
const unsigned char *p;
struct cpio *cpio;
@@ -173,11 +174,7 @@ archive_read_format_cpio_bid(struct archive_read *a)
cpio = (struct cpio *)(a->format->data);
- bytes_read = (a->decompressor->read_ahead)(a, &h, 6);
- /* Convert error code into error return. */
- if (bytes_read < 0)
- return ((int)bytes_read);
- if (bytes_read < 6)
+ if ((h = __archive_read_ahead(a, 6, NULL)) == NULL)
return (-1);
p = (const unsigned char *)h;
@@ -228,7 +225,6 @@ archive_read_format_cpio_read_header(struct archive_read *a,
struct archive_entry *entry)
{
struct cpio *cpio;
- size_t bytes;
const void *h;
size_t namelength;
size_t name_pad;
@@ -241,27 +237,31 @@ archive_read_format_cpio_read_header(struct archive_read *a,
return (r);
/* Read name from buffer. */
- bytes = (a->decompressor->read_ahead)(a, &h, namelength + name_pad);
- if (bytes < namelength + name_pad)
+ h = __archive_read_ahead(a, namelength + name_pad, NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, namelength + name_pad);
+ __archive_read_consume(a, namelength + name_pad);
archive_strncpy(&cpio->entry_name, (const char *)h, namelength);
archive_entry_set_pathname(entry, cpio->entry_name.s);
cpio->entry_offset = 0;
/* If this is a symlink, read the link contents. */
if (archive_entry_filetype(entry) == AE_IFLNK) {
- bytes = (a->decompressor->read_ahead)(a, &h,
- cpio->entry_bytes_remaining);
- if ((off_t)bytes < cpio->entry_bytes_remaining)
+ h = __archive_read_ahead(a, cpio->entry_bytes_remaining, NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, cpio->entry_bytes_remaining);
+ __archive_read_consume(a, cpio->entry_bytes_remaining);
archive_strncpy(&cpio->entry_linkname, (const char *)h,
cpio->entry_bytes_remaining);
archive_entry_set_symlink(entry, cpio->entry_linkname.s);
cpio->entry_bytes_remaining = 0;
}
+ /* XXX TODO: If the full mode is 0160200, then this is a Solaris
+ * ACL description for the following entry. Read this body
+ * and parse it as a Solaris-style ACL, then read the next
+ * header. XXX */
+
/* Compare name to "TRAILER!!!" to test for end-of-archive. */
if (namelength == 11 && strcmp((const char *)h, "TRAILER!!!") == 0) {
/* TODO: Store file location of start of block. */
@@ -284,7 +284,7 @@ archive_read_format_cpio_read_data(struct archive_read *a,
cpio = (struct cpio *)(a->format->data);
if (cpio->entry_bytes_remaining > 0) {
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
if (bytes_read > cpio->entry_bytes_remaining)
@@ -293,16 +293,16 @@ archive_read_format_cpio_read_data(struct archive_read *a,
*offset = cpio->entry_offset;
cpio->entry_offset += bytes_read;
cpio->entry_bytes_remaining -= bytes_read;
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
return (ARCHIVE_OK);
} else {
while (cpio->entry_padding > 0) {
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
if (bytes_read > cpio->entry_padding)
bytes_read = cpio->entry_padding;
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
cpio->entry_padding -= bytes_read;
}
*buff = NULL;
@@ -336,11 +336,12 @@ find_newc_header(struct archive_read *a)
{
const void *h;
const char *p, *q;
- size_t skip, bytes, skipped = 0;
+ size_t skip, skipped = 0;
+ ssize_t bytes;
for (;;) {
- bytes = (a->decompressor->read_ahead)(a, &h, 2048);
- if (bytes < sizeof(struct cpio_newc_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_newc_header), &bytes);
+ if (h == NULL)
return (ARCHIVE_FATAL);
p = h;
q = p + bytes;
@@ -355,14 +356,14 @@ find_newc_header(struct archive_read *a)
* Scan ahead until we find something that looks
* like an odc header.
*/
- while (p + sizeof(struct cpio_newc_header) < q) {
+ while (p + sizeof(struct cpio_newc_header) <= q) {
switch (p[5]) {
case '1':
case '2':
if (memcmp("07070", p, 5) == 0
&& is_hex(p, sizeof(struct cpio_newc_header))) {
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
skipped += skip;
if (skipped > 0) {
archive_set_error(&a->archive,
@@ -385,7 +386,7 @@ find_newc_header(struct archive_read *a)
}
}
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
skipped += skip;
}
}
@@ -396,7 +397,6 @@ header_newc(struct archive_read *a, struct cpio *cpio,
{
const void *h;
const struct cpio_newc_header *header;
- size_t bytes;
int r;
r = find_newc_header(a);
@@ -404,10 +404,10 @@ header_newc(struct archive_read *a, struct cpio *cpio,
return (r);
/* Read fixed-size portion of header. */
- bytes = (a->decompressor->read_ahead)(a, &h, sizeof(struct cpio_newc_header));
- if (bytes < sizeof(struct cpio_newc_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_newc_header), NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, sizeof(struct cpio_newc_header));
+ __archive_read_consume(a, sizeof(struct cpio_newc_header));
/* Parse out hex fields. */
header = (const struct cpio_newc_header *)h;
@@ -471,11 +471,12 @@ find_odc_header(struct archive_read *a)
{
const void *h;
const char *p, *q;
- size_t skip, bytes, skipped = 0;
+ size_t skip, skipped = 0;
+ ssize_t bytes;
for (;;) {
- bytes = (a->decompressor->read_ahead)(a, &h, 512);
- if (bytes < sizeof(struct cpio_odc_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_odc_header), &bytes);
+ if (h == NULL)
return (ARCHIVE_FATAL);
p = h;
q = p + bytes;
@@ -489,13 +490,13 @@ find_odc_header(struct archive_read *a)
* Scan ahead until we find something that looks
* like an odc header.
*/
- while (p + sizeof(struct cpio_odc_header) < q) {
+ while (p + sizeof(struct cpio_odc_header) <= q) {
switch (p[5]) {
case '7':
if (memcmp("070707", p, 6) == 0
&& is_octal(p, sizeof(struct cpio_odc_header))) {
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
skipped += skip;
if (skipped > 0) {
archive_set_error(&a->archive,
@@ -518,7 +519,7 @@ find_odc_header(struct archive_read *a)
}
}
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
skipped += skip;
}
}
@@ -530,7 +531,6 @@ header_odc(struct archive_read *a, struct cpio *cpio,
const void *h;
int r;
const struct cpio_odc_header *header;
- size_t bytes;
a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
a->archive.archive_format_name = "POSIX octet-oriented cpio";
@@ -541,10 +541,10 @@ header_odc(struct archive_read *a, struct cpio *cpio,
return (r);
/* Read fixed-size portion of header. */
- bytes = (a->decompressor->read_ahead)(a, &h, sizeof(struct cpio_odc_header));
- if (bytes < sizeof(struct cpio_odc_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_odc_header), NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, sizeof(struct cpio_odc_header));
+ __archive_read_consume(a, sizeof(struct cpio_odc_header));
/* Parse out octal fields. */
header = (const struct cpio_odc_header *)h;
@@ -578,16 +578,15 @@ header_bin_le(struct archive_read *a, struct cpio *cpio,
{
const void *h;
const struct cpio_bin_header *header;
- size_t bytes;
a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_LE;
a->archive.archive_format_name = "cpio (little-endian binary)";
/* Read fixed-size portion of header. */
- bytes = (a->decompressor->read_ahead)(a, &h, sizeof(struct cpio_bin_header));
- if (bytes < sizeof(struct cpio_bin_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_bin_header), NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, sizeof(struct cpio_bin_header));
+ __archive_read_consume(a, sizeof(struct cpio_bin_header));
/* Parse out binary fields. */
header = (const struct cpio_bin_header *)h;
@@ -615,17 +614,15 @@ header_bin_be(struct archive_read *a, struct cpio *cpio,
{
const void *h;
const struct cpio_bin_header *header;
- size_t bytes;
a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_BE;
a->archive.archive_format_name = "cpio (big-endian binary)";
/* Read fixed-size portion of header. */
- bytes = (a->decompressor->read_ahead)(a, &h,
- sizeof(struct cpio_bin_header));
- if (bytes < sizeof(struct cpio_bin_header))
+ h = __archive_read_ahead(a, sizeof(struct cpio_bin_header), NULL);
+ if (h == NULL)
return (ARCHIVE_FATAL);
- (a->decompressor->consume)(a, sizeof(struct cpio_bin_header));
+ __archive_read_consume(a, sizeof(struct cpio_bin_header));
/* Parse out binary fields. */
header = (const struct cpio_bin_header *)h;
@@ -677,7 +674,7 @@ le4(const unsigned char *p)
static int
be4(const unsigned char *p)
{
- return (p[0] + (p[1]<<8) + (p[2]<<16) + (p[3]<<24));
+ return ((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + (p[3]));
}
/*
@@ -730,48 +727,51 @@ atol16(const char *p, unsigned char_cnt)
static void
record_hardlink(struct cpio *cpio, struct archive_entry *entry)
{
- struct links_entry *le;
+ struct links_entry *le;
dev_t dev;
- ino_t ino;
+ int64_t ino;
+
+ if (archive_entry_nlink(entry) <= 1)
+ return;
dev = archive_entry_dev(entry);
- ino = archive_entry_ino(entry);
-
- /*
- * First look in the list of multiply-linked files. If we've
- * already dumped it, convert this entry to a hard link entry.
- */
- for (le = cpio->links_head; le; le = le->next) {
- if (le->dev == dev && le->ino == ino) {
- archive_entry_copy_hardlink(entry, le->name);
-
- if (--le->links <= 0) {
- if (le->previous != NULL)
- le->previous->next = le->next;
- if (le->next != NULL)
- le->next->previous = le->previous;
- if (cpio->links_head == le)
- cpio->links_head = le->next;
+ ino = archive_entry_ino64(entry);
+
+ /*
+ * First look in the list of multiply-linked files. If we've
+ * already dumped it, convert this entry to a hard link entry.
+ */
+ for (le = cpio->links_head; le; le = le->next) {
+ if (le->dev == dev && le->ino == ino) {
+ archive_entry_copy_hardlink(entry, le->name);
+
+ if (--le->links <= 0) {
+ if (le->previous != NULL)
+ le->previous->next = le->next;
+ if (le->next != NULL)
+ le->next->previous = le->previous;
+ if (cpio->links_head == le)
+ cpio->links_head = le->next;
free(le->name);
- free(le);
- }
+ free(le);
+ }
- return;
- }
- }
+ return;
+ }
+ }
- le = (struct links_entry *)malloc(sizeof(struct links_entry));
+ le = (struct links_entry *)malloc(sizeof(struct links_entry));
if (le == NULL)
__archive_errx(1, "Out of memory adding file to list");
- if (cpio->links_head != NULL)
- cpio->links_head->previous = le;
- le->next = cpio->links_head;
- le->previous = NULL;
- cpio->links_head = le;
- le->dev = dev;
- le->ino = ino;
- le->links = archive_entry_nlink(entry) - 1;
- le->name = strdup(archive_entry_pathname(entry));
+ if (cpio->links_head != NULL)
+ cpio->links_head->previous = le;
+ le->next = cpio->links_head;
+ le->previous = NULL;
+ cpio->links_head = le;
+ le->dev = dev;
+ le->ino = ino;
+ le->links = archive_entry_nlink(entry) - 1;
+ le->name = strdup(archive_entry_pathname(entry));
if (le->name == NULL)
__archive_errx(1, "Out of memory adding file to list");
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_empty.c b/archivers/libarchive/files/libarchive/archive_read_support_format_empty.c
index 837fdef997c..518fdcb4913 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_empty.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_empty.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_empty.c,v 1.3 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_empty.c 191524 2009-04-26 18:24:14Z kientzle $");
#include "archive.h"
#include "archive_entry.h"
@@ -44,7 +44,9 @@ archive_read_support_format_empty(struct archive *_a)
r = __archive_read_register_format(a,
NULL,
+ NULL,
archive_read_format_empty_bid,
+ NULL,
archive_read_format_empty_read_header,
archive_read_format_empty_read_data,
NULL,
@@ -57,11 +59,10 @@ archive_read_support_format_empty(struct archive *_a)
static int
archive_read_format_empty_bid(struct archive_read *a)
{
- int bytes_read;
- const void *h;
+ ssize_t avail;
- bytes_read = (a->decompressor->read_ahead)(a, &h, 1);
- if (bytes_read > 0)
+ (void)__archive_read_ahead(a, 1, &avail);
+ if (avail != 0)
return (-1);
return (1);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c b/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
index 481220dd47b..0c640c88e86 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
@@ -1,5 +1,7 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Andreas Henriksson <andreas@fatal.se>
+ * Copyright (c) 2009 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +26,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.26 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_iso9660.c 201246 2009-12-30 05:30:35Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -38,8 +40,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1
#include <string.h>
#endif
#include <time.h>
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
#include "archive.h"
+#include "archive_endian.h"
#include "archive_entry.h"
#include "archive_private.h"
#include "archive_read_private.h"
@@ -72,6 +78,8 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1
* the file body. This strategy allows us to read most compliant
* CDs with a single pass through the data, as required by libarchive.
*/
+#define LOGICAL_BLOCK_SIZE 2048
+#define SYSTEM_AREA_BLOCK 16
/* Structure of on-disk primary volume descriptor. */
#define PVD_type_offset 0
@@ -138,6 +146,46 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1
#define PVD_reserved4_size 1
#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
#define PVD_application_data_size 512
+#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
+#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
+
+/* TODO: It would make future maintenance easier to just hardcode the
+ * above values. In particular, ECMA119 states the offsets as part of
+ * the standard. That would eliminate the need for the following check.*/
+#if PVD_reserved5_offset != 1395
+#error PVD offset and size definitions are wrong.
+#endif
+
+
+/* Structure of optional on-disk supplementary volume descriptor. */
+#define SVD_type_offset 0
+#define SVD_type_size 1
+#define SVD_id_offset (SVD_type_offset + SVD_type_size)
+#define SVD_id_size 5
+#define SVD_version_offset (SVD_id_offset + SVD_id_size)
+#define SVD_version_size 1
+/* ... */
+#define SVD_reserved1_offset 72
+#define SVD_reserved1_size 8
+#define SVD_volume_space_size_offset 80
+#define SVD_volume_space_size_size 8
+#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
+#define SVD_escape_sequences_size 32
+/* ... */
+#define SVD_logical_block_size_offset 128
+#define SVD_logical_block_size_size 4
+#define SVD_type_L_path_table_offset 140
+#define SVD_type_M_path_table_offset 148
+/* ... */
+#define SVD_root_directory_record_offset 156
+#define SVD_root_directory_record_size 34
+#define SVD_file_structure_version_offset 881
+#define SVD_reserved2_offset 882
+#define SVD_reserved2_size 1
+#define SVD_reserved3_offset 1395
+#define SVD_reserved3_size 653
+/* ... */
+/* FIXME: validate correctness of last SVD entry offset. */
/* Structure of an on-disk directory record. */
/* Note: ISO9660 stores each multi-byte integer twice, once in
@@ -166,57 +214,149 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1
#define DR_name_len_size 1
#define DR_name_offset 33
-/*
- * Our private data.
- */
+#ifdef HAVE_ZLIB_H
+static const unsigned char zisofs_magic[8] = {
+ 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07
+};
+
+struct zisofs {
+ /* Set 1 if this file compressed by paged zlib */
+ int pz;
+ int pz_log2_bs; /* Log2 of block size */
+ uint64_t pz_uncompressed_size;
+
+ int initialized;
+ unsigned char *uncompressed_buffer;
+ size_t uncompressed_buffer_size;
+
+ uint32_t pz_offset;
+ unsigned char header[16];
+ size_t header_avail;
+ int header_passed;
+ unsigned char *block_pointers;
+ size_t block_pointers_alloc;
+ size_t block_pointers_size;
+ size_t block_pointers_avail;
+ size_t block_off;
+ uint32_t block_avail;
+
+ z_stream stream;
+ int stream_valid;
+};
+#else
+struct zisofs {
+ /* Set 1 if this file compressed by paged zlib */
+ int pz;
+};
+#endif
+
+struct content {
+ uint64_t offset;/* Offset on disk. */
+ uint64_t size; /* File size in bytes. */
+ struct content *next;
+};
/* In-memory storage for a directory record. */
struct file_info {
+ struct file_info *use_next;
struct file_info *parent;
- int refcount;
- uint64_t offset; /* Offset on disk. */
- uint64_t size; /* File size in bytes. */
- uint64_t ce_offset; /* Offset of CE */
- uint64_t ce_size; /* Size of CE */
- time_t mtime; /* File last modified time. */
- time_t atime; /* File last accessed time. */
- time_t ctime; /* File creation time. */
- uint64_t rdev; /* Device number */
+ struct file_info *next;
+ int subdirs;
+ uint64_t key; /* Heap Key. */
+ uint64_t offset; /* Offset on disk. */
+ uint64_t size; /* File size in bytes. */
+ uint32_t ce_offset; /* Offset of CE. */
+ uint32_t ce_size; /* Size of CE. */
+ char re; /* Having RRIP "RE" extension. */
+ uint64_t cl_offset; /* Having RRIP "CL" extension. */
+ int birthtime_is_set;
+ time_t birthtime; /* File created time. */
+ time_t mtime; /* File last modified time. */
+ time_t atime; /* File last accessed time. */
+ time_t ctime; /* File attribute change time. */
+ uint64_t rdev; /* Device number. */
mode_t mode;
uid_t uid;
gid_t gid;
- ino_t inode;
+ int64_t number;
int nlinks;
- char *name; /* Null-terminated filename. */
+ struct archive_string name; /* Pathname */
+ char name_continues; /* Non-zero if name continues */
struct archive_string symlink;
+ char symlink_continues; /* Non-zero if link continues */
+ /* Set 1 if this file compressed by paged zlib(zisofs) */
+ int pz;
+ int pz_log2_bs; /* Log2 of block size */
+ uint64_t pz_uncompressed_size;
+ /* Set 1 if this file is multi extent. */
+ int multi_extent;
+ struct {
+ struct content *first;
+ struct content **last;
+ } contents;
+ char exposed;
};
+struct heap_queue {
+ struct file_info **files;
+ int allocated;
+ int used;
+};
struct iso9660 {
int magic;
#define ISO9660_MAGIC 0x96609660
+
+ int opt_support_joliet;
+ int opt_support_rockridge;
+
struct archive_string pathname;
- char seenRockridge; /* Set true if RR extensions are used. */
- unsigned char suspOffset;
+ char seenRockridge; /* Set true if RR extensions are used. */
+ char seenSUSP; /* Set true if SUSP is beging used. */
+ char seenJoliet;
- uint64_t previous_offset;
- uint64_t previous_size;
+ unsigned char suspOffset;
+ struct file_info *rr_moved;
+ struct heap_queue re_dirs;
+ struct heap_queue cl_files;
+ struct read_ce_queue {
+ struct read_ce_req {
+ uint64_t offset;/* Offset of CE on disk. */
+ struct file_info *file;
+ } *reqs;
+ int cnt;
+ int allocated;
+ } read_ce_req;
+
+ int64_t previous_number;
struct archive_string previous_pathname;
- /* TODO: Make this a heap for fast inserts and deletions. */
- struct file_info **pending_files;
- int pending_files_allocated;
- int pending_files_used;
+ struct file_info *use_files;
+ struct heap_queue pending_files;
+ struct {
+ struct file_info *first;
+ struct file_info **last;
+ } cache_files;
uint64_t current_position;
ssize_t logical_block_size;
+ uint64_t volume_size; /* Total size of volume in bytes. */
+ int32_t volume_block;/* Total size of volume in logical blocks. */
+
+ struct vd {
+ int location; /* Location of Extent. */
+ uint32_t size;
+ } primary, joliet;
off_t entry_sparse_offset;
int64_t entry_bytes_remaining;
+ struct zisofs entry_zisofs;
+ struct content *entry_content;
};
-static void add_entry(struct iso9660 *iso9660, struct file_info *file);
static int archive_read_format_iso9660_bid(struct archive_read *);
+static int archive_read_format_iso9660_options(struct archive_read *,
+ const char *, const char *);
static int archive_read_format_iso9660_cleanup(struct archive_read *);
static int archive_read_format_iso9660_read_data(struct archive_read *,
const void **, size_t *, off_t *);
@@ -224,22 +364,55 @@ static int archive_read_format_iso9660_read_data_skip(struct archive_read *);
static int archive_read_format_iso9660_read_header(struct archive_read *,
struct archive_entry *);
static const char *build_pathname(struct archive_string *, struct file_info *);
+#if DEBUG
static void dump_isodirrec(FILE *, const unsigned char *isodirrec);
+#endif
static time_t time_from_tm(struct tm *);
static time_t isodate17(const unsigned char *);
static time_t isodate7(const unsigned char *);
+static int isBootRecord(struct iso9660 *, const unsigned char *);
+static int isVolumePartition(struct iso9660 *, const unsigned char *);
+static int isVDSetTerminator(struct iso9660 *, const unsigned char *);
+static int isJolietSVD(struct iso9660 *, const unsigned char *);
+static int isSVD(struct iso9660 *, const unsigned char *);
+static int isEVD(struct iso9660 *, const unsigned char *);
static int isPVD(struct iso9660 *, const unsigned char *);
-static struct file_info *next_entry(struct iso9660 *);
+static struct file_info *next_cache_entry(struct iso9660 *iso9660);
static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660,
struct file_info **pfile);
static struct file_info *
- parse_file_info(struct iso9660 *iso9660,
+ parse_file_info(struct archive_read *a,
struct file_info *parent, const unsigned char *isodirrec);
-static void parse_rockridge(struct iso9660 *iso9660,
+static int parse_rockridge(struct archive_read *a,
struct file_info *file, const unsigned char *start,
const unsigned char *end);
-static void release_file(struct iso9660 *, struct file_info *);
+static int register_CE(struct archive_read *a, int32_t location,
+ struct file_info *file);
+static int read_CE(struct archive_read *a, struct iso9660 *iso9660);
+static void parse_rockridge_NM1(struct file_info *,
+ const unsigned char *, int);
+static void parse_rockridge_SL1(struct file_info *,
+ const unsigned char *, int);
+static void parse_rockridge_TF1(struct file_info *,
+ const unsigned char *, int);
+static void parse_rockridge_ZF1(struct file_info *,
+ const unsigned char *, int);
+static void register_file(struct iso9660 *, struct file_info *);
+static void release_files(struct iso9660 *);
static unsigned toi(const void *p, int n);
+static inline void cache_add_entry(struct iso9660 *iso9660,
+ struct file_info *file);
+static inline void cache_add_to_next_of_parent(struct iso9660 *iso9660,
+ struct file_info *file);
+static inline struct file_info *cache_get_entry(struct iso9660 *iso9660);
+static void heap_add_entry(struct heap_queue *heap,
+ struct file_info *file, uint64_t key);
+static struct file_info *heap_get_entry(struct heap_queue *heap);
+
+#define add_entry(iso9660, file) \
+ heap_add_entry(&((iso9660)->pending_files), file, file->offset)
+#define next_entry(iso9660) \
+ heap_get_entry(&((iso9660)->pending_files))
int
archive_read_support_format_iso9660(struct archive *_a)
@@ -255,10 +428,18 @@ archive_read_support_format_iso9660(struct archive *_a)
}
memset(iso9660, 0, sizeof(*iso9660));
iso9660->magic = ISO9660_MAGIC;
+ iso9660->cache_files.first = NULL;
+ iso9660->cache_files.last = &(iso9660->cache_files.first);
+ /* Enable to support Joliet extensions by default. */
+ iso9660->opt_support_joliet = 1;
+ /* Enable to support Rock Ridge extensions by default. */
+ iso9660->opt_support_rockridge = 1;
r = __archive_read_register_format(a,
iso9660,
+ "iso9660",
archive_read_format_iso9660_bid,
+ archive_read_format_iso9660_options,
archive_read_format_iso9660_read_header,
archive_read_format_iso9660_read_data,
archive_read_format_iso9660_read_data_skip,
@@ -279,7 +460,7 @@ archive_read_format_iso9660_bid(struct archive_read *a)
ssize_t bytes_read;
const void *h;
const unsigned char *p;
- int bid;
+ int seenTerminator;
iso9660 = (struct iso9660 *)(a->format->data);
@@ -288,54 +469,647 @@ archive_read_format_iso9660_bid(struct archive_read *a)
* 8 sectors of the volume descriptor table. Of course,
* if the I/O layer gives us more, we'll take it.
*/
- bytes_read = (a->decompressor->read_ahead)(a, &h, 32768 + 8*2048);
- if (bytes_read < 32768 + 8*2048)
+#define RESERVED_AREA (SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
+ h = __archive_read_ahead(a,
+ RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
+ &bytes_read);
+ if (h == NULL)
return (-1);
p = (const unsigned char *)h;
/* Skip the reserved area. */
- bytes_read -= 32768;
- p += 32768;
-
- /* Check each volume descriptor to locate the PVD. */
- for (; bytes_read > 2048; bytes_read -= 2048, p += 2048) {
- bid = isPVD(iso9660, p);
- if (bid > 0)
- return (bid);
- if (*p == '\177') /* End-of-volume-descriptor marker. */
+ bytes_read -= RESERVED_AREA;
+ p += RESERVED_AREA;
+
+ /* Check each volume descriptor. */
+ seenTerminator = 0;
+ for (; bytes_read > LOGICAL_BLOCK_SIZE;
+ bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
+ /* Do not handle undefined Volume Descriptor Type. */
+ if (p[0] >= 4 && p[0] <= 254)
+ return (0);
+ /* Standard Identifier must be "CD001" */
+ if (memcmp(p + 1, "CD001", 5) != 0)
+ return (0);
+ if (!iso9660->primary.location) {
+ if (isPVD(iso9660, p))
+ continue;
+ }
+ if (!iso9660->joliet.location) {
+ if (isJolietSVD(iso9660, p))
+ continue;
+ }
+ if (isBootRecord(iso9660, p))
+ continue;
+ if (isEVD(iso9660, p))
+ continue;
+ if (isSVD(iso9660, p))
+ continue;
+ if (isVolumePartition(iso9660, p))
+ continue;
+ if (isVDSetTerminator(iso9660, p)) {
+ seenTerminator = 1;
break;
+ }
+ return (0);
}
+ /*
+ * ISO 9660 format must have Primary Volume Descriptor and
+ * Volume Descriptor Set Terminator.
+ */
+ if (seenTerminator && iso9660->primary.location > 16)
+ return (48);
/* We didn't find a valid PVD; return a bid of zero. */
return (0);
}
static int
+archive_read_format_iso9660_options(struct archive_read *a,
+ const char *key, const char *val)
+{
+ struct iso9660 *iso9660;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
+
+ if (strcmp(key, "joliet") == 0) {
+ if (val == NULL || strcmp(val, "off") == 0 ||
+ strcmp(val, "ignore") == 0 ||
+ strcmp(val, "disable") == 0 ||
+ strcmp(val, "0") == 0)
+ iso9660->opt_support_joliet = 0;
+ else
+ iso9660->opt_support_joliet = 1;
+ return (ARCHIVE_OK);
+ }
+ if (strcmp(key, "rockridge") == 0 ||
+ strcmp(key, "Rockridge") == 0) {
+ iso9660->opt_support_rockridge = val != NULL;
+ return (ARCHIVE_OK);
+ }
+
+ /* Note: The "warn" return is just to inform the options
+ * supervisor that we didn't handle it. It will generate
+ * a suitable error if noone used this option. */
+ return (ARCHIVE_WARN);
+}
+
+static int
+isBootRecord(struct iso9660 *iso9660, const unsigned char *h)
+{
+ (void)iso9660; /* UNUSED */
+
+ /* Type of the Volume Descriptor Boot Record must be 0. */
+ if (h[0] != 0)
+ return (0);
+
+ /* Volume Descriptor Version must be 1. */
+ if (h[6] != 1)
+ return (0);
+
+ return (1);
+}
+
+static int
+isVolumePartition(struct iso9660 *iso9660, const unsigned char *h)
+{
+ int32_t location;
+
+ /* Type of the Volume Partition Descriptor must be 3. */
+ if (h[0] != 3)
+ return (0);
+
+ /* Volume Descriptor Version must be 1. */
+ if (h[6] != 1)
+ return (0);
+ /* Unused Field */
+ if (h[7] != 0)
+ return (0);
+
+ location = archive_le32dec(h + 72);
+ if (location <= SYSTEM_AREA_BLOCK ||
+ location >= iso9660->volume_block)
+ return (0);
+ if ((uint32_t)location != archive_be32dec(h + 76))
+ return (0);
+
+ return (1);
+}
+
+static int
+isVDSetTerminator(struct iso9660 *iso9660, const unsigned char *h)
+{
+ int i;
+
+ (void)iso9660; /* UNUSED */
+
+ /* Type of the Volume Descriptor Set Terminator must be 255. */
+ if (h[0] != 255)
+ return (0);
+
+ /* Volume Descriptor Version must be 1. */
+ if (h[6] != 1)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 7; i < 2048; ++i)
+ if (h[i] != 0)
+ return (0);
+
+ return (1);
+}
+
+static int
+isJolietSVD(struct iso9660 *iso9660, const unsigned char *h)
+{
+ const unsigned char *p;
+ ssize_t logical_block_size;
+ int32_t volume_block;
+
+ /* Check if current sector is a kind of Supplementary Volume
+ * Descriptor. */
+ if (!isSVD(iso9660, h))
+ return (0);
+
+ /* FIXME: do more validations according to joliet spec. */
+
+ /* check if this SVD contains joliet extension! */
+ p = h + SVD_escape_sequences_offset;
+ /* N.B. Joliet spec says p[1] == '\\', but.... */
+ if (p[0] == '%' && p[1] == '/') {
+ int level = 0;
+
+ if (p[2] == '@')
+ level = 1;
+ else if (p[2] == 'C')
+ level = 2;
+ else if (p[2] == 'E')
+ level = 3;
+ else /* not joliet */
+ return (0);
+
+ iso9660->seenJoliet = level;
+
+ } else /* not joliet */
+ return (0);
+
+ logical_block_size =
+ archive_le16dec(h + SVD_logical_block_size_offset);
+ volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
+
+ iso9660->logical_block_size = logical_block_size;
+ iso9660->volume_block = volume_block;
+ iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
+ /* Read Root Directory Record in Volume Descriptor. */
+ p = h + SVD_root_directory_record_offset;
+ iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
+ iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
+
+ return (48);
+}
+
+static int
+isSVD(struct iso9660 *iso9660, const unsigned char *h)
+{
+ const unsigned char *p;
+ ssize_t logical_block_size;
+ int32_t volume_block;
+ int32_t location;
+ int i;
+
+ (void)iso9660; /* UNUSED */
+
+ /* Type 2 means it's a SVD. */
+ if (h[SVD_type_offset] != 2)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < SVD_reserved1_size; ++i)
+ if (h[SVD_reserved1_offset + i] != 0)
+ return (0);
+ for (i = 0; i < SVD_reserved2_size; ++i)
+ if (h[SVD_reserved2_offset + i] != 0)
+ return (0);
+ for (i = 0; i < SVD_reserved3_size; ++i)
+ if (h[SVD_reserved3_offset + i] != 0)
+ return (0);
+
+ /* File structure version must be 1 for ISO9660/ECMA119. */
+ if (h[SVD_file_structure_version_offset] != 1)
+ return (0);
+
+ logical_block_size =
+ archive_le16dec(h + SVD_logical_block_size_offset);
+ if (logical_block_size <= 0)
+ return (0);
+
+ volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
+ if (volume_block <= SYSTEM_AREA_BLOCK+4)
+ return (0);
+
+ /* Location of Occurrence of Type L Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_le32dec(h+SVD_type_L_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+ /* Location of Occurrence of Type M Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+SVD_type_M_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+ /* Read Root Directory Record in Volume Descriptor. */
+ p = h + SVD_root_directory_record_offset;
+ if (p[DR_length_offset] != 34)
+ return (0);
+
+ return (48);
+}
+
+static int
+isEVD(struct iso9660 *iso9660, const unsigned char *h)
+{
+ const unsigned char *p;
+ ssize_t logical_block_size;
+ int32_t volume_block;
+ int32_t location;
+ int i;
+
+ (void)iso9660; /* UNUSED */
+
+ /* Type of the Enhanced Volume Descriptor must be 2. */
+ if (h[PVD_type_offset] != 2)
+ return (0);
+
+ /* EVD version must be 2. */
+ if (h[PVD_version_offset] != 2)
+ return (0);
+
+ /* Reserved field must be 0. */
+ if (h[PVD_reserved1_offset] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved2_size; ++i)
+ if (h[PVD_reserved2_offset + i] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved3_size; ++i)
+ if (h[PVD_reserved3_offset + i] != 0)
+ return (0);
+
+ /* Logical block size must be > 0. */
+ /* I've looked at Ecma 119 and can't find any stronger
+ * restriction on this field. */
+ logical_block_size =
+ archive_le16dec(h + PVD_logical_block_size_offset);
+ if (logical_block_size <= 0)
+ return (0);
+
+ volume_block =
+ archive_le32dec(h + PVD_volume_space_size_offset);
+ if (volume_block <= SYSTEM_AREA_BLOCK+4)
+ return (0);
+
+ /* File structure version must be 2 for ISO9660:1999. */
+ if (h[PVD_file_structure_version_offset] != 2)
+ return (0);
+
+ /* Location of Occurrence of Type L Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_le32dec(h+PVD_type_1_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+ /* Location of Occurrence of Type M Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+PVD_type_m_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved4_size; ++i)
+ if (h[PVD_reserved4_offset + i] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved5_size; ++i)
+ if (h[PVD_reserved5_offset + i] != 0)
+ return (0);
+
+ /* Read Root Directory Record in Volume Descriptor. */
+ p = h + PVD_root_directory_record_offset;
+ if (p[DR_length_offset] != 34)
+ return (0);
+
+ return (48);
+}
+
+static int
isPVD(struct iso9660 *iso9660, const unsigned char *h)
{
- struct file_info *file;
+ const unsigned char *p;
+ ssize_t logical_block_size;
+ int32_t volume_block;
+ int32_t location;
+ int i;
+
+ /* Type of the Primary Volume Descriptor must be 1. */
+ if (h[PVD_type_offset] != 1)
+ return (0);
+
+ /* PVD version must be 1. */
+ if (h[PVD_version_offset] != 1)
+ return (0);
+
+ /* Reserved field must be 0. */
+ if (h[PVD_reserved1_offset] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved2_size; ++i)
+ if (h[PVD_reserved2_offset + i] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved3_size; ++i)
+ if (h[PVD_reserved3_offset + i] != 0)
+ return (0);
+
+ /* Logical block size must be > 0. */
+ /* I've looked at Ecma 119 and can't find any stronger
+ * restriction on this field. */
+ logical_block_size =
+ archive_le16dec(h + PVD_logical_block_size_offset);
+ if (logical_block_size <= 0)
+ return (0);
+
+ volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
+ if (volume_block <= SYSTEM_AREA_BLOCK+4)
+ return (0);
- if (h[0] != 1)
+ /* File structure version must be 1 for ISO9660/ECMA119. */
+ if (h[PVD_file_structure_version_offset] != 1)
return (0);
- if (memcmp(h+1, "CD001", 5) != 0)
+
+ /* Location of Occurrence of Type L Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_le32dec(h+PVD_type_1_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+ /* Location of Occurrence of Type M Path Table must be
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+PVD_type_m_path_table_offset);
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
return (0);
- iso9660->logical_block_size = toi(h + PVD_logical_block_size_offset, 2);
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved4_size; ++i)
+ if (h[PVD_reserved4_offset + i] != 0)
+ return (0);
+
+ /* Reserved field must be 0. */
+ for (i = 0; i < PVD_reserved5_size; ++i)
+ if (h[PVD_reserved5_offset + i] != 0)
+ return (0);
+
+ /* XXX TODO: Check other values for sanity; reject more
+ * malformed PVDs. XXX */
+
+ /* Read Root Directory Record in Volume Descriptor. */
+ p = h + PVD_root_directory_record_offset;
+ if (p[DR_length_offset] != 34)
+ return (0);
+
+ iso9660->logical_block_size = logical_block_size;
+ iso9660->volume_block = volume_block;
+ iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
+ iso9660->primary.location = archive_le32dec(p + DR_extent_offset);
+ iso9660->primary.size = archive_le32dec(p + DR_size_offset);
- /* Store the root directory in the pending list. */
- file = parse_file_info(iso9660, NULL, h + PVD_root_directory_record_offset);
- add_entry(iso9660, file);
return (48);
}
static int
+read_children(struct archive_read *a, struct file_info *parent)
+{
+ struct iso9660 *iso9660;
+ const unsigned char *b, *p;
+ struct file_info *multi;
+ size_t step;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
+ if (iso9660->current_position > parent->offset) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Ignoring out-of-order directory (%s) %jd > %jd",
+ parent->name.s,
+ iso9660->current_position,
+ parent->offset);
+ return (ARCHIVE_WARN);
+ }
+ if (parent->offset + parent->size > iso9660->volume_size) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Directory is beyond end-of-media: %s",
+ parent->name);
+ return (ARCHIVE_WARN);
+ }
+ if (iso9660->current_position < parent->offset) {
+ int64_t skipsize;
+
+ skipsize = parent->offset - iso9660->current_position;
+ skipsize = __archive_read_skip(a, skipsize);
+ if (skipsize < 0)
+ return ((int)skipsize);
+ iso9660->current_position = parent->offset;
+ }
+
+ step = ((parent->size + iso9660->logical_block_size -1) /
+ iso9660->logical_block_size) * iso9660->logical_block_size;
+ b = __archive_read_ahead(a, step, NULL);
+ if (b == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Failed to read full block when scanning "
+ "ISO9660 directory list");
+ return (ARCHIVE_FATAL);
+ }
+ __archive_read_consume(a, step);
+ iso9660->current_position += step;
+ multi = NULL;
+ while (step) {
+ p = b;
+ b += iso9660->logical_block_size;
+ step -= iso9660->logical_block_size;
+ for (; *p != 0 && p < b && p + *p <= b; p += *p) {
+ struct file_info *child;
+
+ /* N.B.: these special directory identifiers
+ * are 8 bit "values" even on a
+ * Joliet CD with UCS-2 (16bit) encoding.
+ */
+
+ /* Skip '.' entry. */
+ if (*(p + DR_name_len_offset) == 1
+ && *(p + DR_name_offset) == '\0')
+ continue;
+ /* Skip '..' entry. */
+ if (*(p + DR_name_len_offset) == 1
+ && *(p + DR_name_offset) == '\001')
+ continue;
+ child = parse_file_info(a, parent, p);
+ if (child == NULL)
+ return (ARCHIVE_FATAL);
+ if (child->cl_offset)
+ heap_add_entry(&(iso9660->cl_files),
+ child, child->cl_offset);
+ else {
+ if (child->multi_extent || multi != NULL) {
+ struct content *con;
+
+ if (multi == NULL) {
+ multi = child;
+ multi->contents.first = NULL;
+ multi->contents.last =
+ &(multi->contents.first);
+ }
+ con = malloc(sizeof(struct content));
+ if (con == NULL) {
+ archive_set_error(
+ &a->archive, ENOMEM,
+ "No memory for "
+ "multi extent");
+ return (ARCHIVE_FATAL);
+ }
+ con->offset = child->offset;
+ con->size = child->size;
+ con->next = NULL;
+ *multi->contents.last = con;
+ multi->contents.last = &(con->next);
+ if (multi == child)
+ add_entry(iso9660, child);
+ else {
+ multi->size += child->size;
+ if (!child->multi_extent)
+ multi = NULL;
+ }
+ } else
+ add_entry(iso9660, child);
+ }
+ }
+ }
+
+ /* Read data which recorded by RRIP "CE" extension. */
+ if (read_CE(a, iso9660) != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+
+ return (ARCHIVE_OK);
+}
+
+static int
+relocate_dir(struct iso9660 *iso9660, struct file_info *file)
+{
+ struct file_info *re;
+
+ re = heap_get_entry(&(iso9660->re_dirs));
+ while (re != NULL && re->offset < file->cl_offset) {
+ /* This case is wrong pattern.
+ * But dont't reject this directory entry to be robust. */
+ cache_add_entry(iso9660, re);
+ re = heap_get_entry(&(iso9660->re_dirs));
+ }
+ if (re == NULL)
+ /* This case is wrong pattern. */
+ return (0);
+ if (re->offset == file->cl_offset) {
+ re->parent->subdirs--;
+ re->parent = file->parent;
+ re->parent->subdirs++;
+ cache_add_to_next_of_parent(iso9660, re);
+ return (1);
+ } else
+ /* This case is wrong pattern. */
+ heap_add_entry(&(iso9660->re_dirs), re, re->offset);
+ return (0);
+}
+
+static int
+read_entries(struct archive_read *a)
+{
+ struct iso9660 *iso9660;
+ struct file_info *file;
+ int r;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
+
+ while ((file = next_entry(iso9660)) != NULL &&
+ (file->mode & AE_IFMT) == AE_IFDIR) {
+ r = read_children(a, file);
+ if (r != ARCHIVE_OK)
+ return (r);
+
+ if (iso9660->seenRockridge &&
+ file->parent != NULL &&
+ file->parent->parent == NULL &&
+ iso9660->rr_moved == NULL &&
+ (strcmp(file->name.s, "rr_moved") == 0 ||
+ strcmp(file->name.s, ".rr_moved") == 0)) {
+ iso9660->rr_moved = file;
+ } else if (file->re)
+ heap_add_entry(&(iso9660->re_dirs), file,
+ file->offset);
+ else
+ cache_add_entry(iso9660, file);
+ }
+ if (file != NULL)
+ add_entry(iso9660, file);
+
+ if (iso9660->rr_moved != NULL) {
+ /*
+ * Relocate directory which rr_moved has.
+ */
+ while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL)
+ relocate_dir(iso9660, file);
+
+ /* If rr_moved directory still has children,
+ * Add rr_moved into pending_files to show
+ */
+ if (iso9660->rr_moved->subdirs) {
+ cache_add_entry(iso9660, iso9660->rr_moved);
+ /* If entries which have "RE" extension are still
+ * remaining(this case is unlikely except ISO image
+ * is broken), the entries won't be exposed. */
+ while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL)
+ cache_add_entry(iso9660, file);
+ } else
+ iso9660->rr_moved->parent->subdirs--;
+ } else {
+ /*
+ * In case ISO image is broken. If the name of rr_moved
+ * directory has been changed by damage, subdirectories
+ * of rr_moved entry won't be exposed.
+ */
+ while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL)
+ cache_add_entry(iso9660, file);
+ }
+
+ return (ARCHIVE_OK);
+}
+
+static int
archive_read_format_iso9660_read_header(struct archive_read *a,
struct archive_entry *entry)
{
struct iso9660 *iso9660;
struct file_info *file;
- ssize_t bytes_read;
- int r;
+ int r, rd_r;
iso9660 = (struct iso9660 *)(a->format->data);
@@ -344,6 +1118,93 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
a->archive.archive_format_name = "ISO9660";
}
+ if (iso9660->current_position == 0) {
+ int64_t skipsize;
+ struct vd *vd;
+ const void *block;
+ char seenJoliet;
+
+ vd = &(iso9660->primary);
+ if (!iso9660->opt_support_joliet)
+ iso9660->seenJoliet = 0;
+ if (iso9660->seenJoliet &&
+ vd->location > iso9660->joliet.location)
+ /* This condition is unlikely; by way of caution. */
+ vd = &(iso9660->joliet);
+
+ skipsize = LOGICAL_BLOCK_SIZE * vd->location;
+ skipsize = __archive_read_skip(a, skipsize);
+ if (skipsize < 0)
+ return ((int)skipsize);
+ iso9660->current_position = skipsize;
+
+ block = __archive_read_ahead(a, vd->size, NULL);
+ if (block == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to read full block when scanning "
+ "ISO9660 directory list");
+ return (ARCHIVE_FATAL);
+ }
+
+ /*
+ * While reading Root Directory, flag seenJoliet
+ * must be zero to avoid converting special name
+ * 0x00(Current Directory) and next byte to UCS2.
+ */
+ seenJoliet = iso9660->seenJoliet;/* Save flag. */
+ iso9660->seenJoliet = 0;
+ file = parse_file_info(a, NULL, block);
+ if (file == NULL)
+ return (ARCHIVE_FATAL);
+ iso9660->seenJoliet = seenJoliet;
+ if (vd == &(iso9660->primary) && iso9660->seenRockridge
+ && iso9660->seenJoliet)
+ /*
+ * If iso image has RockRidge and Joliet,
+ * we use RockRidge Extensions.
+ */
+ iso9660->seenJoliet = 0;
+ if (vd == &(iso9660->primary) && !iso9660->seenRockridge
+ && iso9660->seenJoliet) {
+ /* Switch reading data from primary to joliet. */
+ vd = &(iso9660->joliet);
+ skipsize = LOGICAL_BLOCK_SIZE * vd->location;
+ skipsize -= iso9660->current_position;
+ skipsize = __archive_read_skip(a, skipsize);
+ if (skipsize < 0)
+ return ((int)skipsize);
+ iso9660->current_position += skipsize;
+
+ block = __archive_read_ahead(a, vd->size, NULL);
+ if (block == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to read full block when scanning "
+ "ISO9660 directory list");
+ return (ARCHIVE_FATAL);
+ }
+ seenJoliet = iso9660->seenJoliet;/* Save flag. */
+ iso9660->seenJoliet = 0;
+ file = parse_file_info(a, NULL, block);
+ if (file == NULL)
+ return (ARCHIVE_FATAL);
+ iso9660->seenJoliet = seenJoliet;
+ }
+ /* Store the root directory in the pending list. */
+ add_entry(iso9660, file);
+ if (iso9660->seenRockridge) {
+ a->archive.archive_format =
+ ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
+ a->archive.archive_format_name =
+ "ISO9660 with Rockridge extensions";
+ }
+ rd_r = read_entries(a);
+ if (rd_r == ARCHIVE_FATAL)
+ return (ARCHIVE_FATAL);
+ } else
+ rd_r = ARCHIVE_OK;
+
/* Get the next entry that appears after the current offset. */
r = next_entry_seek(a, iso9660, &file);
if (r != ARCHIVE_OK)
@@ -352,12 +1213,23 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
iso9660->entry_bytes_remaining = file->size;
iso9660->entry_sparse_offset = 0; /* Offset for sparse-file-aware clients. */
+ if (file->offset + file->size > iso9660->volume_size) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "File is beyond end-of-media: %s", file->name);
+ iso9660->entry_bytes_remaining = 0;
+ iso9660->entry_sparse_offset = 0;
+ return (ARCHIVE_WARN);
+ }
+
/* Set up the entry structure with information about this entry. */
archive_entry_set_mode(entry, file->mode);
archive_entry_set_uid(entry, file->uid);
archive_entry_set_gid(entry, file->gid);
archive_entry_set_nlink(entry, file->nlinks);
- archive_entry_set_ino(entry, file->inode);
+ if (file->birthtime_is_set)
+ archive_entry_set_birthtime(entry, file->birthtime, 0);
+ else
+ archive_entry_unset_birthtime(entry);
archive_entry_set_mtime(entry, file->mtime, 0);
archive_entry_set_ctime(entry, file->ctime, 0);
archive_entry_set_atime(entry, file->atime, 0);
@@ -370,81 +1242,85 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
if (file->symlink.s != NULL)
archive_entry_copy_symlink(entry, file->symlink.s);
- /* If this entry points to the same data as the previous
- * entry, convert this into a hardlink to that entry.
- * But don't bother for zero-length files. */
- if (file->offset == iso9660->previous_offset
- && file->size == iso9660->previous_size
- && file->size > 0) {
+ /* Note: If the input isn't seekable, we can't rewind to
+ * return the same body again, so if the next entry refers to
+ * the same data, we have to return it as a hardlink to the
+ * original entry. */
+ if (file->number != -1 &&
+ file->number == iso9660->previous_number) {
archive_entry_set_hardlink(entry,
iso9660->previous_pathname.s);
+ archive_entry_unset_size(entry);
iso9660->entry_bytes_remaining = 0;
iso9660->entry_sparse_offset = 0;
- release_file(iso9660, file);
return (ARCHIVE_OK);
}
- /* If the offset is before our current position, we can't
- * seek backwards to extract it, so issue a warning. */
- if (file->offset < iso9660->current_position) {
+ /* Except for the hardlink case above, if the offset of the
+ * next entry is before our current position, we can't seek
+ * backwards to extract it, so issue a warning. Note that
+ * this can only happen if this entry was added to the heap
+ * after we passed this offset, that is, only if the directory
+ * mentioning this entry is later than the body of the entry.
+ * Such layouts are very unusual; most ISO9660 writers lay out
+ * and record all directory information first, then store
+ * all file bodies. */
+ /* TODO: Someday, libarchive's I/O core will support optional
+ * seeking. When that day comes, this code should attempt to
+ * seek and only return the error if the seek fails. That
+ * will give us support for whacky ISO images that require
+ * seeking while retaining the ability to read almost all ISO
+ * images in a streaming fashion. */
+ if ((file->mode & AE_IFMT) != AE_IFDIR &&
+ file->offset < iso9660->current_position) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Ignoring out-of-order file");
+ "Ignoring out-of-order file @%x (%s) %jd < %jd",
+ file,
+ iso9660->pathname.s,
+ file->offset, iso9660->current_position);
iso9660->entry_bytes_remaining = 0;
iso9660->entry_sparse_offset = 0;
- release_file(iso9660, file);
return (ARCHIVE_WARN);
}
- iso9660->previous_size = file->size;
- iso9660->previous_offset = file->offset;
+ /* Initialize zisofs variables. */
+ iso9660->entry_zisofs.pz = file->pz;
+ if (file->pz) {
+#ifdef HAVE_ZLIB_H
+ struct zisofs *zisofs;
+
+ zisofs = &iso9660->entry_zisofs;
+ zisofs->initialized = 0;
+ zisofs->pz_log2_bs = file->pz_log2_bs;
+ zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
+ zisofs->pz_offset = 0;
+ zisofs->header_avail = 0;
+ zisofs->header_passed = 0;
+ zisofs->block_pointers_avail = 0;
+#endif
+ archive_entry_set_size(entry, file->pz_uncompressed_size);
+ }
+
+ iso9660->previous_number = file->number;
archive_strcpy(&iso9660->previous_pathname, iso9660->pathname.s);
- /* If this is a directory, read in all of the entries right now. */
+ /* Reset entry_bytes_remaining if the file is multi extent. */
+ iso9660->entry_content = file->contents.first;
+ if (iso9660->entry_content != NULL)
+ iso9660->entry_bytes_remaining = iso9660->entry_content->size;
+
if (archive_entry_filetype(entry) == AE_IFDIR) {
- while (iso9660->entry_bytes_remaining > 0) {
- const void *block;
- const unsigned char *p;
- ssize_t step = iso9660->logical_block_size;
- if (step > iso9660->entry_bytes_remaining)
- step = iso9660->entry_bytes_remaining;
- bytes_read = (a->decompressor->read_ahead)(a, &block, step);
- if (bytes_read < step) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Failed to read full block when scanning ISO9660 directory list");
- release_file(iso9660, file);
- return (ARCHIVE_FATAL);
- }
- if (bytes_read > step)
- bytes_read = step;
- (a->decompressor->consume)(a, bytes_read);
- iso9660->current_position += bytes_read;
- iso9660->entry_bytes_remaining -= bytes_read;
- for (p = (const unsigned char *)block;
- *p != 0 && p < (const unsigned char *)block + bytes_read;
- p += *p) {
- struct file_info *child;
-
- /* Skip '.' entry. */
- if (*(p + DR_name_len_offset) == 1
- && *(p + DR_name_offset) == '\0')
- continue;
- /* Skip '..' entry. */
- if (*(p + DR_name_len_offset) == 1
- && *(p + DR_name_offset) == '\001')
- continue;
- child = parse_file_info(iso9660, file, p);
- add_entry(iso9660, child);
- if (iso9660->seenRockridge) {
- a->archive.archive_format =
- ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
- a->archive.archive_format_name =
- "ISO9660 with Rockridge extensions";
- }
- }
- }
+ /* Overwrite nlinks by proper link number which is
+ * calculated from number of sub directories. */
+ archive_entry_set_nlink(entry, 2 + file->subdirs);
+ /* Directory data has been read completely. */
+ iso9660->entry_bytes_remaining = 0;
+ iso9660->entry_sparse_offset = 0;
+ file->exposed = 1;
}
- release_file(iso9660, file);
+ if (rd_r != ARCHIVE_OK)
+ return (rd_r);
return (ARCHIVE_OK);
}
@@ -457,6 +1333,241 @@ archive_read_format_iso9660_read_data_skip(struct archive_read *a)
return (ARCHIVE_OK);
}
+#ifdef HAVE_ZLIB_H
+
+static int
+zisofs_read_data(struct archive_read *a,
+ const void **buff, size_t *size, off_t *offset)
+{
+ struct iso9660 *iso9660;
+ struct zisofs *zisofs;
+ const unsigned char *p;
+ size_t avail;
+ ssize_t bytes_read;
+ size_t uncompressed_size;
+ int r;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
+ zisofs = &iso9660->entry_zisofs;
+
+ p = __archive_read_ahead(a, 1, &bytes_read);
+ if (bytes_read <= 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated zisofs file body");
+ return (ARCHIVE_FATAL);
+ }
+ if (bytes_read > iso9660->entry_bytes_remaining)
+ bytes_read = iso9660->entry_bytes_remaining;
+ avail = bytes_read;
+ uncompressed_size = 0;
+
+ if (!zisofs->initialized) {
+ size_t ceil, xsize;
+
+ /* Allocate block pointers buffer. */
+ ceil = (zisofs->pz_uncompressed_size +
+ (1LL << zisofs->pz_log2_bs) - 1)
+ >> zisofs->pz_log2_bs;
+ xsize = (ceil + 1) * 4;
+ if (zisofs->block_pointers_alloc < xsize) {
+ size_t alloc;
+
+ if (zisofs->block_pointers != NULL)
+ free(zisofs->block_pointers);
+ alloc = ((xsize >> 10) + 1) << 10;
+ zisofs->block_pointers = malloc(alloc);
+ if (zisofs->block_pointers == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "No memory for zisofs decompression");
+ return (ARCHIVE_FATAL);
+ }
+ zisofs->block_pointers_alloc = alloc;
+ }
+ zisofs->block_pointers_size = xsize;
+
+ /* Allocate uncompressed data buffer. */
+ xsize = 1UL << zisofs->pz_log2_bs;
+ if (zisofs->uncompressed_buffer_size < xsize) {
+ if (zisofs->uncompressed_buffer != NULL)
+ free(zisofs->uncompressed_buffer);
+ zisofs->uncompressed_buffer = malloc(xsize);
+ if (zisofs->uncompressed_buffer == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "No memory for zisofs decompression");
+ return (ARCHIVE_FATAL);
+ }
+ }
+ zisofs->uncompressed_buffer_size = xsize;
+
+ /*
+ * Read the file header, and check the magic code of zisofs.
+ */
+ if (zisofs->header_avail < sizeof(zisofs->header)) {
+ xsize = sizeof(zisofs->header) - zisofs->header_avail;
+ if (avail < xsize)
+ xsize = avail;
+ memcpy(zisofs->header + zisofs->header_avail, p, xsize);
+ zisofs->header_avail += xsize;
+ avail -= xsize;
+ p += xsize;
+ }
+ if (!zisofs->header_passed &&
+ zisofs->header_avail == sizeof(zisofs->header)) {
+ int err = 0;
+
+ if (memcmp(zisofs->header, zisofs_magic,
+ sizeof(zisofs_magic)) != 0)
+ err = 1;
+ if (archive_le32dec(zisofs->header + 8)
+ != zisofs->pz_uncompressed_size)
+ err = 1;
+ if (zisofs->header[12] != 4)
+ err = 1;
+ if (zisofs->header[13] != zisofs->pz_log2_bs)
+ err = 1;
+ if (err) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Illegal zisofs file body");
+ return (ARCHIVE_FATAL);
+ }
+ zisofs->header_passed = 1;
+ }
+ /*
+ * Read block pointers.
+ */
+ if (zisofs->header_passed &&
+ zisofs->block_pointers_avail < zisofs->block_pointers_size) {
+ xsize = zisofs->block_pointers_size
+ - zisofs->block_pointers_avail;
+ if (avail < xsize)
+ xsize = avail;
+ memcpy(zisofs->block_pointers
+ + zisofs->block_pointers_avail, p, xsize);
+ zisofs->block_pointers_avail += xsize;
+ avail -= xsize;
+ p += xsize;
+ if (zisofs->block_pointers_avail
+ == zisofs->block_pointers_size) {
+ /* We've got all block pointers and initialize
+ * related variables. */
+ zisofs->block_off = 0;
+ zisofs->block_avail = 0;
+ /* Complete a initialization */
+ zisofs->initialized = 1;
+ }
+ }
+
+ if (!zisofs->initialized)
+ goto next_data; /* We need more datas. */
+ }
+
+ /*
+ * Get block offsets from block pointers.
+ */
+ if (zisofs->block_avail == 0) {
+ uint32_t bst, bed;
+
+ if (zisofs->block_off + 4 >= zisofs->block_pointers_size) {
+ /* There isn't a pair of offsets. */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Illegal zisofs block pointers");
+ return (ARCHIVE_FATAL);
+ }
+ bst = archive_le32dec(zisofs->block_pointers + zisofs->block_off);
+ if (bst != zisofs->pz_offset + (bytes_read - avail)) {
+ /* TODO: Should we seek offset of current file by bst ? */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Illegal zisofs block pointers(cannot seek)");
+ return (ARCHIVE_FATAL);
+ }
+ bed = archive_le32dec(
+ zisofs->block_pointers + zisofs->block_off + 4);
+ if (bed < bst) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Illegal zisofs block pointers");
+ return (ARCHIVE_FATAL);
+ }
+ zisofs->block_avail = bed - bst;
+ zisofs->block_off += 4;
+
+ /* Initialize compression library for new block. */
+ if (zisofs->stream_valid)
+ r = inflateReset(&zisofs->stream);
+ else
+ r = inflateInit(&zisofs->stream);
+ if (r != Z_OK) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Can't initialize zisofs decompression.");
+ return (ARCHIVE_FATAL);
+ }
+ zisofs->stream_valid = 1;
+ zisofs->stream.total_in = 0;
+ zisofs->stream.total_out = 0;
+ }
+
+ /*
+ * Make uncompressed datas.
+ */
+ if (zisofs->block_avail == 0) {
+ memset(zisofs->uncompressed_buffer, 0,
+ zisofs->uncompressed_buffer_size);
+ uncompressed_size = zisofs->uncompressed_buffer_size;
+ } else {
+ zisofs->stream.next_in = (Bytef *)(uintptr_t)(const void *)p;
+ if (avail > zisofs->block_avail)
+ zisofs->stream.avail_in = zisofs->block_avail;
+ else
+ zisofs->stream.avail_in = avail;
+ zisofs->stream.next_out = zisofs->uncompressed_buffer;
+ zisofs->stream.avail_out = zisofs->uncompressed_buffer_size;
+
+ r = inflate(&zisofs->stream, 0);
+ switch (r) {
+ case Z_OK: /* Decompressor made some progress.*/
+ case Z_STREAM_END: /* Found end of stream. */
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "zisofs decompression failed (%d)", r);
+ return (ARCHIVE_FATAL);
+ }
+ uncompressed_size =
+ zisofs->uncompressed_buffer_size - zisofs->stream.avail_out;
+ avail -= zisofs->stream.next_in - p;
+ zisofs->block_avail -= zisofs->stream.next_in - p;
+ }
+next_data:
+ bytes_read -= avail;
+ *buff = zisofs->uncompressed_buffer;
+ *size = uncompressed_size;
+ *offset = iso9660->entry_sparse_offset;
+ iso9660->entry_sparse_offset += uncompressed_size;
+ iso9660->entry_bytes_remaining -= bytes_read;
+ iso9660->current_position += bytes_read;
+ zisofs->pz_offset += bytes_read;
+ __archive_read_consume(a, bytes_read);
+
+ return (ARCHIVE_OK);
+}
+
+#else /* HAVE_ZLIB_H */
+
+static int
+zisofs_read_data(struct archive_read *a,
+ const void **buff, size_t *size, off_t *offset)
+{
+
+ (void)buff;/* UNUSED */
+ (void)size;/* UNUSED */
+ (void)offset;/* UNUSED */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "zisofs is not supported on this platform.");
+ return (ARCHIVE_FAILED);
+}
+
+#endif /* HAVE_ZLIB_H */
+
static int
archive_read_format_iso9660_read_data(struct archive_read *a,
const void **buff, size_t *size, off_t *offset)
@@ -466,17 +1577,47 @@ archive_read_format_iso9660_read_data(struct archive_read *a,
iso9660 = (struct iso9660 *)(a->format->data);
if (iso9660->entry_bytes_remaining <= 0) {
- *buff = NULL;
- *size = 0;
- *offset = iso9660->entry_sparse_offset;
- return (ARCHIVE_EOF);
+ if (iso9660->entry_content != NULL)
+ iso9660->entry_content = iso9660->entry_content->next;
+ if (iso9660->entry_content == NULL) {
+ *buff = NULL;
+ *size = 0;
+ *offset = iso9660->entry_sparse_offset;
+ return (ARCHIVE_EOF);
+ }
+ /* Seek forward to the start of the entry. */
+ if (iso9660->current_position < iso9660->entry_content->offset) {
+ int64_t step;
+
+ step = iso9660->entry_content->offset -
+ iso9660->current_position;
+ step = __archive_read_skip(a, step);
+ if (step < 0)
+ return ((int)step);
+ iso9660->current_position =
+ iso9660->entry_content->offset;
+ }
+ if (iso9660->entry_content->offset < iso9660->current_position) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Ignoring out-of-order file (%s) %jd < %jd",
+ iso9660->pathname.s,
+ iso9660->entry_content->offset,
+ iso9660->current_position);
+ *buff = NULL;
+ *size = 0;
+ *offset = iso9660->entry_sparse_offset;
+ return (ARCHIVE_WARN);
+ }
+ iso9660->entry_bytes_remaining = iso9660->entry_content->size;
}
+ if (iso9660->entry_zisofs.pz)
+ return (zisofs_read_data(a, buff, size, offset));
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read == 0)
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Truncated input file");
- if (bytes_read <= 0)
+ if (*buff == NULL)
return (ARCHIVE_FATAL);
if (bytes_read > iso9660->entry_bytes_remaining)
bytes_read = iso9660->entry_bytes_remaining;
@@ -485,7 +1626,7 @@ archive_read_format_iso9660_read_data(struct archive_read *a,
iso9660->entry_sparse_offset += bytes_read;
iso9660->entry_bytes_remaining -= bytes_read;
iso9660->current_position += bytes_read;
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
return (ARCHIVE_OK);
}
@@ -493,18 +1634,33 @@ static int
archive_read_format_iso9660_cleanup(struct archive_read *a)
{
struct iso9660 *iso9660;
- struct file_info *file;
+ int r = ARCHIVE_OK;
iso9660 = (struct iso9660 *)(a->format->data);
- while ((file = next_entry(iso9660)) != NULL)
- release_file(iso9660, file);
+ release_files(iso9660);
+ free(iso9660->read_ce_req.reqs);
archive_string_free(&iso9660->pathname);
archive_string_free(&iso9660->previous_pathname);
- if (iso9660->pending_files)
- free(iso9660->pending_files);
+ if (iso9660->pending_files.files)
+ free(iso9660->pending_files.files);
+ if (iso9660->re_dirs.files)
+ free(iso9660->re_dirs.files);
+ if (iso9660->cl_files.files)
+ free(iso9660->cl_files.files);
+#ifdef HAVE_ZLIB_H
+ free(iso9660->entry_zisofs.uncompressed_buffer);
+ free(iso9660->entry_zisofs.block_pointers);
+ if (iso9660->entry_zisofs.stream_valid) {
+ if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Failed to clean up zlib decompressor");
+ r = ARCHIVE_FATAL;
+ }
+ }
+#endif
free(iso9660);
(a->format->data) = NULL;
- return (ARCHIVE_OK);
+ return (r);
}
/*
@@ -512,55 +1668,202 @@ archive_read_format_iso9660_cleanup(struct archive_read *a)
* of any extensions, and stores the result in memory.
*/
static struct file_info *
-parse_file_info(struct iso9660 *iso9660, struct file_info *parent,
+parse_file_info(struct archive_read *a, struct file_info *parent,
const unsigned char *isodirrec)
{
+ struct iso9660 *iso9660;
struct file_info *file;
size_t name_len;
+ const unsigned char *rr_start, *rr_end;
+ const unsigned char *p;
+ size_t dr_len;
+ int32_t location;
int flags;
- /* TODO: Sanity check that name_len doesn't exceed length, etc. */
+ iso9660 = (struct iso9660 *)(a->format->data);
+
+ dr_len = (size_t)isodirrec[DR_length_offset];
+ name_len = (size_t)isodirrec[DR_name_len_offset];
+ location = archive_le32dec(isodirrec + DR_extent_offset);
+ /* Sanity check that dr_len needs at least 34. */
+ if (dr_len < 34) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid length of directory record");
+ return (NULL);
+ }
+ /* Sanity check that name_len doesn't exceed dr_len. */
+ if (dr_len - 33 < name_len || name_len == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid length of file identifier");
+ return (NULL);
+ }
+ /* Sanity check that location doesn't exceed volume block.
+ * Don't check lower limit of location; it's possibility
+ * the location has negative value when file type is symbolic
+ * link or file size is zero. As far as I know latest mkisofs
+ * do that.
+ */
+ if (location >= iso9660->volume_block) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid location of extent of file");
+ return (NULL);
+ }
/* Create a new file entry and copy data from the ISO dir record. */
file = (struct file_info *)malloc(sizeof(*file));
- if (file == NULL)
+ if (file == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "No memory for file entry");
return (NULL);
+ }
memset(file, 0, sizeof(*file));
file->parent = parent;
- if (parent != NULL)
- parent->refcount++;
- file->offset = toi(isodirrec + DR_extent_offset, DR_extent_size)
- * iso9660->logical_block_size;
+ file->offset = iso9660->logical_block_size * (uint64_t)location;
file->size = toi(isodirrec + DR_size_offset, DR_size_size);
file->mtime = isodate7(isodirrec + DR_date_offset);
file->ctime = file->atime = file->mtime;
- name_len = (size_t)*(const unsigned char *)(isodirrec + DR_name_len_offset);
- file->name = (char *)malloc(name_len + 1);
- if (file->name == NULL) {
- free(file);
- return (NULL);
+
+ p = isodirrec + DR_name_offset;
+ /* Rockridge extensions (if any) follow name. Compute this
+ * before fidgeting the name_len below. */
+ rr_start = p + name_len + (name_len & 1 ? 0 : 1);
+ rr_end = isodirrec + dr_len;
+
+ if (iso9660->seenJoliet) {
+ /* Joliet names are max 64 chars (128 bytes) according to spec,
+ * but genisoimage/mkisofs allows recording longer Joliet
+ * names which are 103 UCS2 characters(206 bytes) by their
+ * option '-joliet-long'.
+ */
+ wchar_t wbuff[103+1], *wp;
+ const unsigned char *c;
+
+ if (name_len > 206)
+ name_len = 206;
+ /* convert BE UTF-16 to wchar_t */
+ for (c = p, wp = wbuff;
+ c < (p + name_len) &&
+ wp < (wbuff + sizeof(wbuff)/sizeof(*wbuff) - 1);
+ c += 2) {
+ *wp++ = (((255 & (int)c[0]) << 8) | (255 & (int)c[1]));
+ }
+ *wp = L'\0';
+
+#if 0 /* untested code, is it at all useful on Joliet? */
+ /* trim trailing first version and dot from filename.
+ *
+ * Remember we where in UTF-16BE land!
+ * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
+ * 16 bits big endian characters on Joliet.
+ *
+ * TODO: sanitize filename?
+ * Joliet allows any UCS-2 char except:
+ * *, /, :, ;, ? and \.
+ */
+ /* Chop off trailing ';1' from files. */
+ if (*(wp-2) == ';' && *(wp-1) == '1') {
+ wp-=2;
+ *wp = L'\0';
+ }
+
+ /* Chop off trailing '.' from filenames. */
+ if (*(wp-1) == '.')
+ *(--wp) = L'\0';
+#endif
+
+ /* store the result in the file name field. */
+ archive_strappend_w_utf8(&file->name, wbuff);
+ } else {
+ /* Chop off trailing ';1' from files. */
+ if (name_len > 2 && p[name_len - 2] == ';' &&
+ p[name_len - 1] == '1')
+ name_len -= 2;
+ /* Chop off trailing '.' from filenames. */
+ if (name_len > 1 && p[name_len - 1] == '.')
+ --name_len;
+
+ archive_strncpy(&file->name, (const char *)p, name_len);
}
- memcpy(file->name, isodirrec + DR_name_offset, name_len);
- file->name[name_len] = '\0';
- flags = *(isodirrec + DR_flags_offset);
+
+ flags = isodirrec[DR_flags_offset];
if (flags & 0x02)
file->mode = AE_IFDIR | 0700;
else
file->mode = AE_IFREG | 0400;
+ if (flags & 0x80)
+ file->multi_extent = 1;
+ else
+ file->multi_extent = 0;
+ /*
+ * Use location for file number.
+ * File number is treated as inode number to find out harlink
+ * target. If Rockridge extensions is being used, file number
+ * will be overwritten by FILE SERIAL NUMBER of RRIP "PX"
+ * extension.
+ * NOTE: Old mkisofs did not record that FILE SERIAL NUMBER
+ * in ISO images.
+ */
+ if (file->size == 0 && location >= 0)
+ /* If file->size is zero, its location points wrong place.
+ * Dot not use it for file number.
+ * When location has negative value, it can be used
+ * for file number.
+ */
+ file->number = -1;
+ else
+ file->number = (int64_t)(uint32_t)location;
/* Rockridge extensions overwrite information from above. */
- {
- const unsigned char *rr_start, *rr_end;
- rr_end = (const unsigned char *)isodirrec
- + *(isodirrec + DR_length_offset);
- rr_start = (const unsigned char *)(isodirrec + DR_name_offset
- + name_len);
- if ((name_len & 1) == 0)
- rr_start++;
- rr_start += iso9660->suspOffset;
- parse_rockridge(iso9660, file, rr_start, rr_end);
+ if (iso9660->opt_support_rockridge) {
+ if (parent == NULL && rr_end - rr_start >= 7) {
+ p = rr_start;
+ if (p[0] == 'S' && p[1] == 'P'
+ && p[2] == 7 && p[3] == 1
+ && p[4] == 0xBE && p[5] == 0xEF) {
+ /*
+ * SP extension stores the suspOffset
+ * (Number of bytes to skip between
+ * filename and SUSP records.)
+ * It is mandatory by the SUSP standard
+ * (IEEE 1281).
+ *
+ * It allows SUSP to coexist with
+ * non-SUSP uses of the System
+ * Use Area by placing non-SUSP data
+ * before SUSP data.
+ *
+ * SP extension must be in the root
+ * directory entry, disable all SUSP
+ * processing if not found.
+ */
+ iso9660->suspOffset = p[6];
+ iso9660->seenSUSP = 1;
+ rr_start += 7;
+ }
+ }
+ if (iso9660->seenSUSP) {
+ int r;
+
+ file->name_continues = 0;
+ file->symlink_continues = 0;
+ rr_start += iso9660->suspOffset;
+ r = parse_rockridge(a, file, rr_start, rr_end);
+ if (r != ARCHIVE_OK) {
+ free(file);
+ return (NULL);
+ }
+ } else
+ /* If there isn't SUSP, disable parsing
+ * rock ridge extensions. */
+ iso9660->opt_support_rockridge = 0;
}
+ file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
+ /* Tell file's parent how many children that parent has. */
+ if (parent != NULL && (flags & 0x02) && file->cl_offset == 0)
+ parent->subdirs++;
+
+#if DEBUG
/* DEBUGGING: Warn about attributes I don't yet fully support. */
if ((flags & ~0x02) != 0) {
fprintf(stderr, "\n ** Unrecognized flag: ");
@@ -583,46 +1886,23 @@ parse_file_info(struct iso9660 *iso9660, struct file_info *parent,
dump_isodirrec(stderr, isodirrec);
fprintf(stderr, "\n");
}
-
+#endif
+ register_file(iso9660, file);
return (file);
}
-static void
-add_entry(struct iso9660 *iso9660, struct file_info *file)
-{
- /* Expand our pending files list as necessary. */
- if (iso9660->pending_files_used >= iso9660->pending_files_allocated) {
- struct file_info **new_pending_files;
- int new_size = iso9660->pending_files_allocated * 2;
-
- if (iso9660->pending_files_allocated < 1024)
- new_size = 1024;
- /* Overflow might keep us from growing the list. */
- if (new_size <= iso9660->pending_files_allocated)
- __archive_errx(1, "Out of memory");
- new_pending_files = (struct file_info **)malloc(new_size * sizeof(new_pending_files[0]));
- if (new_pending_files == NULL)
- __archive_errx(1, "Out of memory");
- memcpy(new_pending_files, iso9660->pending_files,
- iso9660->pending_files_allocated * sizeof(new_pending_files[0]));
- if (iso9660->pending_files != NULL)
- free(iso9660->pending_files);
- iso9660->pending_files = new_pending_files;
- iso9660->pending_files_allocated = new_size;
- }
-
- iso9660->pending_files[iso9660->pending_files_used++] = file;
-}
-
-static void
-parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
+static int
+parse_rockridge(struct archive_read *a, struct file_info *file,
const unsigned char *p, const unsigned char *end)
{
- (void)iso9660; /* UNUSED */
+ struct iso9660 *iso9660;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
- while (p + 4 < end /* Enough space for another entry. */
+ while (p + 4 <= end /* Enough space for another entry. */
&& p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
&& p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
+ && p[2] >= 4 /* Sanity-check length. */
&& p + p[2] <= end) { /* Sanity-check length. */
const unsigned char *data = p + 4;
int data_length = p[2] - 4;
@@ -635,61 +1915,64 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
*/
switch(p[0]) {
case 'C':
- if (p[0] == 'C' && p[1] == 'E' && version == 1) {
- /*
- * CE extension comprises:
- * 8 byte sector containing extension
- * 8 byte offset w/in above sector
- * 8 byte length of continuation
- */
- file->ce_offset = toi(data, 4)
- * iso9660->logical_block_size
- + toi(data + 8, 4);
- file->ce_size = toi(data + 16, 4);
+ if (p[0] == 'C' && p[1] == 'E') {
+ if (version == 1 && data_length == 24) {
+ /*
+ * CE extension comprises:
+ * 8 byte sector containing extension
+ * 8 byte offset w/in above sector
+ * 8 byte length of continuation
+ */
+ int32_t location =
+ archive_le32dec(data);
+ file->ce_offset =
+ archive_le32dec(data+8);
+ file->ce_size =
+ archive_le32dec(data+16);
+ if (register_CE(a, location, file)
+ != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ }
+ break;
+ }
+ if (p[0] == 'C' && p[1] == 'L') {
+ if (version == 1 && data_length == 8) {
+ file->cl_offset = (uint64_t)
+ iso9660->logical_block_size *
+ (uint64_t)archive_le32dec(data);
+ iso9660->seenRockridge = 1;
+ }
break;
}
/* FALLTHROUGH */
case 'N':
- if (p[0] == 'N' && p[1] == 'M' && version == 1
- && *data == 0) {
- /* NM extension with flag byte == 0 */
- /*
- * NM extension comprises:
- * one byte flag
- * rest is long name
- */
- /* TODO: Obey flags. */
- char *old_name = file->name;
-
- data++; /* Skip flag byte. */
- data_length--;
- file->name = (char *)malloc(data_length + 1);
- if (file->name != NULL) {
- free(old_name);
- memcpy(file->name, data, data_length);
- file->name[data_length] = '\0';
- } else
- file->name = old_name;
+ if (p[0] == 'N' && p[1] == 'M') {
+ if (version == 1) {
+ parse_rockridge_NM1(file,
+ data, data_length);
+ iso9660->seenRockridge = 1;
+ }
break;
}
/* FALLTHROUGH */
case 'P':
- if (p[0] == 'P' && p[1] == 'D' && version == 1) {
+ if (p[0] == 'P' && p[1] == 'D') {
/*
* PD extension is padding;
* contents are always ignored.
*/
break;
}
- if (p[0] == 'P' && p[1] == 'N' && version == 1) {
- if (data_length == 16) {
+ if (p[0] == 'P' && p[1] == 'N') {
+ if (version == 1 && data_length == 16) {
file->rdev = toi(data,4);
file->rdev <<= 32;
file->rdev |= toi(data + 8, 4);
+ iso9660->seenRockridge = 1;
}
break;
}
- if (p[0] == 'P' && p[1] == 'X' && version == 1) {
+ if (p[0] == 'P' && p[1] == 'X') {
/*
* PX extension comprises:
* 8 bytes for mode,
@@ -698,99 +1981,52 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
* 8 bytes for gid,
* 8 bytes for inode.
*/
- if (data_length == 32) {
- file->mode = toi(data, 4);
- file->nlinks = toi(data + 8, 4);
- file->uid = toi(data + 16, 4);
- file->gid = toi(data + 24, 4);
- file->inode = toi(data + 32, 4);
+ if (version == 1) {
+ if (data_length >= 8)
+ file->mode
+ = toi(data, 4);
+ if (data_length >= 16)
+ file->nlinks
+ = toi(data + 8, 4);
+ if (data_length >= 24)
+ file->uid
+ = toi(data + 16, 4);
+ if (data_length >= 32)
+ file->gid
+ = toi(data + 24, 4);
+ if (data_length >= 40)
+ file->number
+ = toi(data + 32, 4);
+ iso9660->seenRockridge = 1;
}
break;
}
/* FALLTHROUGH */
case 'R':
- if (p[0] == 'R' && p[1] == 'R' && version == 1) {
+ if (p[0] == 'R' && p[1] == 'E' && version == 1) {
+ file->re = 1;
iso9660->seenRockridge = 1;
+ break;
+ }
+ if (p[0] == 'R' && p[1] == 'R' && version == 1) {
/*
* RR extension comprises:
* one byte flag value
+ * This extension is obsolete,
+ * so contents are always ignored.
*/
- /* TODO: Handle RR extension. */
break;
}
/* FALLTHROUGH */
case 'S':
- if (p[0] == 'S' && p[1] == 'L' && version == 1
- && *data == 0) {
- int cont = 1;
- /* SL extension with flags == 0 */
- /* TODO: handle non-zero flag values. */
- data++; /* Skip flag byte. */
- data_length--;
- while (data_length > 0) {
- unsigned char flag = *data++;
- unsigned char nlen = *data++;
- data_length -= 2;
-
- if (cont == 0)
- archive_strcat(&file->symlink, "/");
- cont = 0;
-
- switch(flag) {
- case 0x01: /* Continue */
- archive_strncat(&file->symlink,
- (const char *)data, nlen);
- cont = 1;
- break;
- case 0x02: /* Current */
- archive_strcat(&file->symlink, ".");
- break;
- case 0x04: /* Parent */
- archive_strcat(&file->symlink, "..");
- break;
- case 0x08: /* Root */
- case 0x10: /* Volume root */
- archive_string_empty(&file->symlink);
- break;
- case 0x20: /* Hostname */
- archive_strcat(&file->symlink, "hostname");
- break;
- case 0:
- archive_strncat(&file->symlink,
- (const char *)data, nlen);
- break;
- default:
- /* TODO: issue a warning ? */
- break;
- }
- data += nlen;
- data_length -= nlen;
+ if (p[0] == 'S' && p[1] == 'L') {
+ if (version == 1) {
+ parse_rockridge_SL1(file,
+ data, data_length);
+ iso9660->seenRockridge = 1;
}
break;
}
- if (p[0] == 'S' && p[1] == 'P'
- && version == 1 && data_length == 7
- && data[0] == (unsigned char)'\xbe'
- && data[1] == (unsigned char)'\xef') {
- /*
- * SP extension stores the suspOffset
- * (Number of bytes to skip between
- * filename and SUSP records.)
- * It is mandatory by the SUSP standard
- * (IEEE 1281).
- *
- * It allows SUSP to coexist with
- * non-SUSP uses of the System
- * Use Area by placing non-SUSP data
- * before SUSP data.
- *
- * TODO: Add a check for 'SP' in
- * first directory entry, disable all SUSP
- * processing if not found.
- */
- iso9660->suspOffset = data[2];
- break;
- }
if (p[0] == 'S' && p[1] == 'T'
&& data_length == 0 && version == 1) {
/*
@@ -802,92 +2038,436 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
* Use Area by placing non-SUSP data
* after SUSP data.
*/
- return;
+ iso9660->seenSUSP = 0;
+ iso9660->seenRockridge = 0;
+ return (ARCHIVE_OK);
}
case 'T':
- if (p[0] == 'T' && p[1] == 'F' && version == 1) {
- char flag = data[0];
- /*
- * TF extension comprises:
- * one byte flag
- * create time (optional)
- * modify time (optional)
- * access time (optional)
- * attribute time (optional)
- * Time format and presence of fields
- * is controlled by flag bits.
- */
- data++;
- if (flag & 0x80) {
- /* Use 17-byte time format. */
- if (flag & 1) /* Create time. */
- data += 17;
- if (flag & 2) { /* Modify time. */
- file->mtime = isodate17(data);
- data += 17;
- }
- if (flag & 4) { /* Access time. */
- file->atime = isodate17(data);
- data += 17;
- }
- if (flag & 8) { /* Attribute time. */
- file->ctime = isodate17(data);
- data += 17;
- }
- } else {
- /* Use 7-byte time format. */
- if (flag & 1) /* Create time. */
- data += 7;
- if (flag & 2) { /* Modify time. */
- file->mtime = isodate7(data);
- data += 7;
- }
- if (flag & 4) { /* Access time. */
- file->atime = isodate7(data);
- data += 7;
- }
- if (flag & 8) { /* Attribute time. */
- file->ctime = isodate7(data);
- data += 7;
- }
+ if (p[0] == 'T' && p[1] == 'F') {
+ if (version == 1) {
+ parse_rockridge_TF1(file,
+ data, data_length);
+ iso9660->seenRockridge = 1;
}
break;
}
/* FALLTHROUGH */
+ case 'Z':
+ if (p[0] == 'Z' && p[1] == 'F') {
+ if (version == 1)
+ parse_rockridge_ZF1(file,
+ data, data_length);
+ break;
+ }
+ /* FALLTHROUGH */
default:
/* The FALLTHROUGHs above leave us here for
* any unsupported extension. */
- {
- const unsigned char *t;
- fprintf(stderr, "\nUnsupported RRIP extension for %s\n", file->name);
- fprintf(stderr, " %c%c(%d):", p[0], p[1], data_length);
- for (t = data; t < data + data_length && t < data + 16; t++)
- fprintf(stderr, " %02x", *t);
- fprintf(stderr, "\n");
- }
+ break;
}
p += p[2];
}
+ return (ARCHIVE_OK);
+}
+
+static int
+register_CE(struct archive_read *a, int32_t location,
+ struct file_info *file)
+{
+ struct iso9660 *iso9660;
+ struct read_ce_queue *heap;
+ struct read_ce_req *p;
+ uint64_t offset, parent_offset;
+ int hole, parent;
+
+ iso9660 = (struct iso9660 *)(a->format->data);
+ offset = ((uint64_t)location) * (uint64_t)iso9660->logical_block_size;
+ if (((file->mode & AE_IFMT) == AE_IFREG &&
+ offset >= file->offset) ||
+ offset < iso9660->current_position) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid location in SUSP \"CE\" extension");
+ return (ARCHIVE_FATAL);
+ }
+
+ /* Expand our CE list as necessary. */
+ heap = &(iso9660->read_ce_req);
+ if (heap->cnt >= heap->allocated) {
+ int new_size;
+
+ if (heap->allocated < 16)
+ new_size = 16;
+ else
+ new_size = heap->allocated * 2;
+ /* Overflow might keep us from growing the list. */
+ if (new_size <= heap->allocated)
+ __archive_errx(1, "Out of memory");
+ p = malloc(new_size * sizeof(p[0]));
+ if (p == NULL)
+ __archive_errx(1, "Out of memory");
+ if (heap->reqs != NULL) {
+ memcpy(p, heap->reqs, heap->cnt * sizeof(*p));
+ free(heap->reqs);
+ }
+ heap->reqs = p;
+ heap->allocated = new_size;
+ }
+
+ /*
+ * Start with hole at end, walk it up tree to find insertion point.
+ */
+ hole = heap->cnt++;
+ while (hole > 0) {
+ parent = (hole - 1)/2;
+ parent_offset = heap->reqs[parent].offset;
+ if (offset >= parent_offset) {
+ heap->reqs[hole].offset = offset;
+ heap->reqs[hole].file = file;
+ return (ARCHIVE_OK);
+ }
+ // Move parent into hole <==> move hole up tree.
+ heap->reqs[hole] = heap->reqs[parent];
+ hole = parent;
+ }
+ heap->reqs[0].offset = offset;
+ heap->reqs[0].file = file;
+ return (ARCHIVE_OK);
+}
+
+static void
+next_CE(struct read_ce_queue *heap)
+{
+ uint64_t a_offset, b_offset, c_offset;
+ int a, b, c;
+ struct read_ce_req tmp;
+
+ if (heap->cnt < 1)
+ return;
+
+ /*
+ * Move the last item in the heap to the root of the tree
+ */
+ heap->reqs[0] = heap->reqs[--(heap->cnt)];
+
+ /*
+ * Rebalance the heap.
+ */
+ a = 0; // Starting element and its offset
+ a_offset = heap->reqs[a].offset;
+ for (;;) {
+ b = a + a + 1; // First child
+ if (b >= heap->cnt)
+ return;
+ b_offset = heap->reqs[b].offset;
+ c = b + 1; // Use second child if it is smaller.
+ if (c < heap->cnt) {
+ c_offset = heap->reqs[c].offset;
+ if (c_offset < b_offset) {
+ b = c;
+ b_offset = c_offset;
+ }
+ }
+ if (a_offset <= b_offset)
+ return;
+ tmp = heap->reqs[a];
+ heap->reqs[a] = heap->reqs[b];
+ heap->reqs[b] = tmp;
+ a = b;
+ }
+}
+
+
+static int
+read_CE(struct archive_read *a, struct iso9660 *iso9660)
+{
+ struct read_ce_queue *heap;
+ const unsigned char *b, *p, *end;
+ struct file_info *file;
+ size_t step;
+ int r;
+
+ /* Read data which RRIP "CE" extension points. */
+ heap = &(iso9660->read_ce_req);
+ step = iso9660->logical_block_size;
+ while (heap->cnt &&
+ heap->reqs[0].offset == iso9660->current_position) {
+ b = __archive_read_ahead(a, step, NULL);
+ if (b == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to read full block when scanning "
+ "ISO9660 directory list");
+ return (ARCHIVE_FATAL);
+ }
+ do {
+ file = heap->reqs[0].file;
+ p = b + file->ce_offset;
+ end = p + file->ce_size;
+ next_CE(heap);
+ r = parse_rockridge(a, file, p, end);
+ if (r != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ } while (heap->cnt &&
+ heap->reqs[0].offset == iso9660->current_position);
+ /* NOTE: Do not move this consume's code to fron of
+ * do-while loop. Registration of nested CE extension
+ * might cause error because of current position. */
+ __archive_read_consume(a, step);
+ iso9660->current_position += step;
+ }
+ return (ARCHIVE_OK);
}
static void
-release_file(struct iso9660 *iso9660, struct file_info *file)
+parse_rockridge_NM1(struct file_info *file,
+ const unsigned char *data, int data_length)
{
- struct file_info *parent;
+ if (!file->name_continues)
+ archive_string_empty(&file->name);
+ file->name_continues = 0;
+ if (data_length < 1)
+ return;
+ /*
+ * NM version 1 extension comprises:
+ * 1 byte flag, value is one of:
+ * = 0: remainder is name
+ * = 1: remainder is name, next NM entry continues name
+ * = 2: "."
+ * = 4: ".."
+ * = 32: Implementation specific
+ * All other values are reserved.
+ */
+ switch(data[0]) {
+ case 0:
+ if (data_length < 2)
+ return;
+ archive_strncat(&file->name, (const char *)data + 1, data_length - 1);
+ break;
+ case 1:
+ if (data_length < 2)
+ return;
+ archive_strncat(&file->name, (const char *)data + 1, data_length - 1);
+ file->name_continues = 1;
+ break;
+ case 2:
+ archive_strcat(&file->name, ".");
+ break;
+ case 4:
+ archive_strcat(&file->name, "..");
+ break;
+ default:
+ return;
+ }
+
+}
- if (file->refcount == 0) {
- parent = file->parent;
- if (file->name)
- free(file->name);
+static void
+parse_rockridge_TF1(struct file_info *file, const unsigned char *data,
+ int data_length)
+{
+ char flag;
+ /*
+ * TF extension comprises:
+ * one byte flag
+ * create time (optional)
+ * modify time (optional)
+ * access time (optional)
+ * attribute time (optional)
+ * Time format and presence of fields
+ * is controlled by flag bits.
+ */
+ if (data_length < 1)
+ return;
+ flag = data[0];
+ ++data;
+ --data_length;
+ if (flag & 0x80) {
+ /* Use 17-byte time format. */
+ if ((flag & 1) && data_length >= 17) {
+ /* Create time. */
+ file->birthtime_is_set = 1;
+ file->birthtime = isodate17(data);
+ data += 17;
+ data_length -= 17;
+ }
+ if ((flag & 2) && data_length >= 17) {
+ /* Modify time. */
+ file->mtime = isodate17(data);
+ data += 17;
+ data_length -= 17;
+ }
+ if ((flag & 4) && data_length >= 17) {
+ /* Access time. */
+ file->atime = isodate17(data);
+ data += 17;
+ data_length -= 17;
+ }
+ if ((flag & 8) && data_length >= 17) {
+ /* Attribute change time. */
+ file->ctime = isodate17(data);
+ }
+ } else {
+ /* Use 7-byte time format. */
+ if ((flag & 1) && data_length >= 7) {
+ /* Create time. */
+ file->birthtime_is_set = 1;
+ file->birthtime = isodate7(data);
+ data += 7;
+ data_length -= 7;
+ }
+ if ((flag & 2) && data_length >= 7) {
+ /* Modify time. */
+ file->mtime = isodate7(data);
+ data += 7;
+ data_length -= 7;
+ }
+ if ((flag & 4) && data_length >= 7) {
+ /* Access time. */
+ file->atime = isodate7(data);
+ data += 7;
+ data_length -= 7;
+ }
+ if ((flag & 8) && data_length >= 7) {
+ /* Attribute change time. */
+ file->ctime = isodate7(data);
+ }
+ }
+}
+
+static void
+parse_rockridge_SL1(struct file_info *file, const unsigned char *data,
+ int data_length)
+{
+ const char *separator = "";
+
+ if (!file->symlink_continues || file->symlink.length < 1)
+ archive_string_empty(&file->symlink);
+ else if (!file->symlink_continues &&
+ file->symlink.s[file->symlink.length - 1] != '/')
+ separator = "/";
+ file->symlink_continues = 0;
+
+ /*
+ * Defined flag values:
+ * 0: This is the last SL record for this symbolic link
+ * 1: this symbolic link field continues in next SL entry
+ * All other values are reserved.
+ */
+ if (data_length < 1)
+ return;
+ switch(*data) {
+ case 0:
+ break;
+ case 1:
+ file->symlink_continues = 1;
+ break;
+ default:
+ return;
+ }
+ ++data; /* Skip flag byte. */
+ --data_length;
+
+ /*
+ * SL extension body stores "components".
+ * Basically, this is a complicated way of storing
+ * a POSIX path. It also interferes with using
+ * symlinks for storing non-path data. <sigh>
+ *
+ * Each component is 2 bytes (flag and length)
+ * possibly followed by name data.
+ */
+ while (data_length >= 2) {
+ unsigned char flag = *data++;
+ unsigned char nlen = *data++;
+ data_length -= 2;
+
+ archive_strcat(&file->symlink, separator);
+ separator = "/";
+
+ switch(flag) {
+ case 0: /* Usual case, this is text. */
+ if (data_length < nlen)
+ return;
+ archive_strncat(&file->symlink,
+ (const char *)data, nlen);
+ break;
+ case 0x01: /* Text continues in next component. */
+ if (data_length < nlen)
+ return;
+ archive_strncat(&file->symlink,
+ (const char *)data, nlen);
+ separator = "";
+ break;
+ case 0x02: /* Current dir. */
+ archive_strcat(&file->symlink, ".");
+ break;
+ case 0x04: /* Parent dir. */
+ archive_strcat(&file->symlink, "..");
+ break;
+ case 0x08: /* Root of filesystem. */
+ archive_strcat(&file->symlink, "/");
+ separator = "";
+ break;
+ case 0x10: /* Undefined (historically "volume root" */
+ archive_string_empty(&file->symlink);
+ archive_strcat(&file->symlink, "ROOT");
+ break;
+ case 0x20: /* Undefined (historically "hostname") */
+ archive_strcat(&file->symlink, "hostname");
+ break;
+ default:
+ /* TODO: issue a warning ? */
+ return;
+ }
+ data += nlen;
+ data_length -= nlen;
+ }
+}
+
+static void
+parse_rockridge_ZF1(struct file_info *file, const unsigned char *data,
+ int data_length)
+{
+
+ if (data[0] == 0x70 && data[1] == 0x7a && data_length == 12) {
+ /* paged zlib */
+ file->pz = 1;
+ file->pz_log2_bs = data[3];
+ file->pz_uncompressed_size = archive_le32dec(&data[4]);
+ }
+}
+
+static void
+register_file(struct iso9660 *iso9660, struct file_info *file)
+{
+
+ file->use_next = iso9660->use_files;
+ iso9660->use_files = file;
+}
+
+static void
+release_files(struct iso9660 *iso9660)
+{
+ struct content *con, *connext;
+ struct file_info *file;
+
+ file = iso9660->use_files;
+ while (file != NULL) {
+ struct file_info *next = file->use_next;
+
+ archive_string_free(&file->name);
archive_string_free(&file->symlink);
- free(file);
- if (parent != NULL) {
- parent->refcount--;
- release_file(iso9660, parent);
+ con = file->contents.first;
+ while (con != NULL) {
+ connext = con->next;
+ free(con);
+ con = connext;
}
+ free(file);
+ file = next;
}
}
@@ -896,102 +2476,242 @@ next_entry_seek(struct archive_read *a, struct iso9660 *iso9660,
struct file_info **pfile)
{
struct file_info *file;
- uint64_t offset;
- *pfile = NULL;
- for (;;) {
- *pfile = file = next_entry(iso9660);
- if (file == NULL)
- return (ARCHIVE_EOF);
+ *pfile = file = next_cache_entry(iso9660);
+ if (file == NULL)
+ return (ARCHIVE_EOF);
- /* CE area precedes actual file data? Ignore it. */
- if (file->ce_offset > file->offset) {
-fprintf(stderr, " *** Discarding CE data.\n");
- file->ce_offset = 0;
- file->ce_size = 0;
- }
+ /* Don't waste time seeking for zero-length bodies. */
+ if (file->size == 0)
+ file->offset = iso9660->current_position;
+
+ /* Seek forward to the start of the entry. */
+ if (iso9660->current_position < file->offset) {
+ int64_t step;
+
+ step = file->offset - iso9660->current_position;
+ step = __archive_read_skip(a, step);
+ if (step < 0)
+ return ((int)step);
+ iso9660->current_position = file->offset;
+ }
+
+ /* We found body of file; handle it now. */
+ return (ARCHIVE_OK);
+}
- /* Don't waste time seeking for zero-length bodies. */
- if (file->size == 0) {
- file->offset = iso9660->current_position;
+static struct file_info *
+next_cache_entry(struct iso9660 *iso9660)
+{
+ struct file_info *file;
+ struct {
+ struct file_info *first;
+ struct file_info **last;
+ } empty_files;
+ int64_t number;
+ int count;
+
+ file = cache_get_entry(iso9660);
+ if (file != NULL) {
+ while (file->parent != NULL && !file->parent->exposed) {
+ /* If file's parent is not exposed, it's moved
+ * to next entry of its parent. */
+ cache_add_to_next_of_parent(iso9660, file);
+ file = cache_get_entry(iso9660);
}
+ return (file);
+ }
- /* If CE exists, find and read it now. */
- if (file->ce_offset > 0)
- offset = file->ce_offset;
- else
- offset = file->offset;
+ file = next_entry(iso9660);
+ if (file == NULL)
+ return (NULL);
- /* Seek forward to the start of the entry. */
- if (iso9660->current_position < offset) {
- off_t step = offset - iso9660->current_position;
- off_t bytes_read;
- bytes_read = (a->decompressor->skip)(a, step);
- if (bytes_read < 0)
- return (bytes_read);
- iso9660->current_position = offset;
+ if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
+ return (file);
+
+ count = 0;
+ number = file->number;
+ iso9660->cache_files.first = NULL;
+ iso9660->cache_files.last = &(iso9660->cache_files.first);
+ empty_files.first = NULL;
+ empty_files.last = &empty_files.first;
+ /* Collect files which has the same file serial number.
+ * Peek pending_files so that file which number is different
+ * is not put bak. */
+ while (iso9660->pending_files.used > 0 &&
+ (iso9660->pending_files.files[0]->number == -1 ||
+ iso9660->pending_files.files[0]->number == number)) {
+ if (file->number == -1) {
+ /* This file has the same offset
+ * but it's wrong offset which empty files
+ * and symlink files have.
+ * NOTE: This wrong offse was recorded by
+ * old mkisofs utility. If ISO images is
+ * created by latest mkisofs, this does not
+ * happen.
+ */
+ file->next = NULL;
+ *empty_files.last = file;
+ empty_files.last = &(file->next);
+ } else {
+ count++;
+ cache_add_entry(iso9660, file);
}
+ file = next_entry(iso9660);
+ }
- /* We found body of file; handle it now. */
- if (offset == file->offset)
- return (ARCHIVE_OK);
+ if (count == 0)
+ return (file);
+ if (file->number == -1) {
+ file->next = NULL;
+ *empty_files.last = file;
+ empty_files.last = &(file->next);
+ } else {
+ count++;
+ cache_add_entry(iso9660, file);
+ }
+
+ if (count > 1) {
+ /* The count is the same as number of hardlink,
+ * so much so that each nlinks of files in cache_file
+ * is overwritten by value of the count.
+ */
+ for (file = iso9660->cache_files.first;
+ file != NULL; file = file->next)
+ file->nlinks = count;
+ }
+ /* If there are empty files, that files are added
+ * to the tail of the cache_files. */
+ if (empty_files.first != NULL) {
+ *iso9660->cache_files.last = empty_files.first;
+ iso9660->cache_files.last = empty_files.last;
+ }
+ return (cache_get_entry(iso9660));
+}
+
+static inline void
+cache_add_entry(struct iso9660 *iso9660, struct file_info *file)
+{
+ file->next = NULL;
+ *iso9660->cache_files.last = file;
+ iso9660->cache_files.last = &(file->next);
+}
+
+static inline void
+cache_add_to_next_of_parent(struct iso9660 *iso9660, struct file_info *file)
+{
+ file->next = file->parent->next;
+ file->parent->next = file;
+ if (iso9660->cache_files.last == &(file->parent->next))
+ iso9660->cache_files.last = &(file->next);
+}
+
+static inline struct file_info *
+cache_get_entry(struct iso9660 *iso9660)
+{
+ struct file_info *file;
+
+ if ((file = iso9660->cache_files.first) != NULL) {
+ iso9660->cache_files.first = file->next;
+ if (iso9660->cache_files.first == NULL)
+ iso9660->cache_files.last = &(iso9660->cache_files.first);
+ }
+ return (file);
+}
+
+static void
+heap_add_entry(struct heap_queue *heap, struct file_info *file, uint64_t key)
+{
+ uint64_t file_key, parent_key;
+ int hole, parent;
+
+ /* Expand our pending files list as necessary. */
+ if (heap->used >= heap->allocated) {
+ struct file_info **new_pending_files;
+ int new_size = heap->allocated * 2;
+
+ if (heap->allocated < 1024)
+ new_size = 1024;
+ /* Overflow might keep us from growing the list. */
+ if (new_size <= heap->allocated)
+ __archive_errx(1, "Out of memory");
+ new_pending_files = (struct file_info **)
+ malloc(new_size * sizeof(new_pending_files[0]));
+ if (new_pending_files == NULL)
+ __archive_errx(1, "Out of memory");
+ memcpy(new_pending_files, heap->files,
+ heap->allocated * sizeof(new_pending_files[0]));
+ if (heap->files != NULL)
+ free(heap->files);
+ heap->files = new_pending_files;
+ heap->allocated = new_size;
+ }
+
+ file_key = file->key = key;
- /* Found CE? Process it and push the file back onto list. */
- if (offset == file->ce_offset) {
- const void *p;
- ssize_t size = file->ce_size;
- ssize_t bytes_read;
- const unsigned char *rr_start;
-
- file->ce_offset = 0;
- file->ce_size = 0;
- bytes_read = (a->decompressor->read_ahead)(a, &p, size);
- if (bytes_read > size)
- bytes_read = size;
- rr_start = (const unsigned char *)p;
- parse_rockridge(iso9660, file, rr_start,
- rr_start + bytes_read);
- (a->decompressor->consume)(a, bytes_read);
- iso9660->current_position += bytes_read;
- add_entry(iso9660, file);
+ /*
+ * Start with hole at end, walk it up tree to find insertion point.
+ */
+ hole = heap->used++;
+ while (hole > 0) {
+ parent = (hole - 1)/2;
+ parent_key = heap->files[parent]->key;
+ if (file_key >= parent_key) {
+ heap->files[hole] = file;
+ return;
}
+ // Move parent into hole <==> move hole up tree.
+ heap->files[hole] = heap->files[parent];
+ hole = parent;
}
+ heap->files[0] = file;
}
static struct file_info *
-next_entry(struct iso9660 *iso9660)
+heap_get_entry(struct heap_queue *heap)
{
- int least_index;
- uint64_t least_end_offset;
- int i;
- struct file_info *r;
+ uint64_t a_key, b_key, c_key;
+ int a, b, c;
+ struct file_info *r, *tmp;
- if (iso9660->pending_files_used < 1)
+ if (heap->used < 1)
return (NULL);
- /* Assume the first file in the list is the earliest on disk. */
- least_index = 0;
- least_end_offset = iso9660->pending_files[0]->offset
- + iso9660->pending_files[0]->size;
-
- /* Now, try to find an earlier one. */
- for (i = 0; i < iso9660->pending_files_used; i++) {
- /* Use the position of the file *end* as our comparison. */
- uint64_t end_offset = iso9660->pending_files[i]->offset
- + iso9660->pending_files[i]->size;
- if (iso9660->pending_files[i]->ce_offset > 0
- && iso9660->pending_files[i]->ce_offset < iso9660->pending_files[i]->offset)
- end_offset = iso9660->pending_files[i]->ce_offset
- + iso9660->pending_files[i]->ce_size;
- if (least_end_offset > end_offset) {
- least_index = i;
- least_end_offset = end_offset;
+ /*
+ * The first file in the list is the earliest; we'll return this.
+ */
+ r = heap->files[0];
+
+ /*
+ * Move the last item in the heap to the root of the tree
+ */
+ heap->files[0] = heap->files[--(heap->used)];
+
+ /*
+ * Rebalance the heap.
+ */
+ a = 0; // Starting element and its heap key
+ a_key = heap->files[a]->key;
+ for (;;) {
+ b = a + a + 1; // First child
+ if (b >= heap->used)
+ return (r);
+ b_key = heap->files[b]->key;
+ c = b + 1; // Use second child if it is smaller.
+ if (c < heap->used) {
+ c_key = heap->files[c]->key;
+ if (c_key < b_key) {
+ b = c;
+ b_key = c_key;
+ }
}
+ if (a_key <= b_key)
+ return (r);
+ tmp = heap->files[a];
+ heap->files[a] = heap->files[b];
+ heap->files[b] = tmp;
+ a = b;
}
- r = iso9660->pending_files[least_index];
- iso9660->pending_files[least_index]
- = iso9660->pending_files[--iso9660->pending_files_used];
- return (r);
}
static unsigned int
@@ -1071,17 +2791,18 @@ time_from_tm(struct tm *t)
static const char *
build_pathname(struct archive_string *as, struct file_info *file)
{
- if (file->parent != NULL && file->parent->name[0] != '\0') {
+ if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
build_pathname(as, file->parent);
archive_strcat(as, "/");
}
- if (file->name[0] == '\0')
+ if (archive_strlen(&file->name) == 0)
archive_strcat(as, ".");
else
- archive_strcat(as, file->name);
+ archive_string_concat(as, &file->name);
return (as->s);
}
+#if DEBUG
static void
dump_isodirrec(FILE *out, const unsigned char *isodirrec)
{
@@ -1106,3 +2827,4 @@ dump_isodirrec(FILE *out, const unsigned char *isodirrec)
fprintf(out, " `%.*s'",
toi(isodirrec + DR_name_len_offset, DR_name_len_size), isodirrec + DR_name_offset);
}
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c b/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
index 33597e0de6b..f83ebe53339 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.9 2008/06/21 19:06:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_mtree.c 201165 2009-12-29 05:52:13Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -148,8 +148,8 @@ archive_read_support_format_mtree(struct archive *_a)
memset(mtree, 0, sizeof(*mtree));
mtree->fd = -1;
- r = __archive_read_register_format(a, mtree,
- mtree_bid, read_header, read_data, skip, cleanup);
+ r = __archive_read_register_format(a, mtree, "mtree",
+ mtree_bid, NULL, read_header, read_data, skip, cleanup);
if (r != ARCHIVE_OK)
free(mtree);
@@ -187,32 +187,17 @@ cleanup(struct archive_read *a)
static int
mtree_bid(struct archive_read *a)
{
- struct mtree *mtree;
- ssize_t bytes_read;
- const void *h;
const char *signature = "#mtree";
const char *p;
- int bid;
-
- mtree = (struct mtree *)(a->format->data);
/* Now let's look at the actual header and see if it matches. */
- bytes_read = (a->decompressor->read_ahead)(a, &h, strlen(signature));
-
- if (bytes_read <= 0)
- return (bytes_read);
-
- p = h;
- bid = 0;
- while (bytes_read > 0 && *signature != '\0') {
- if (*p != *signature)
- return (bid = 0);
- bid += 8;
- p++;
- signature++;
- bytes_read--;
- }
- return (bid);
+ p = __archive_read_ahead(a, strlen(signature), NULL);
+ if (p == NULL)
+ return (-1);
+
+ if (strncmp(p, signature, strlen(signature)) == 0)
+ return (8 * (int)strlen(signature));
+ return (0);
}
/*
@@ -408,21 +393,23 @@ read_mtree(struct archive_read *a, struct mtree *mtree)
struct mtree_entry *last_entry;
int r;
- mtree->archive_format = ARCHIVE_FORMAT_MTREE_V1;
+ mtree->archive_format = ARCHIVE_FORMAT_MTREE;
mtree->archive_format_name = "mtree";
global = NULL;
last_entry = NULL;
- r = ARCHIVE_OK;
for (counter = 1; ; ++counter) {
len = readline(a, mtree, &p, 256);
if (len == 0) {
mtree->this_entry = mtree->entries;
+ free_options(global);
return (ARCHIVE_OK);
}
- if (len < 0)
+ if (len < 0) {
+ free_options(global);
return (len);
+ }
/* Leading whitespace is never significant, ignore it. */
while (*p == ' ' || *p == '\t') {
++p;
@@ -447,13 +434,16 @@ read_mtree(struct archive_read *a, struct mtree *mtree)
} else
break;
- if (r != ARCHIVE_OK)
+ if (r != ARCHIVE_OK) {
+ free_options(global);
return r;
+ }
}
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Can't parse line %ju", counter);
- return ARCHIVE_FATAL;
+ free_options(global);
+ return (ARCHIVE_FATAL);
}
/*
@@ -597,8 +587,7 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
if (archive_entry_filetype(entry) == AE_IFREG ||
archive_entry_filetype(entry) == AE_IFDIR) {
- mtree->fd = open(path,
- O_RDONLY | O_BINARY);
+ mtree->fd = open(path, O_RDONLY | O_BINARY);
if (mtree->fd == -1 &&
(errno != ENOENT ||
archive_strlen(&mtree->contents_name) > 0)) {
@@ -687,6 +676,15 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
archive_entry_set_mtime(entry, st->st_mtime,
st->st_mtim.tv_nsec);
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+ archive_entry_set_mtime(entry, st->st_mtime,
+ st->st_mtime_n);
+#elif HAVE_STRUCT_STAT_ST_UMTIME
+ archive_entry_set_mtime(entry, st->st_mtime,
+ st->st_umtime*1000);
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+ archive_entry_set_mtime(entry, st->st_mtime,
+ st->st_mtime_usec*1000);
#else
archive_entry_set_mtime(entry, st->st_mtime, 0);
#endif
@@ -897,8 +895,17 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
break;
}
if (strcmp(key, "time") == 0) {
+ time_t m;
+ long ns;
+
*parsed_kws |= MTREE_HAS_MTIME;
- archive_entry_set_mtime(entry, mtree_atol10(&val), 0);
+ m = (time_t)mtree_atol10(&val);
+ if (*val == '.') {
+ ++val;
+ ns = (long)mtree_atol10(&val);
+ } else
+ ns = 0;
+ archive_entry_set_mtime(entry, m, ns);
break;
}
if (strcmp(key, "type") == 0) {
@@ -981,8 +988,8 @@ read_data(struct archive_read *a, const void **buff, size_t *size, off_t *offset
if (mtree->buff == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory");
+ return (ARCHIVE_FATAL);
}
- return (ARCHIVE_FATAL);
}
*buff = mtree->buff;
@@ -1029,11 +1036,7 @@ parse_escapes(char *src, struct mtree_entry *mentry)
char *dest = src;
char c;
- /*
- * The current directory is somewhat special, it should be archived
- * only once as it will confuse extraction otherwise.
- */
- if (strcmp(src, ".") == 0)
+ if (mentry != NULL && strcmp(src, ".") == 0)
mentry->full = 1;
while (*src != '\0') {
@@ -1152,7 +1155,7 @@ mtree_atol10(char **p)
digit = **p - '0';
while (digit >= 0 && digit < base) {
if (l > limit || (l == limit && digit > last_digit_limit)) {
- l = UINT64_MAX; /* Truncate on overflow. */
+ l = INT64_MAX; /* Truncate on overflow. */
break;
}
l = (l * base) + digit;
@@ -1193,7 +1196,7 @@ mtree_atol16(char **p)
digit = -1;
while (digit >= 0 && digit < base) {
if (l > limit || (l == limit && digit > last_digit_limit)) {
- l = UINT64_MAX; /* Truncate on overflow. */
+ l = INT64_MAX; /* Truncate on overflow. */
break;
}
l = (l * base) + digit;
@@ -1231,6 +1234,7 @@ readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limi
{
ssize_t bytes_read;
ssize_t total_size = 0;
+ ssize_t find_off = 0;
const void *t;
const char *s;
void *p;
@@ -1239,8 +1243,8 @@ readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limi
/* Accumulate line in a line buffer. */
for (;;) {
/* Read some more. */
- bytes_read = (a->decompressor->read_ahead)(a, &t, 1);
- if (bytes_read == 0)
+ t = __archive_read_ahead(a, 1, &bytes_read);
+ if (t == NULL)
return (0);
if (bytes_read < 0)
return (ARCHIVE_FATAL);
@@ -1263,14 +1267,12 @@ readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limi
return (ARCHIVE_FATAL);
}
memcpy(mtree->line.s + total_size, t, bytes_read);
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
total_size += bytes_read;
/* Null terminate. */
mtree->line.s[total_size] = '\0';
/* If we found an unescaped '\n', clean up and return. */
- if (p == NULL)
- continue;
- for (u = mtree->line.s; *u; ++u) {
+ for (u = mtree->line.s + find_off; *u; ++u) {
if (u[0] == '\n') {
*start = mtree->line.s;
return total_size;
@@ -1291,8 +1293,12 @@ readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limi
memmove(u, u + 1,
total_size - (u - mtree->line.s) + 1);
--total_size;
- continue;
+ ++u;
+ break;
}
+ if (u[1] == '\0')
+ break;
}
+ find_off = u - mtree->line.s;
}
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_raw.c b/archivers/libarchive/files/libarchive/archive_read_support_format_raw.c
new file mode 100644
index 00000000000..7a8481bf221
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_raw.c
@@ -0,0 +1,185 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_raw.c 201107 2009-12-28 03:25:33Z kientzle $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include "archive.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+struct raw_info {
+ int64_t offset; /* Current position in the file. */
+ int end_of_file;
+};
+
+static int archive_read_format_raw_bid(struct archive_read *);
+static int archive_read_format_raw_cleanup(struct archive_read *);
+static int archive_read_format_raw_read_data(struct archive_read *,
+ const void **, size_t *, off_t *);
+static int archive_read_format_raw_read_data_skip(struct archive_read *);
+static int archive_read_format_raw_read_header(struct archive_read *,
+ struct archive_entry *);
+
+int
+archive_read_support_format_raw(struct archive *_a)
+{
+ struct raw_info *info;
+ struct archive_read *a = (struct archive_read *)_a;
+ int r;
+
+ info = (struct raw_info *)calloc(1, sizeof(*info));
+ if (info == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate raw_info data");
+ return (ARCHIVE_FATAL);
+ }
+
+ r = __archive_read_register_format(a,
+ info,
+ "raw",
+ archive_read_format_raw_bid,
+ NULL,
+ archive_read_format_raw_read_header,
+ archive_read_format_raw_read_data,
+ archive_read_format_raw_read_data_skip,
+ archive_read_format_raw_cleanup);
+ if (r != ARCHIVE_OK)
+ free(info);
+ return (r);
+}
+
+/*
+ * Bid 1 if this is a non-empty file. Anyone who can really support
+ * this should outbid us, so it should generally be safe to use "raw"
+ * in conjunction with other formats. But, this could really confuse
+ * folks if there are bid errors or minor file damage, so we don't
+ * include "raw" as part of support_format_all().
+ */
+static int
+archive_read_format_raw_bid(struct archive_read *a)
+{
+
+ if (__archive_read_ahead(a, 1, NULL) == NULL)
+ return (-1);
+ return (1);
+}
+
+/*
+ * Mock up a fake header.
+ */
+static int
+archive_read_format_raw_read_header(struct archive_read *a,
+ struct archive_entry *entry)
+{
+ struct raw_info *info;
+
+ info = (struct raw_info *)(a->format->data);
+ if (info->end_of_file)
+ return (ARCHIVE_EOF);
+
+ a->archive.archive_format = ARCHIVE_FORMAT_RAW;
+ a->archive.archive_format_name = "Raw data";
+ archive_entry_set_pathname(entry, "data");
+ /* XXX should we set mode to mimic a regular file? XXX */
+ /* I'm deliberately leaving most fields unset here. */
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_read_format_raw_read_data(struct archive_read *a,
+ const void **buff, size_t *size, off_t *offset)
+{
+ struct raw_info *info;
+ ssize_t avail;
+
+ info = (struct raw_info *)(a->format->data);
+ if (info->end_of_file)
+ return (ARCHIVE_EOF);
+
+ /* Get whatever bytes are immediately available. */
+ *buff = __archive_read_ahead(a, 1, &avail);
+ if (avail > 0) {
+ /* Consume and return the bytes we just read */
+ __archive_read_consume(a, avail);
+ *size = avail;
+ *offset = info->offset;
+ info->offset += *size;
+ return (ARCHIVE_OK);
+ } else if (0 == avail) {
+ /* Record and return end-of-file. */
+ info->end_of_file = 1;
+ *size = 0;
+ *offset = info->offset;
+ return (ARCHIVE_EOF);
+ } else {
+ /* Record and return an error. */
+ *size = 0;
+ *offset = info->offset;
+ return (avail);
+ }
+}
+
+static int
+archive_read_format_raw_read_data_skip(struct archive_read *a)
+{
+ struct raw_info *info;
+ off_t bytes_skipped;
+ int64_t request = 1024 * 1024 * 1024UL; /* Skip 1 GB at a time. */
+
+ info = (struct raw_info *)(a->format->data);
+ if (info->end_of_file)
+ return (ARCHIVE_EOF);
+ info->end_of_file = 1;
+
+ for (;;) {
+ bytes_skipped = __archive_read_skip_lenient(a, request);
+ if (bytes_skipped < 0)
+ return (ARCHIVE_FATAL);
+ if (bytes_skipped < request)
+ return (ARCHIVE_OK);
+ /* We skipped all the bytes we asked for. There might
+ * be more, so try again. */
+ }
+}
+
+static int
+archive_read_format_raw_cleanup(struct archive_read *a)
+{
+ struct raw_info *info;
+
+ info = (struct raw_info *)(a->format->data);
+ free(info);
+ a->format->data = NULL;
+ return (ARCHIVE_OK);
+}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
index 0c2f0077c1e..dae13dc6e00 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.69 2008/05/27 04:46:12 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_tar.c 201161 2009-12-29 05:44:39Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -159,10 +159,10 @@ struct tar {
wchar_t *pax_entry;
size_t pax_entry_length;
int header_recursion_depth;
- off_t entry_bytes_remaining;
- off_t entry_offset;
- off_t entry_padding;
- off_t realsize;
+ int64_t entry_bytes_remaining;
+ int64_t entry_offset;
+ int64_t entry_padding;
+ int64_t realsize;
struct sparse_block *sparse_list;
struct sparse_block *sparse_last;
int64_t sparse_offset;
@@ -253,8 +253,9 @@ archive_read_support_format_tar(struct archive *_a)
}
memset(tar, 0, sizeof(*tar));
- r = __archive_read_register_format(a, tar,
+ r = __archive_read_register_format(a, tar, "tar",
archive_read_format_tar_bid,
+ NULL,
archive_read_format_tar_read_header,
archive_read_format_tar_read_data,
archive_read_format_tar_skip,
@@ -294,21 +295,15 @@ static int
archive_read_format_tar_bid(struct archive_read *a)
{
int bid;
- ssize_t bytes_read;
const void *h;
const struct archive_entry_header_ustar *header;
bid = 0;
/* Now let's look at the actual header and see if it matches. */
- if (a->decompressor->read_ahead != NULL)
- bytes_read = (a->decompressor->read_ahead)(a, &h, 512);
- else
- bytes_read = 0; /* Empty file. */
- if (bytes_read < 0)
- return (ARCHIVE_FATAL);
- if (bytes_read < 512)
- return (0);
+ h = __archive_read_ahead(a, 512, NULL);
+ if (h == NULL)
+ return (-1);
/* If it's an end-of-archive mark, we can handle it. */
if ((*(const char *)h) == 0
@@ -479,7 +474,7 @@ archive_read_format_tar_read_data(struct archive_read *a,
/* If we're at end of file, return EOF. */
if (tar->sparse_list == NULL || tar->entry_bytes_remaining == 0) {
- if ((a->decompressor->skip)(a, tar->entry_padding) < 0)
+ if (__archive_read_skip(a, tar->entry_padding) < 0)
return (ARCHIVE_FATAL);
tar->entry_padding = 0;
*buff = NULL;
@@ -488,14 +483,14 @@ archive_read_format_tar_read_data(struct archive_read *a,
return (ARCHIVE_EOF);
}
- bytes_read = (a->decompressor->read_ahead)(a, buff, 1);
- if (bytes_read == 0) {
+ *buff = __archive_read_ahead(a, 1, &bytes_read);
+ if (bytes_read < 0)
+ return (ARCHIVE_FATAL);
+ if (*buff == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Truncated tar archive");
return (ARCHIVE_FATAL);
}
- if (bytes_read < 0)
- return (ARCHIVE_FATAL);
if (bytes_read > tar->entry_bytes_remaining)
bytes_read = tar->entry_bytes_remaining;
/* Don't read more than is available in the
@@ -507,14 +502,14 @@ archive_read_format_tar_read_data(struct archive_read *a,
tar->sparse_list->remaining -= bytes_read;
tar->sparse_list->offset += bytes_read;
tar->entry_bytes_remaining -= bytes_read;
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
return (ARCHIVE_OK);
}
static int
archive_read_format_tar_skip(struct archive_read *a)
{
- off_t bytes_skipped;
+ int64_t bytes_skipped;
struct tar* tar;
tar = (struct tar *)(a->format->data);
@@ -524,8 +519,8 @@ archive_read_format_tar_skip(struct archive_read *a)
* length requested or fail, so we can rely upon the entire entry
* plus padding being skipped.
*/
- bytes_skipped = (a->decompressor->skip)(a, tar->entry_bytes_remaining +
- tar->entry_padding);
+ bytes_skipped = __archive_read_skip(a,
+ tar->entry_bytes_remaining + tar->entry_padding);
if (bytes_skipped < 0)
return (ARCHIVE_FATAL);
@@ -552,31 +547,35 @@ tar_read_header(struct archive_read *a, struct tar *tar,
const struct archive_entry_header_ustar *header;
/* Read 512-byte header record */
- bytes = (a->decompressor->read_ahead)(a, &h, 512);
+ h = __archive_read_ahead(a, 512, &bytes);
if (bytes < 0)
return (bytes);
- if (bytes == 0) {
- /*
- * An archive that just ends without a proper
- * end-of-archive marker. Yes, there are tar programs
- * that do this; hold our nose and accept it.
- */
- return (ARCHIVE_EOF);
- }
- if (bytes < 512) {
+ if (bytes < 512) { /* Short read or EOF. */
+ /* Try requesting just one byte and see what happens. */
+ (void)__archive_read_ahead(a, 1, &bytes);
+ if (bytes == 0) {
+ /*
+ * The archive ends at a 512-byte boundary but
+ * without a proper end-of-archive marker.
+ * Yes, there are tar writers that do this;
+ * hold our nose and accept it.
+ */
+ return (ARCHIVE_EOF);
+ }
+ /* Archive ends with a partial block; this is bad. */
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated tar archive");
return (ARCHIVE_FATAL);
}
- (a->decompressor->consume)(a, 512);
+ __archive_read_consume(a, 512);
/* Check for end-of-archive mark. */
if (((*(const char *)h)==0) && archive_block_is_null((const unsigned char *)h)) {
/* Try to consume a second all-null record, as well. */
- bytes = (a->decompressor->read_ahead)(a, &h, 512);
- if (bytes > 0)
- (a->decompressor->consume)(a, bytes);
+ h = __archive_read_ahead(a, 512, NULL);
+ if (h != NULL)
+ __archive_read_consume(a, 512);
archive_set_error(&a->archive, 0, NULL);
if (a->archive.archive_format_name == NULL) {
a->archive.archive_format = ARCHIVE_FORMAT_TAR;
@@ -733,6 +732,7 @@ header_Solaris_ACL(struct archive_read *a, struct tar *tar,
const struct archive_entry_header_ustar *header;
size_t size;
int err;
+ int64_t type;
char *acl, *p;
wchar_t *wp;
@@ -745,24 +745,57 @@ header_Solaris_ACL(struct archive_read *a, struct tar *tar,
err = read_body_to_string(a, tar, &(tar->acl_text), h);
if (err != ARCHIVE_OK)
return (err);
+ /* Recursively read next header */
err = tar_read_header(a, tar, entry);
if ((err != ARCHIVE_OK) && (err != ARCHIVE_WARN))
return (err);
- /* Skip leading octal number. */
- /* XXX TODO: Parse the octal number and sanity-check it. */
+ /* TODO: Examine the first characters to see if this
+ * is an AIX ACL descriptor. We'll likely never support
+ * them, but it would be polite to recognize and warn when
+ * we do see them. */
+
+ /* Leading octal number indicates ACL type and number of entries. */
p = acl = tar->acl_text.s;
- while (*p != '\0' && p < acl + size)
+ type = 0;
+ while (*p != '\0' && p < acl + size) {
+ if (*p < '0' || *p > '7') {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Malformed Solaris ACL attribute (invalid digit)");
+ return(ARCHIVE_WARN);
+ }
+ type <<= 3;
+ type += *p - '0';
+ if (type > 077777777) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Malformed Solaris ACL attribute (count too large)");
+ return (ARCHIVE_WARN);
+ }
p++;
+ }
+ switch ((int)type & ~0777777) {
+ case 01000000:
+ /* POSIX.1e ACL */
+ break;
+ case 03000000:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Solaris NFSv4 ACLs not supported");
+ return (ARCHIVE_WARN);
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Malformed Solaris ACL attribute (unsupported type %o)",
+ (int)type);
+ return (ARCHIVE_WARN);
+ }
p++;
if (p >= acl + size) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Malformed Solaris ACL attribute");
+ "Malformed Solaris ACL attribute (body overflow)");
return(ARCHIVE_WARN);
}
- /* Skip leading octal number. */
+ /* ACL text is null-terminated; find the end. */
size -= (p - acl);
acl = p;
@@ -772,6 +805,9 @@ header_Solaris_ACL(struct archive_read *a, struct tar *tar,
wp = utf8_decode(tar, acl, p - acl);
err = __archive_entry_acl_parse_w(entry, wp,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ if (err != ARCHIVE_OK)
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Malformed Solaris ACL attribute (unparsable)");
return (err);
}
@@ -837,10 +873,8 @@ read_body_to_string(struct archive_read *a, struct tar *tar,
struct archive_string *as, const void *h)
{
off_t size, padded_size;
- ssize_t bytes_read, bytes_to_copy;
const struct archive_entry_header_ustar *header;
const void *src;
- char *dest;
(void)tar; /* UNUSED */
header = (const struct archive_entry_header_ustar *)h;
@@ -858,27 +892,14 @@ read_body_to_string(struct archive_read *a, struct tar *tar,
return (ARCHIVE_FATAL);
}
- /* Read the body into the string. */
+ /* Read the body into the string. */
padded_size = (size + 511) & ~ 511;
- dest = as->s;
- while (padded_size > 0) {
- bytes_read = (a->decompressor->read_ahead)(a, &src, padded_size);
- if (bytes_read == 0)
- return (ARCHIVE_EOF);
- if (bytes_read < 0)
- return (ARCHIVE_FATAL);
- if (bytes_read > padded_size)
- bytes_read = padded_size;
- (a->decompressor->consume)(a, bytes_read);
- bytes_to_copy = bytes_read;
- if ((off_t)bytes_to_copy > size)
- bytes_to_copy = (ssize_t)size;
- memcpy(dest, src, bytes_to_copy);
- dest += bytes_to_copy;
- size -= bytes_to_copy;
- padded_size -= bytes_read;
- }
- *dest = '\0';
+ src = __archive_read_ahead(a, padded_size, NULL);
+ if (src == NULL)
+ return (ARCHIVE_FATAL);
+ memcpy(as->s, src, size);
+ __archive_read_consume(a, padded_size);
+ as->s[size] = '\0';
return (ARCHIVE_OK);
}
@@ -1175,7 +1196,7 @@ pax_header(struct archive_read *a, struct tar *tar,
struct archive_entry *entry, char *attr)
{
size_t attr_length, l, line_length;
- char *line, *p;
+ char *p;
char *key, *value;
int err, err2;
@@ -1191,7 +1212,7 @@ pax_header(struct archive_read *a, struct tar *tar,
/* Parse decimal length field at start of line. */
line_length = 0;
l = attr_length;
- line = p = attr; /* Record start of line. */
+ p = attr; /* Record start of line. */
while (l>0) {
if (*p == ' ') {
p++;
@@ -1451,6 +1472,10 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
if (strcmp(key, "LIBARCHIVE.xxxxxxx")==0)
archive_entry_set_xxxxxx(entry, value);
*/
+ if (strcmp(key, "LIBARCHIVE.creationtime")==0) {
+ pax_time(value, &s, &n);
+ archive_entry_set_birthtime(entry, s, n);
+ }
if (strncmp(key, "LIBARCHIVE.xattr.", 17)==0)
pax_attribute_xattr(entry, key, value);
break;
@@ -1605,7 +1630,7 @@ pax_time(const char *p, int64_t *ps, long *pn)
digit = *p - '0';
if (s > limit ||
(s == limit && digit > last_digit_limit)) {
- s = UINT64_MAX;
+ s = INT64_MAX;
break;
}
s = (s * 10) + digit;
@@ -1762,7 +1787,7 @@ gnu_sparse_old_read(struct archive_read *a, struct tar *tar,
return (ARCHIVE_OK);
do {
- bytes_read = (a->decompressor->read_ahead)(a, &data, 512);
+ data = __archive_read_ahead(a, 512, &bytes_read);
if (bytes_read < 0)
return (ARCHIVE_FATAL);
if (bytes_read < 512) {
@@ -1771,7 +1796,7 @@ gnu_sparse_old_read(struct archive_read *a, struct tar *tar,
"detected while reading sparse file data");
return (ARCHIVE_FATAL);
}
- (a->decompressor->consume)(a, 512);
+ __archive_read_consume(a, 512);
ext = (const struct extended *)data;
gnu_sparse_old_parse(tar, ext->sparse, 21);
} while (ext->isextended[0] != 0);
@@ -1904,7 +1929,7 @@ gnu_sparse_10_atol(struct archive_read *a, struct tar *tar,
return (ARCHIVE_WARN);
digit = *p - '0';
if (l > limit || (l == limit && digit > last_digit_limit))
- l = UINT64_MAX; /* Truncate on overflow. */
+ l = INT64_MAX; /* Truncate on overflow. */
else
l = (l * base) + digit;
p++;
@@ -1949,7 +1974,7 @@ gnu_sparse_10_read(struct archive_read *a, struct tar *tar)
/* Skip rest of block... */
bytes_read = tar->entry_bytes_remaining - remaining;
to_skip = 0x1ff & -bytes_read;
- if (to_skip != (a->decompressor->skip)(a, to_skip))
+ if (to_skip != __archive_read_skip(a, to_skip))
return (ARCHIVE_FATAL);
return (bytes_read + to_skip);
}
@@ -2010,7 +2035,7 @@ tar_atol8(const char *p, unsigned char_cnt)
digit = *p - '0';
while (digit >= 0 && digit < base && char_cnt-- > 0) {
if (l>limit || (l == limit && digit > last_digit_limit)) {
- l = UINT64_MAX; /* Truncate on overflow. */
+ l = INT64_MAX; /* Truncate on overflow. */
break;
}
l = (l * base) + digit;
@@ -2046,7 +2071,7 @@ tar_atol10(const char *p, unsigned char_cnt)
digit = *p - '0';
while (digit >= 0 && digit < base && char_cnt-- > 0) {
if (l > limit || (l == limit && digit > last_digit_limit)) {
- l = UINT64_MAX; /* Truncate on overflow. */
+ l = INT64_MAX; /* Truncate on overflow. */
break;
}
l = (l * base) + digit;
@@ -2104,7 +2129,7 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
const char *s;
void *p;
- bytes_read = (a->decompressor->read_ahead)(a, &t, 1);
+ t = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
s = t; /* Start of line? */
@@ -2118,7 +2143,7 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
"Line too long");
return (ARCHIVE_FATAL);
}
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
*start = s;
return (bytes_read);
}
@@ -2136,7 +2161,7 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
return (ARCHIVE_FATAL);
}
memcpy(tar->line.s + total_size, t, bytes_read);
- (a->decompressor->consume)(a, bytes_read);
+ __archive_read_consume(a, bytes_read);
total_size += bytes_read;
/* If we found '\n', clean up and return. */
if (p != NULL) {
@@ -2144,7 +2169,7 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
return (total_size);
}
/* Read some more. */
- bytes_read = (a->decompressor->read_ahead)(a, &t, 1);
+ t = __archive_read_ahead(a, 1, &bytes_read);
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
s = t; /* Start of line? */
@@ -2161,11 +2186,10 @@ utf8_decode(struct tar *tar, const char *src, size_t length)
{
wchar_t *dest;
ssize_t n;
- int err;
/* Ensure pax_entry buffer is big enough. */
if (tar->pax_entry_length <= length) {
- wchar_t *old_entry = tar->pax_entry;
+ wchar_t *old_entry;
if (tar->pax_entry_length <= 0)
tar->pax_entry_length = 1024;
@@ -2183,7 +2207,6 @@ utf8_decode(struct tar *tar, const char *src, size_t length)
}
dest = tar->pax_entry;
- err = 0;
while (length > 0) {
n = UTF8_mbrtowc(dest, src, length);
if (n < 0)
@@ -2194,7 +2217,7 @@ utf8_decode(struct tar *tar, const char *src, size_t length)
src += n;
length -= n;
}
- *dest++ = L'\0';
+ *dest = L'\0';
return (tar->pax_entry);
}
@@ -2295,7 +2318,7 @@ base64_decode(const char *s, size_t len, size_t *out_len)
/* If the decode table is not yet initialized, prepare it. */
if (decode_table[digits[1]] != 1) {
- size_t i;
+ unsigned i;
memset(decode_table, 0xff, sizeof(decode_table));
for (i = 0; i < sizeof(digits); i++)
decode_table[digits[i]] = i;
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_xar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_xar.c
new file mode 100644
index 00000000000..b914975423d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_xar.c
@@ -0,0 +1,3150 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "archive_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_LIBXML_XMLREADER_H
+#include <libxml/xmlreader.h>
+#elif HAVE_BSDXML_H
+#include <bsdxml.h>
+#elif HAVE_EXPAT_H
+#include <expat.h>
+#endif
+#ifdef HAVE_BZLIB_H
+#include <bzlib.h>
+#endif
+#if HAVE_LZMA_H
+#include <lzma.h>
+#elif HAVE_LZMADEC_H
+#include <lzmadec.h>
+#endif
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#include "archive.h"
+#include "archive_endian.h"
+#include "archive_entry.h"
+#include "archive_hash.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+#if (!defined(HAVE_LIBXML_XMLREADER_H) && \
+ !defined(HAVE_BSDXML_H) && !defined(HAVE_EXPAT_H)) ||\
+ !defined(HAVE_ZLIB_H) || \
+ !defined(ARCHIVE_HAS_MD5) || !defined(ARCHIVE_HAS_SHA1)
+/*
+ * xar needs several external libraries.
+ * o libxml2 or expat --- XML parser
+ * o openssl or MD5/SHA1 hash function
+ * o zlib
+ * o bzlib2 (option)
+ * o liblzma (option)
+ */
+int
+archive_read_support_format_xar(struct archive *_a)
+{
+ struct archive_read *a = (struct archive_read *)_a;
+
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Xar not supported on this platform");
+ return (ARCHIVE_WARN);
+}
+
+#else /* Support xar format */
+
+//#define DEBUG 1
+//#define DEBUG_PRINT_TOC 1
+#if DEBUG_PRINT_TOC
+#define PRINT_TOC(d, outbytes) do { \
+ unsigned char *x = (unsigned char *)(uintptr_t)d; \
+ unsigned char c = x[outbytes-1]; \
+ x[outbytes - 1] = 0; \
+ fprintf(stderr, "%s", x); \
+ fprintf(stderr, "%c", c); \
+ x[outbytes - 1] = c; \
+} while (0)
+#else
+#define PRINT_TOC(d, outbytes)
+#endif
+
+#define HEADER_MAGIC 0x78617221
+#define HEADER_SIZE 28
+#define HEADER_VERSION 1
+#define CKSUM_NONE 0
+#define CKSUM_SHA1 1
+#define CKSUM_MD5 2
+
+#define MD5_SIZE 16
+#define SHA1_SIZE 20
+#define MAX_SUM_SIZE 20
+
+enum enctype {
+ NONE,
+ GZIP,
+ BZIP2,
+ LZMA,
+ XZ,
+};
+
+struct chksumval {
+ int alg;
+ size_t len;
+ unsigned char val[MAX_SUM_SIZE];
+};
+
+struct chksumwork {
+ int alg;
+#ifdef ARCHIVE_HAS_MD5
+ archive_md5_ctx md5ctx;
+#endif
+#ifdef ARCHIVE_HAS_SHA1
+ archive_sha1_ctx sha1ctx;
+#endif
+};
+
+struct xattr {
+ struct xattr *next;
+ struct archive_string name;
+ uint64_t id;
+ uint64_t length;
+ uint64_t offset;
+ uint64_t size;
+ enum enctype encoding;
+ struct chksumval a_sum;
+ struct chksumval e_sum;
+ struct archive_string fstype;
+};
+
+struct xar_file {
+ struct xar_file *next;
+ struct xar_file *hdnext;
+ struct xar_file *parent;
+ int subdirs;
+
+ unsigned int has;
+#define HAS_DATA 0x00001
+#define HAS_PATHNAME 0x00002
+#define HAS_SYMLINK 0x00004
+#define HAS_TIME 0x00008
+#define HAS_UID 0x00010
+#define HAS_GID 0x00020
+#define HAS_MODE 0x00040
+#define HAS_TYPE 0x00080
+#define HAS_DEV 0x00100
+#define HAS_DEVMAJOR 0x00200
+#define HAS_DEVMINOR 0x00400
+#define HAS_INO 0x00800
+#define HAS_FFLAGS 0x01000
+#define HAS_XATTR 0x02000
+#define HAS_ACL 0x04000
+
+ uint64_t id;
+ uint64_t length;
+ uint64_t offset;
+ uint64_t size;
+ enum enctype encoding;
+ struct chksumval a_sum;
+ struct chksumval e_sum;
+ struct archive_string pathname;
+ struct archive_string symlink;
+ time_t ctime;
+ time_t mtime;
+ time_t atime;
+ struct archive_string uname;
+ uid_t uid;
+ struct archive_string gname;
+ gid_t gid;
+ mode_t mode;
+ dev_t dev;
+ dev_t devmajor;
+ dev_t devminor;
+ int64_t ino64;
+ struct archive_string fflags_text;
+ unsigned int link;
+ unsigned int nlink;
+ struct archive_string hardlink;
+ struct xattr *xattr_list;
+};
+
+struct hdlink {
+ struct hdlink *next;
+
+ unsigned int id;
+ int cnt;
+ struct xar_file *files;
+};
+
+struct heap_queue {
+ struct xar_file **files;
+ int allocated;
+ int used;
+};
+
+enum xmlstatus {
+ INIT,
+ XAR,
+ TOC,
+ TOC_CREATION_TIME,
+ TOC_CHECKSUM,
+ TOC_CHECKSUM_OFFSET,
+ TOC_CHECKSUM_SIZE,
+ TOC_FILE,
+ FILE_DATA,
+ FILE_DATA_LENGTH,
+ FILE_DATA_OFFSET,
+ FILE_DATA_SIZE,
+ FILE_DATA_ENCODING,
+ FILE_DATA_A_CHECKSUM,
+ FILE_DATA_E_CHECKSUM,
+ FILE_DATA_CONTENT,
+ FILE_EA,
+ FILE_EA_LENGTH,
+ FILE_EA_OFFSET,
+ FILE_EA_SIZE,
+ FILE_EA_ENCODING,
+ FILE_EA_A_CHECKSUM,
+ FILE_EA_E_CHECKSUM,
+ FILE_EA_NAME,
+ FILE_EA_FSTYPE,
+ FILE_CTIME,
+ FILE_MTIME,
+ FILE_ATIME,
+ FILE_GROUP,
+ FILE_GID,
+ FILE_USER,
+ FILE_UID,
+ FILE_MODE,
+ FILE_DEVICE,
+ FILE_DEVICE_MAJOR,
+ FILE_DEVICE_MINOR,
+ FILE_DEVICENO,
+ FILE_INODE,
+ FILE_LINK,
+ FILE_TYPE,
+ FILE_NAME,
+ FILE_ACL,
+ FILE_ACL_DEFAULT,
+ FILE_ACL_ACCESS,
+ FILE_ACL_APPLEEXTENDED,
+ /* BSD file flags. */
+ FILE_FLAGS,
+ FILE_FLAGS_USER_NODUMP,
+ FILE_FLAGS_USER_IMMUTABLE,
+ FILE_FLAGS_USER_APPEND,
+ FILE_FLAGS_USER_OPAQUE,
+ FILE_FLAGS_USER_NOUNLINK,
+ FILE_FLAGS_SYS_ARCHIVED,
+ FILE_FLAGS_SYS_IMMUTABLE,
+ FILE_FLAGS_SYS_APPEND,
+ FILE_FLAGS_SYS_NOUNLINK,
+ FILE_FLAGS_SYS_SNAPSHOT,
+ /* Linux file flags. */
+ FILE_EXT2,
+ FILE_EXT2_SecureDeletion,
+ FILE_EXT2_Undelete,
+ FILE_EXT2_Compress,
+ FILE_EXT2_Synchronous,
+ FILE_EXT2_Immutable,
+ FILE_EXT2_AppendOnly,
+ FILE_EXT2_NoDump,
+ FILE_EXT2_NoAtime,
+ FILE_EXT2_CompDirty,
+ FILE_EXT2_CompBlock,
+ FILE_EXT2_NoCompBlock,
+ FILE_EXT2_CompError,
+ FILE_EXT2_BTree,
+ FILE_EXT2_HashIndexed,
+ FILE_EXT2_iMagic,
+ FILE_EXT2_Journaled,
+ FILE_EXT2_NoTail,
+ FILE_EXT2_DirSync,
+ FILE_EXT2_TopDir,
+ FILE_EXT2_Reserved,
+ UNKNOWN,
+};
+
+struct unknown_tag {
+ struct unknown_tag *next;
+ struct archive_string name;
+};
+
+struct xar {
+ uint64_t offset; /* Current position in the file. */
+ int64_t total;
+ uint64_t h_base;
+ int end_of_file;
+ unsigned char buff[1024*32];
+
+ enum xmlstatus xmlsts;
+ enum xmlstatus xmlsts_unknown;
+ struct unknown_tag *unknowntags;
+ int base64text;
+
+ /*
+ * TOC
+ */
+ uint64_t toc_remaining;
+ uint64_t toc_total;
+ uint64_t toc_chksum_offset;
+ uint64_t toc_chksum_size;
+
+ /*
+ * For Decoding data.
+ */
+ enum enctype rd_encoding;
+ z_stream stream;
+ int stream_valid;
+#ifdef HAVE_BZLIB_H
+ bz_stream bzstream;
+ int bzstream_valid;
+#endif
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+ lzma_stream lzstream;
+ int lzstream_valid;
+#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+ lzmadec_stream lzstream;
+ int lzstream_valid;
+#endif
+ /*
+ * For Checksum data.
+ */
+ struct chksumwork a_sumwrk;
+ struct chksumwork e_sumwrk;
+
+ struct xar_file *file; /* current reading file. */
+ struct xattr *xattr; /* current reading extended attribute. */
+ struct heap_queue file_queue;
+ struct xar_file *hdlink_orgs;
+ struct hdlink *hdlink_list;
+
+ int entry_init;
+ uint64_t entry_total;
+ uint64_t entry_remaining;
+ uint64_t entry_size;
+ enum enctype entry_encoding;
+ struct chksumval entry_a_sum;
+ struct chksumval entry_e_sum;
+};
+
+struct xmlattr {
+ struct xmlattr *next;
+ char *name;
+ char *value;
+};
+
+struct xmlattr_list {
+ struct xmlattr *first;
+ struct xmlattr **last;
+};
+
+static int xar_bid(struct archive_read *);
+static int xar_read_header(struct archive_read *,
+ struct archive_entry *);
+static int xar_read_data(struct archive_read *,
+ const void **, size_t *, off_t *);
+static int xar_read_data_skip(struct archive_read *);
+static int xar_cleanup(struct archive_read *);
+static int move_reading_point(struct archive_read *, uint64_t);
+static int rd_contents_init(struct archive_read *,
+ enum enctype, int, int);
+static int rd_contents(struct archive_read *, const void **,
+ size_t *, size_t *, uint64_t);
+static uint64_t atol10(const char *, size_t);
+static int64_t atol8(const char *, size_t);
+static size_t atohex(unsigned char *, size_t, const char *, size_t);
+static time_t parse_time(const char *p, size_t n);
+static void heap_add_entry(struct heap_queue *, struct xar_file *);
+static struct xar_file *heap_get_entry(struct heap_queue *);
+static void add_link(struct xar *, struct xar_file *);
+static void checksum_init(struct archive_read *, int, int);
+static void checksum_update(struct archive_read *, const void *,
+ size_t, const void *, size_t);
+static int checksum_final(struct archive_read *, const void *,
+ size_t, const void *, size_t);
+static int decompression_init(struct archive_read *, enum enctype);
+static int decompress(struct archive_read *, const void **,
+ size_t *, const void *, size_t *);
+static int decompression_cleanup(struct archive_read *);
+static void xmlattr_cleanup(struct xmlattr_list *);
+static void file_new(struct xar *, struct xmlattr_list *);
+static void file_free(struct xar_file *);
+static void xattr_new(struct xar *, struct xmlattr_list *);
+static void xattr_free(struct xattr *);
+static int getencoding(struct xmlattr_list *);
+static int getsumalgorithm(struct xmlattr_list *);
+static void unknowntag_start(struct xar *, const char *);
+static void unknowntag_end(struct xar *, const char *);
+static void xml_start(void *, const char *, struct xmlattr_list *);
+static void xml_end(void *, const char *);
+static void xml_data(void *, const char *, int);
+static int xml_parse_file_flags(struct xar *, const char *);
+static int xml_parse_file_ext2(struct xar *, const char *);
+#if defined(HAVE_LIBXML_XMLREADER_H)
+static int xml2_xmlattr_setup(struct xmlattr_list *, xmlTextReaderPtr);
+static int xml2_read_cb(void *, char *, int);
+static int xml2_close_cb(void *);
+static void xml2_error_hdr(void *, const char *, xmlParserSeverities,
+ xmlTextReaderLocatorPtr);
+static int xml2_read_toc(struct archive_read *);
+#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
+static void expat_xmlattr_setup(struct xmlattr_list *, const XML_Char **);
+static void expat_start_cb(void *, const XML_Char *, const XML_Char **);
+static void expat_end_cb(void *, const XML_Char *);
+static void expat_data_cb(void *, const XML_Char *, int);
+static int expat_read_toc(struct archive_read *);
+#endif
+
+int
+archive_read_support_format_xar(struct archive *_a)
+{
+ struct xar *xar;
+ struct archive_read *a = (struct archive_read *)_a;
+ int r;
+
+ xar = (struct xar *)calloc(1, sizeof(*xar));
+ if (xar == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate xar data");
+ return (ARCHIVE_FATAL);
+ }
+
+ r = __archive_read_register_format(a,
+ xar,
+ "xar",
+ xar_bid,
+ NULL,
+ xar_read_header,
+ xar_read_data,
+ xar_read_data_skip,
+ xar_cleanup);
+ if (r != ARCHIVE_OK)
+ free(xar);
+ return (r);
+}
+
+static int
+xar_bid(struct archive_read *a)
+{
+ const unsigned char *b;
+ int bid;
+
+ b = __archive_read_ahead(a, HEADER_SIZE, NULL);
+ if (b == NULL)
+ return (-1);
+
+ bid = 0;
+ /*
+ * Verify magic code
+ */
+ if (archive_be32dec(b) != HEADER_MAGIC)
+ return (0);
+ bid += 32;
+ /*
+ * Verify header size
+ */
+ if (archive_be16dec(b+4) != HEADER_SIZE)
+ return (0);
+ bid += 16;
+ /*
+ * Verify header version
+ */
+ if (archive_be16dec(b+6) != HEADER_VERSION)
+ return (0);
+ bid += 16;
+ /*
+ * Verify type of checksum
+ */
+ switch (archive_be32dec(b+24)) {
+ case CKSUM_NONE:
+ case CKSUM_SHA1:
+ case CKSUM_MD5:
+ bid += 32;
+ break;
+ default:
+ return (0);
+ }
+
+ return (bid);
+}
+
+static int
+read_toc(struct archive_read *a)
+{
+ struct xar *xar;
+ struct xar_file *file;
+ const unsigned char *b;
+ uint64_t toc_compressed_size;
+ uint64_t toc_uncompressed_size;
+ uint32_t toc_chksum_alg;
+ ssize_t bytes;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+
+ /*
+ * Read xar header.
+ */
+ b = __archive_read_ahead(a, HEADER_SIZE, &bytes);
+ if (bytes < 0)
+ return ((int)bytes);
+ if (bytes < HEADER_SIZE) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated archive header");
+ return (ARCHIVE_FATAL);
+ }
+
+ if (archive_be32dec(b) != HEADER_MAGIC) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Invalid header magic");
+ return (ARCHIVE_FATAL);
+ }
+ if (archive_be16dec(b+6) != HEADER_VERSION) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Unsupported header version(%d)",
+ archive_be16dec(b+6));
+ return (ARCHIVE_FATAL);
+ }
+ toc_compressed_size = archive_be64dec(b+8);
+ xar->toc_remaining = toc_compressed_size;
+ toc_uncompressed_size = archive_be64dec(b+16);
+ toc_chksum_alg = archive_be32dec(b+24);
+ __archive_read_consume(a, HEADER_SIZE);
+ xar->offset += HEADER_SIZE;
+ xar->toc_total = 0;
+
+ /*
+ * Read TOC(Table of Contents).
+ */
+ /* Initialize reading contents. */
+ r = move_reading_point(a, HEADER_SIZE);
+ if (r != ARCHIVE_OK)
+ return (r);
+ r = rd_contents_init(a, GZIP, toc_chksum_alg, CKSUM_NONE);
+ if (r != ARCHIVE_OK)
+ return (r);
+
+#ifdef HAVE_LIBXML_XMLREADER_H
+ r = xml2_read_toc(a);
+#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
+ r = expat_read_toc(a);
+#endif
+ if (r != ARCHIVE_OK)
+ return (r);
+
+ /* Set 'The HEAP' base. */
+ xar->h_base = xar->offset;
+ if (xar->toc_total != toc_uncompressed_size) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "TOC uncompressed size error");
+ return (ARCHIVE_FATAL);
+ }
+
+ /*
+ * Checksum TOC
+ */
+ if (toc_chksum_alg != CKSUM_NONE) {
+ r = move_reading_point(a, xar->toc_chksum_offset);
+ if (r != ARCHIVE_OK)
+ return (r);
+ b = __archive_read_ahead(a, xar->toc_chksum_size, &bytes);
+ if (bytes < 0)
+ return ((int)bytes);
+ if ((uint64_t)bytes < xar->toc_chksum_size) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated archive file");
+ return (ARCHIVE_FATAL);
+ }
+ r = checksum_final(a, b, xar->toc_chksum_size, NULL, 0);
+ __archive_read_consume(a, xar->toc_chksum_size);
+ xar->offset += xar->toc_chksum_size;
+ if (r != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ }
+
+ /*
+ * Connect hardlinked files.
+ */
+ for (file = xar->hdlink_orgs; file != NULL; file = file->hdnext) {
+ struct hdlink **hdlink;
+
+ for (hdlink = &(xar->hdlink_list); *hdlink != NULL;
+ hdlink = &((*hdlink)->next)) {
+ if ((*hdlink)->id == file->id) {
+ struct hdlink *hltmp;
+ struct xar_file *f2;
+ int nlink = (*hdlink)->cnt + 1;
+
+ file->nlink = nlink;
+ for (f2 = (*hdlink)->files; f2 != NULL;
+ f2 = f2->hdnext) {
+ f2->nlink = nlink;
+ archive_string_copy(
+ &(f2->hardlink), &(file->pathname));
+ }
+ /* Remove resolved files from hdlist_list. */
+ hltmp = *hdlink;
+ *hdlink = hltmp->next;
+ free(hltmp);
+ break;
+ }
+ }
+ }
+ a->archive.archive_format = ARCHIVE_FORMAT_XAR;
+ a->archive.archive_format_name = "xar";
+
+ return (ARCHIVE_OK);
+}
+
+static int
+xar_read_header(struct archive_read *a, struct archive_entry *entry)
+{
+ struct xar *xar;
+ struct xar_file *file;
+ struct xattr *xattr;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+
+ if (xar->offset == 0) {
+ /* Read TOC. */
+ r = read_toc(a);
+ if (r != ARCHIVE_OK)
+ return (r);
+ }
+
+ for (;;) {
+ file = xar->file = heap_get_entry(&(xar->file_queue));
+ if (file == NULL) {
+ xar->end_of_file = 1;
+ return (ARCHIVE_EOF);
+ }
+ if ((file->mode & AE_IFMT) != AE_IFDIR)
+ break;
+ if (file->has != (HAS_PATHNAME | HAS_TYPE))
+ break;
+ /*
+ * If a file type is a directory and it does not have
+ * any metadata, do not export.
+ */
+ file_free(file);
+ }
+ archive_entry_set_atime(entry, file->atime, 0);
+ archive_entry_set_ctime(entry, file->ctime, 0);
+ archive_entry_set_mtime(entry, file->mtime, 0);
+ archive_entry_set_gid(entry, file->gid);
+ if (file->gname.length > 0)
+ archive_entry_update_gname_utf8(entry, file->gname.s);
+ archive_entry_set_uid(entry, file->uid);
+ if (file->uname.length > 0)
+ archive_entry_update_uname_utf8(entry, file->uname.s);
+ archive_entry_set_mode(entry, file->mode);
+ archive_entry_update_pathname_utf8(entry, file->pathname.s);
+ if (file->symlink.length > 0)
+ archive_entry_update_symlink_utf8(entry, file->symlink.s);
+ /* Set proper nlink. */
+ if ((file->mode & AE_IFMT) == AE_IFDIR)
+ archive_entry_set_nlink(entry, file->subdirs + 2);
+ else
+ archive_entry_set_nlink(entry, file->nlink);
+ archive_entry_set_size(entry, file->size);
+ if (archive_strlen(&(file->hardlink)) > 0)
+ archive_entry_update_hardlink_utf8(entry,
+ file->hardlink.s);
+ archive_entry_set_ino64(entry, file->ino64);
+ if (file->has & HAS_DEV)
+ archive_entry_set_dev(entry, file->dev);
+ if (file->has & HAS_DEVMAJOR)
+ archive_entry_set_devmajor(entry, file->devmajor);
+ if (file->has & HAS_DEVMINOR)
+ archive_entry_set_devminor(entry, file->devminor);
+ if (archive_strlen(&(file->fflags_text)) > 0)
+ archive_entry_copy_fflags_text(entry, file->fflags_text.s);
+
+ xar->entry_init = 1;
+ xar->entry_total = 0;
+ xar->entry_remaining = file->length;
+ xar->entry_size = file->size;
+ xar->entry_encoding = file->encoding;
+ xar->entry_a_sum = file->a_sum;
+ xar->entry_e_sum = file->e_sum;
+ /*
+ * Read extended attributes.
+ */
+ r = ARCHIVE_OK;
+ xattr = file->xattr_list;
+ while (xattr != NULL) {
+ const void *d;
+ size_t outbytes, used;
+
+ r = move_reading_point(a, xattr->offset);
+ if (r != ARCHIVE_OK)
+ break;
+ r = rd_contents_init(a, xattr->encoding,
+ xattr->a_sum.alg, xattr->e_sum.alg);
+ if (r != ARCHIVE_OK)
+ break;
+ d = NULL;
+ r = rd_contents(a, &d, &outbytes, &used, xattr->length);
+ if (r != ARCHIVE_OK)
+ break;
+ if (outbytes != xattr->size) {
+ archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
+ "Decompressed size error");
+ r = ARCHIVE_FATAL;
+ break;
+ }
+ r = checksum_final(a,
+ xattr->a_sum.val, xattr->a_sum.len,
+ xattr->e_sum.val, xattr->e_sum.len);
+ if (r != ARCHIVE_OK)
+ break;
+ archive_entry_xattr_add_entry(entry,
+ xattr->name.s, d, outbytes);
+ xattr = xattr->next;
+ }
+ if (r != ARCHIVE_OK) {
+ file_free(file);
+ return (r);
+ }
+
+ if (xar->entry_remaining > 0)
+ /* Move reading point to the beginning of current
+ * file contents. */
+ r = move_reading_point(a, file->offset);
+ else
+ r = ARCHIVE_OK;
+
+ file_free(file);
+ return (r);
+}
+
+static int
+xar_read_data(struct archive_read *a,
+ const void **buff, size_t *size, off_t *offset)
+{
+ struct xar *xar;
+ size_t used;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ if (xar->end_of_file || xar->entry_remaining <= 0) {
+ r = ARCHIVE_EOF;
+ goto abort_read_data;
+ }
+
+ if (xar->entry_init) {
+ r = rd_contents_init(a, xar->entry_encoding,
+ xar->entry_a_sum.alg, xar->entry_e_sum.alg);
+ if (r != ARCHIVE_OK) {
+ xar->entry_remaining = 0;
+ return (r);
+ }
+ xar->entry_init = 0;
+ }
+
+ *buff = NULL;
+ r = rd_contents(a, buff, size, &used, xar->entry_remaining);
+ if (r != ARCHIVE_OK)
+ goto abort_read_data;
+
+ *offset = xar->entry_total;
+ xar->entry_total += *size;
+ xar->total += *size;
+ xar->offset += used;
+ xar->entry_remaining -= used;
+ __archive_read_consume(a, used);
+
+ if (xar->entry_remaining == 0) {
+ if (xar->entry_total != xar->entry_size) {
+ archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
+ "Decompressed size error");
+ r = ARCHIVE_FATAL;
+ goto abort_read_data;
+ }
+ r = checksum_final(a,
+ xar->entry_a_sum.val, xar->entry_a_sum.len,
+ xar->entry_e_sum.val, xar->entry_e_sum.len);
+ if (r != ARCHIVE_OK)
+ goto abort_read_data;
+ }
+
+ return (ARCHIVE_OK);
+abort_read_data:
+ *buff = NULL;
+ *size = 0;
+ *offset = xar->total;
+ return (r);
+}
+
+static int
+xar_read_data_skip(struct archive_read *a)
+{
+ struct xar *xar;
+ int64_t bytes_skipped;
+
+ xar = (struct xar *)(a->format->data);
+ if (xar->end_of_file)
+ return (ARCHIVE_EOF);
+ bytes_skipped = __archive_read_skip(a, xar->entry_remaining);
+ if (bytes_skipped < 0)
+ return (ARCHIVE_FATAL);
+ xar->offset += bytes_skipped;
+ return (ARCHIVE_OK);
+}
+
+static int
+xar_cleanup(struct archive_read *a)
+{
+ struct xar *xar;
+ struct hdlink *hdlink;
+ int i;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ r = decompression_cleanup(a);
+ hdlink = xar->hdlink_list;
+ while (hdlink != NULL) {
+ struct hdlink *next = hdlink->next;
+
+ free(hdlink);
+ hdlink = next;
+ }
+ for (i = 0; i < xar->file_queue.used; i++)
+ file_free(xar->file_queue.files[i]);
+ while (xar->unknowntags != NULL) {
+ struct unknown_tag *tag;
+
+ tag = xar->unknowntags;
+ xar->unknowntags = tag->next;
+ archive_string_free(&(tag->name));
+ free(tag);
+ }
+ free(xar);
+ a->format->data = NULL;
+ return (r);
+}
+
+static int
+move_reading_point(struct archive_read *a, uint64_t offset)
+{
+ struct xar *xar;
+
+ xar = (struct xar *)(a->format->data);
+ if (xar->offset - xar->h_base != offset) {
+ /* Seek forward to the start of file contents. */
+ int64_t step;
+
+ step = offset - (xar->offset - xar->h_base);
+ if (step > 0) {
+ step = __archive_read_skip(a, step);
+ if (step < 0)
+ return ((int)step);
+ xar->offset += step;
+ } else {
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Cannot seek.");
+ return (ARCHIVE_FAILED);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+rd_contents_init(struct archive_read *a, enum enctype encoding,
+ int a_sum_alg, int e_sum_alg)
+{
+ int r;
+
+ /* Init decompress library. */
+ if ((r = decompression_init(a, encoding)) != ARCHIVE_OK)
+ return (r);
+ /* Init checksum library. */
+ checksum_init(a, a_sum_alg, e_sum_alg);
+ return (ARCHIVE_OK);
+}
+
+static int
+rd_contents(struct archive_read *a, const void **buff, size_t *size,
+ size_t *used, uint64_t remaining)
+{
+ const unsigned char *b;
+ ssize_t bytes;
+
+ /* Get whatever bytes are immediately available. */
+ b = __archive_read_ahead(a, 1, &bytes);
+ if (bytes < 0)
+ return ((int)bytes);
+ if (bytes == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Truncated archive file");
+ return (ARCHIVE_FATAL);
+ }
+ if ((uint64_t)bytes > remaining)
+ bytes = (ssize_t)remaining;
+
+ /*
+ * Decompress contents of file.
+ */
+ *used = bytes;
+ if (decompress(a, buff, size, b, used) != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+
+ /*
+ * Update checksum of a compressed data and a extracted data.
+ */
+ checksum_update(a, b, *used, *buff, *size);
+
+ return (ARCHIVE_OK);
+}
+
+/*
+ * Note that this implementation does not (and should not!) obey
+ * locale settings; you cannot simply substitute strtol here, since
+ * it does obey locale.
+ */
+
+static uint64_t
+atol10(const char *p, size_t char_cnt)
+{
+ uint64_t l;
+ int digit;
+
+ l = 0;
+ digit = *p - '0';
+ while (digit >= 0 && digit < 10 && char_cnt-- > 0) {
+ l = (l * 10) + digit;
+ digit = *++p - '0';
+ }
+ return (l);
+}
+
+static int64_t
+atol8(const char *p, size_t char_cnt)
+{
+ int64_t l;
+ int digit;
+
+ l = 0;
+ while (char_cnt-- > 0) {
+ if (*p >= '0' && *p <= '7')
+ digit = *p - '0';
+ else
+ break;
+ p++;
+ l <<= 3;
+ l |= digit;
+ }
+ return (l);
+}
+
+static size_t
+atohex(unsigned char *b, size_t bsize, const char *p, size_t psize)
+{
+ size_t fbsize = bsize;
+
+ while (bsize && psize > 1) {
+ unsigned char x;
+
+ if (p[0] >= 'a' && p[0] <= 'z')
+ x = (p[0] - 'a' + 0x0a) << 4;
+ else if (p[0] >= 'A' && p[0] <= 'Z')
+ x = (p[0] - 'A' + 0x0a) << 4;
+ else if (p[0] >= '0' && p[0] <= '9')
+ x = (p[0] - '0') << 4;
+ else
+ return (-1);
+ if (p[1] >= 'a' && p[1] <= 'z')
+ x |= p[1] - 'a' + 0x0a;
+ else if (p[1] >= 'A' && p[1] <= 'Z')
+ x |= p[1] - 'A' + 0x0a;
+ else if (p[1] >= '0' && p[1] <= '9')
+ x |= p[1] - '0';
+ else
+ return (-1);
+
+ *b++ = x;
+ bsize--;
+ p += 2;
+ psize -= 2;
+ }
+ return (fbsize - bsize);
+}
+
+static time_t
+time_from_tm(struct tm *t)
+{
+#if HAVE_TIMEGM
+ /* Use platform timegm() if available. */
+ return (timegm(t));
+#else
+ /* Else use direct calculation using POSIX assumptions. */
+ /* First, fix up tm_yday based on the year/month/day. */
+ mktime(t);
+ /* Then we can compute timegm() from first principles. */
+ return (t->tm_sec + t->tm_min * 60 + t->tm_hour * 3600
+ + t->tm_yday * 86400 + (t->tm_year - 70) * 31536000
+ + ((t->tm_year - 69) / 4) * 86400 -
+ ((t->tm_year - 1) / 100) * 86400
+ + ((t->tm_year + 299) / 400) * 86400);
+#endif
+}
+
+static time_t
+parse_time(const char *p, size_t n)
+{
+ struct tm tm;
+ time_t t = 0;
+ int64_t data;
+
+ memset(&tm, 0, sizeof(tm));
+ if (n != 20)
+ return (t);
+ data = atol10(p, 4);
+ if (data < 1900)
+ return (t);
+ tm.tm_year = (int)data - 1900;
+ p += 4;
+ if (*p++ != '-')
+ return (t);
+ data = atol10(p, 2);
+ if (data < 1 || data > 12)
+ return (t);
+ tm.tm_mon = (int)data -1;
+ p += 2;
+ if (*p++ != '-')
+ return (t);
+ data = atol10(p, 2);
+ if (data < 1 || data > 31)
+ return (t);
+ tm.tm_mday = (int)data;
+ p += 2;
+ if (*p++ != 'T')
+ return (t);
+ data = atol10(p, 2);
+ if (data < 0 || data > 23)
+ return (t);
+ tm.tm_hour = (int)data;
+ p += 2;
+ if (*p++ != ':')
+ return (t);
+ data = atol10(p, 2);
+ if (data < 0 || data > 59)
+ return (t);
+ tm.tm_min = (int)data;
+ p += 2;
+ if (*p++ != ':')
+ return (t);
+ data = atol10(p, 2);
+ if (data < 0 || data > 60)
+ return (t);
+ tm.tm_sec = (int)data;
+#if 0
+ p += 2;
+ if (*p != 'Z')
+ return (t);
+#endif
+
+ t = time_from_tm(&tm);
+
+ return (t);
+}
+
+static void
+heap_add_entry(struct heap_queue *heap, struct xar_file *file)
+{
+ uint64_t file_id, parent_id;
+ int hole, parent;
+
+ /* Expand our pending files list as necessary. */
+ if (heap->used >= heap->allocated) {
+ struct xar_file **new_pending_files;
+ int new_size = heap->allocated * 2;
+
+ if (heap->allocated < 1024)
+ new_size = 1024;
+ /* Overflow might keep us from growing the list. */
+ if (new_size <= heap->allocated)
+ __archive_errx(1, "Out of memory");
+ new_pending_files = (struct xar_file **)
+ malloc(new_size * sizeof(new_pending_files[0]));
+ if (new_pending_files == NULL)
+ __archive_errx(1, "Out of memory");
+ memcpy(new_pending_files, heap->files,
+ heap->allocated * sizeof(new_pending_files[0]));
+ if (heap->files != NULL)
+ free(heap->files);
+ heap->files = new_pending_files;
+ heap->allocated = new_size;
+ }
+
+ file_id = file->id;
+
+ /*
+ * Start with hole at end, walk it up tree to find insertion point.
+ */
+ hole = heap->used++;
+ while (hole > 0) {
+ parent = (hole - 1)/2;
+ parent_id = heap->files[parent]->id;
+ if (file_id >= parent_id) {
+ heap->files[hole] = file;
+ return;
+ }
+ // Move parent into hole <==> move hole up tree.
+ heap->files[hole] = heap->files[parent];
+ hole = parent;
+ }
+ heap->files[0] = file;
+}
+
+static struct xar_file *
+heap_get_entry(struct heap_queue *heap)
+{
+ uint64_t a_id, b_id, c_id;
+ int a, b, c;
+ struct xar_file *r, *tmp;
+
+ if (heap->used < 1)
+ return (NULL);
+
+ /*
+ * The first file in the list is the earliest; we'll return this.
+ */
+ r = heap->files[0];
+
+ /*
+ * Move the last item in the heap to the root of the tree
+ */
+ heap->files[0] = heap->files[--(heap->used)];
+
+ /*
+ * Rebalance the heap.
+ */
+ a = 0; // Starting element and its heap key
+ a_id = heap->files[a]->id;
+ for (;;) {
+ b = a + a + 1; // First child
+ if (b >= heap->used)
+ return (r);
+ b_id = heap->files[b]->id;
+ c = b + 1; // Use second child if it is smaller.
+ if (c < heap->used) {
+ c_id = heap->files[c]->id;
+ if (c_id < b_id) {
+ b = c;
+ b_id = c_id;
+ }
+ }
+ if (a_id <= b_id)
+ return (r);
+ tmp = heap->files[a];
+ heap->files[a] = heap->files[b];
+ heap->files[b] = tmp;
+ a = b;
+ }
+}
+
+static void
+add_link(struct xar *xar, struct xar_file *file)
+{
+ struct hdlink *hdlink;
+
+ for (hdlink = xar->hdlink_list; hdlink != NULL; hdlink = hdlink->next) {
+ if (hdlink->id == file->link) {
+ file->hdnext = hdlink->files;
+ hdlink->cnt++;
+ hdlink->files = file;
+ return;
+ }
+ }
+ hdlink = malloc(sizeof(*hdlink));
+ if (hdlink == NULL)
+ __archive_errx(1, "No memory for add_link()");
+ file->hdnext = NULL;
+ hdlink->id = file->link;
+ hdlink->cnt = 1;
+ hdlink->files = file;
+ hdlink->next = xar->hdlink_list;
+ xar->hdlink_list = hdlink;
+}
+
+static void
+_checksum_init(struct chksumwork *sumwrk, int sum_alg)
+{
+ sumwrk->alg = sum_alg;
+ switch (sum_alg) {
+ case CKSUM_NONE:
+ break;
+ case CKSUM_SHA1:
+ archive_sha1_init(&(sumwrk->sha1ctx));
+ break;
+ case CKSUM_MD5:
+ archive_md5_init(&(sumwrk->md5ctx));
+ break;
+ }
+}
+
+static void
+_checksum_update(struct chksumwork *sumwrk, const void *buff, size_t size)
+{
+
+ switch (sumwrk->alg) {
+ case CKSUM_NONE:
+ break;
+ case CKSUM_SHA1:
+ archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
+ break;
+ case CKSUM_MD5:
+ archive_md5_update(&(sumwrk->md5ctx), buff, size);
+ break;
+ }
+}
+
+static int
+_checksum_final(struct chksumwork *sumwrk, const void *val, size_t len)
+{
+ unsigned char sum[MAX_SUM_SIZE];
+ int r = ARCHIVE_OK;
+
+ switch (sumwrk->alg) {
+ case CKSUM_NONE:
+ break;
+ case CKSUM_SHA1:
+ archive_sha1_final(&(sumwrk->sha1ctx), sum);
+ if (len != SHA1_SIZE ||
+ memcmp(val, sum, SHA1_SIZE) != 0)
+ r = ARCHIVE_FAILED;
+ break;
+ case CKSUM_MD5:
+ archive_md5_final(&(sumwrk->md5ctx), sum);
+ if (len != MD5_SIZE ||
+ memcmp(val, sum, MD5_SIZE) != 0)
+ r = ARCHIVE_FAILED;
+ break;
+ }
+ return (r);
+}
+
+static void
+checksum_init(struct archive_read *a, int a_sum_alg, int e_sum_alg)
+{
+ struct xar *xar;
+
+ xar = (struct xar *)(a->format->data);
+ _checksum_init(&(xar->a_sumwrk), a_sum_alg);
+ _checksum_init(&(xar->e_sumwrk), e_sum_alg);
+}
+
+static void
+checksum_update(struct archive_read *a, const void *abuff, size_t asize,
+ const void *ebuff, size_t esize)
+{
+ struct xar *xar;
+
+ xar = (struct xar *)(a->format->data);
+ _checksum_update(&(xar->a_sumwrk), abuff, asize);
+ _checksum_update(&(xar->e_sumwrk), ebuff, esize);
+}
+
+static int
+checksum_final(struct archive_read *a, const void *a_sum_val,
+ size_t a_sum_len, const void *e_sum_val, size_t e_sum_len)
+{
+ struct xar *xar;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ r = _checksum_final(&(xar->a_sumwrk), a_sum_val, a_sum_len);
+ if (r == ARCHIVE_OK)
+ r = _checksum_final(&(xar->e_sumwrk), e_sum_val, e_sum_len);
+ if (r != ARCHIVE_OK)
+ archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
+ "Sumcheck error");
+ return (r);
+}
+
+static int
+decompression_init(struct archive_read *a, enum enctype encoding)
+{
+ struct xar *xar;
+ const char *detail;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ xar->rd_encoding = encoding;
+ switch (encoding) {
+ case NONE:
+ break;
+ case GZIP:
+ if (xar->stream_valid)
+ r = inflateReset(&(xar->stream));
+ else
+ r = inflateInit(&(xar->stream));
+ if (r != Z_OK) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Couldn't initialize zlib stream.");
+ return (ARCHIVE_FATAL);
+ }
+ xar->stream_valid = 1;
+ xar->stream.total_in = 0;
+ xar->stream.total_out = 0;
+ break;
+#ifdef HAVE_BZLIB_H
+ case BZIP2:
+ if (xar->bzstream_valid) {
+ BZ2_bzDecompressEnd(&(xar->bzstream));
+ xar->bzstream_valid = 0;
+ }
+ r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 0);
+ if (r == BZ_MEM_ERROR)
+ r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 1);
+ if (r != BZ_OK) {
+ int err = ARCHIVE_ERRNO_MISC;
+ detail = NULL;
+ switch (r) {
+ case BZ_PARAM_ERROR:
+ detail = "invalid setup parameter";
+ break;
+ case BZ_MEM_ERROR:
+ err = ENOMEM;
+ detail = "out of memory";
+ break;
+ case BZ_CONFIG_ERROR:
+ detail = "mis-compiled library";
+ break;
+ }
+ archive_set_error(&a->archive, err,
+ "Internal error initializing decompressor: %s",
+ detail == NULL ? "??" : detail);
+ xar->bzstream_valid = 0;
+ return (ARCHIVE_FATAL);
+ }
+ xar->bzstream_valid = 1;
+ xar->bzstream.total_in_lo32 = 0;
+ xar->bzstream.total_in_hi32 = 0;
+ xar->bzstream.total_out_lo32 = 0;
+ xar->bzstream.total_out_hi32 = 0;
+ break;
+#endif
+#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
+ case XZ:
+ case LZMA:
+ if (xar->lzstream_valid) {
+ lzma_end(&(xar->lzstream));
+ xar->lzstream_valid = 0;
+ }
+ if (xar->entry_encoding == XZ)
+ r = lzma_stream_decoder(&(xar->lzstream),
+ (1U << 30),/* memlimit */
+ LZMA_CONCATENATED);
+ else
+ r = lzma_alone_decoder(&(xar->lzstream),
+ (1U << 30));/* memlimit */
+ if (r != LZMA_OK) {
+ switch (r) {
+ case LZMA_MEM_ERROR:
+ archive_set_error(&a->archive,
+ ENOMEM,
+ "Internal error initializing "
+ "compression library: "
+ "Cannot allocate memory");
+ break;
+ case LZMA_OPTIONS_ERROR:
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing "
+ "compression library: "
+ "Invalid or unsupported options");
+ break;
+ default:
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing "
+ "lzma library");
+ break;
+ }
+ return (ARCHIVE_FATAL);
+ }
+ xar->lzstream_valid = 1;
+ xar->lzstream.total_in = 0;
+ xar->lzstream.total_out = 0;
+ break;
+#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
+ case LZMA:
+ if (xar->lzstream_valid)
+ lzmadec_end(&(xar->lzstream));
+ r = lzmadec_init(&(xar->lzstream));
+ if (r != LZMADEC_OK) {
+ switch (r) {
+ case LZMADEC_HEADER_ERROR:
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Internal error initializing "
+ "compression library: "
+ "invalid header");
+ break;
+ case LZMADEC_MEM_ERROR:
+ archive_set_error(&a->archive,
+ ENOMEM,
+ "Internal error initializing "
+ "compression library: "
+ "out of memory");
+ break;
+ }
+ return (ARCHIVE_FATAL);
+ }
+ xar->lzstream_valid = 1;
+ xar->lzstream.total_in = 0;
+ xar->lzstream.total_out = 0;
+ break;
+#endif
+ /*
+ * Unsupported compression.
+ */
+ default:
+#ifndef HAVE_BZLIB_H
+ case BZIP2:
+#endif
+#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
+#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
+ case LZMA:
+#endif
+ case XZ:
+#endif
+ switch (xar->entry_encoding) {
+ case BZIP2: detail = "bzip2"; break;
+ case LZMA: detail = "lzma"; break;
+ case XZ: detail = "xz"; break;
+ default: detail = "??"; break;
+ }
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "%s compression not supported on this platform",
+ detail);
+ return (ARCHIVE_FAILED);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+decompress(struct archive_read *a, const void **buff, size_t *outbytes,
+ const void *b, size_t *used)
+{
+ struct xar *xar;
+ void *outbuff;
+ size_t avail_in, avail_out;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ avail_in = *used;
+ outbuff = (void *)(uintptr_t)*buff;
+ if (outbuff == NULL) {
+ outbuff = xar->buff;
+ *buff = outbuff;
+ avail_out = sizeof(xar->buff);
+ } else
+ avail_out = *outbytes;
+ switch (xar->rd_encoding) {
+ case GZIP:
+ xar->stream.next_in = (Bytef *)(uintptr_t)b;
+ xar->stream.avail_in = avail_in;
+ xar->stream.next_out = (unsigned char *)outbuff;
+ xar->stream.avail_out = avail_out;
+ r = inflate(&(xar->stream), 0);
+ switch (r) {
+ case Z_OK: /* Decompressor made some progress.*/
+ case Z_STREAM_END: /* Found end of stream. */
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "File decompression failed (%d)", r);
+ return (ARCHIVE_FATAL);
+ }
+ *used = avail_in - xar->stream.avail_in;
+ *outbytes = avail_out - xar->stream.avail_out;
+ break;
+#ifdef HAVE_BZLIB_H
+ case BZIP2:
+ xar->bzstream.next_in = (char *)(uintptr_t)b;
+ xar->bzstream.avail_in = avail_in;
+ xar->bzstream.next_out = (char *)outbuff;
+ xar->bzstream.avail_out = avail_out;
+ r = BZ2_bzDecompress(&(xar->bzstream));
+ switch (r) {
+ case BZ_STREAM_END: /* Found end of stream. */
+ switch (BZ2_bzDecompressEnd(&(xar->bzstream))) {
+ case BZ_OK:
+ break;
+ default:
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up decompressor");
+ return (ARCHIVE_FATAL);
+ }
+ xar->bzstream_valid = 0;
+ /* FALLTHROUGH */
+ case BZ_OK: /* Decompressor made some progress. */
+ break;
+ default:
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "bzip decompression failed");
+ return (ARCHIVE_FATAL);
+ }
+ *used = avail_in - xar->bzstream.avail_in;
+ *outbytes = avail_out - xar->bzstream.avail_out;
+ break;
+#endif
+#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
+ case LZMA:
+ case XZ:
+ xar->lzstream.next_in = b;
+ xar->lzstream.avail_in = avail_in;
+ xar->lzstream.next_out = (unsigned char *)outbuff;
+ xar->lzstream.avail_out = avail_out;
+ r = lzma_code(&(xar->lzstream), LZMA_RUN);
+ switch (r) {
+ case LZMA_STREAM_END: /* Found end of stream. */
+ lzma_end(&(xar->lzstream));
+ xar->lzstream_valid = 0;
+ /* FALLTHROUGH */
+ case LZMA_OK: /* Decompressor made some progress. */
+ break;
+ default:
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "%s decompression failed(%d)",
+ (xar->entry_encoding == XZ)?"xz":"lzma",
+ r);
+ return (ARCHIVE_FATAL);
+ }
+ *used = avail_in - xar->lzstream.avail_in;
+ *outbytes = avail_out - xar->lzstream.avail_out;
+ break;
+#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
+ case LZMA:
+ xar->lzstream.next_in = (unsigned char *)(uintptr_t)b;
+ xar->lzstream.avail_in = avail_in;
+ xar->lzstream.next_out = (unsigned char *)outbuff;
+ xar->lzstream.avail_out = avail_out;
+ r = lzmadec_decode(&(xar->lzstream), 0);
+ switch (r) {
+ case LZMADEC_STREAM_END: /* Found end of stream. */
+ switch (lzmadec_end(&(xar->lzstream))) {
+ case LZMADEC_OK:
+ break;
+ default:
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up lzmadec decompressor");
+ return (ARCHIVE_FATAL);
+ }
+ xar->lzstream_valid = 0;
+ /* FALLTHROUGH */
+ case LZMADEC_OK: /* Decompressor made some progress. */
+ break;
+ default:
+ archive_set_error(&(a->archive),
+ ARCHIVE_ERRNO_MISC,
+ "lzmadec decompression failed(%d)",
+ r);
+ return (ARCHIVE_FATAL);
+ }
+ *used = avail_in - xar->lzstream.avail_in;
+ *outbytes = avail_out - xar->lzstream.avail_out;
+ break;
+#endif
+#ifndef HAVE_BZLIB_H
+ case BZIP2:
+#endif
+#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
+#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
+ case LZMA:
+#endif
+ case XZ:
+#endif
+ case NONE:
+ default:
+ if (outbuff == xar->buff) {
+ *buff = b;
+ *used = avail_in;
+ *outbytes = avail_in;
+ } else {
+ if (avail_out > avail_in)
+ avail_out = avail_in;
+ memcpy(outbuff, b, avail_out);
+ *used = avail_out;
+ *outbytes = avail_out;
+ }
+ break;
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+decompression_cleanup(struct archive_read *a)
+{
+ struct xar *xar;
+ int r;
+
+ xar = (struct xar *)(a->format->data);
+ r = ARCHIVE_OK;
+ if (xar->stream_valid) {
+ if (inflateEnd(&(xar->stream)) != Z_OK) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up zlib decompressor");
+ r = ARCHIVE_FATAL;
+ }
+ }
+#ifdef HAVE_BZLIB_H
+ if (xar->bzstream_valid) {
+ if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up bzip2 decompressor");
+ r = ARCHIVE_FATAL;
+ }
+ }
+#endif
+#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
+ if (xar->lzstream_valid)
+ lzma_end(&(xar->lzstream));
+#elif defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
+ if (xar->lzstream_valid) {
+ if (lzmadec_end(&(xar->lzstream)) != LZMADEC_OK) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Failed to clean up lzmadec decompressor");
+ r = ARCHIVE_FATAL;
+ }
+ }
+#endif
+ return (r);
+}
+
+static void
+xmlattr_cleanup(struct xmlattr_list *list)
+{
+ struct xmlattr *attr, *next;
+
+ attr = list->first;
+ while (attr != NULL) {
+ next = attr->next;
+ free(attr->name);
+ free(attr->value);
+ free(attr);
+ attr = next;
+ }
+ list->first = NULL;
+ list->last = &(list->first);
+}
+
+static void
+file_new(struct xar *xar, struct xmlattr_list *list)
+{
+ struct xar_file *file;
+ struct xmlattr *attr;
+
+ file = calloc(1, sizeof(*file));
+ if (file == NULL)
+ __archive_errx(1, "Out of memory");
+ file->parent = xar->file;
+ file->mode = 0777 | AE_IFREG;
+ file->atime = time(NULL);
+ file->mtime = time(NULL);
+ xar->file = file;
+ xar->xattr = NULL;
+ for (attr = list->first; attr != NULL; attr = attr->next) {
+ if (strcmp(attr->name, "id") == 0)
+ file->id = atol10(attr->value, strlen(attr->value));
+ }
+ file->nlink = 1;
+ heap_add_entry(&(xar->file_queue), file);
+}
+
+static void
+file_free(struct xar_file *file)
+{
+ struct xattr *xattr;
+
+ archive_string_free(&(file->pathname));
+ archive_string_free(&(file->symlink));
+ archive_string_free(&(file->uname));
+ archive_string_free(&(file->gname));
+ archive_string_free(&(file->hardlink));
+ xattr = file->xattr_list;
+ while (xattr != NULL) {
+ struct xattr *next;
+
+ next = xattr->next;
+ xattr_free(xattr);
+ xattr = next;
+ }
+
+ free(file);
+}
+
+static void
+xattr_new(struct xar *xar, struct xmlattr_list *list)
+{
+ struct xattr *xattr, **nx;
+ struct xmlattr *attr;
+
+ xattr = calloc(1, sizeof(*xattr));
+ if (xattr == NULL)
+ __archive_errx(1, "Out of memory");
+ xar->xattr = xattr;
+ for (attr = list->first; attr != NULL; attr = attr->next) {
+ if (strcmp(attr->name, "id") == 0)
+ xattr->id = atol10(attr->value, strlen(attr->value));
+ }
+ /* Chain to xattr list. */
+ for (nx = &(xar->file->xattr_list);
+ *nx != NULL; nx = &((*nx)->next)) {
+ if (xattr->id < (*nx)->id)
+ break;
+ }
+ xattr->next = *nx;
+ *nx = xattr;
+}
+
+static void
+xattr_free(struct xattr *xattr)
+{
+ archive_string_free(&(xattr->name));
+ free(xattr);
+}
+
+static int
+getencoding(struct xmlattr_list *list)
+{
+ struct xmlattr *attr;
+ enum enctype encoding = NONE;
+
+ for (attr = list->first; attr != NULL; attr = attr->next) {
+ if (strcmp(attr->name, "style") == 0) {
+ if (strcmp(attr->value, "application/octet-stream") == 0)
+ encoding = NONE;
+ else if (strcmp(attr->value, "application/x-gzip") == 0)
+ encoding = GZIP;
+ else if (strcmp(attr->value, "application/x-bzip2") == 0)
+ encoding = BZIP2;
+ else if (strcmp(attr->value, "application/x-lzma") == 0)
+ encoding = LZMA;
+ else if (strcmp(attr->value, "application/x-xz") == 0)
+ encoding = XZ;
+ }
+ }
+ return (encoding);
+}
+
+static int
+getsumalgorithm(struct xmlattr_list *list)
+{
+ struct xmlattr *attr;
+ int alg = CKSUM_NONE;
+
+ for (attr = list->first; attr != NULL; attr = attr->next) {
+ if (strcmp(attr->name, "style") == 0) {
+ const char *v = attr->value;
+ if ((v[0] == 'S' || v[0] == 's') &&
+ (v[1] == 'H' || v[1] == 'h') &&
+ (v[2] == 'A' || v[2] == 'a') &&
+ v[3] == '1' && v[4] == '\0')
+ alg = CKSUM_SHA1;
+ if ((v[0] == 'M' || v[0] == 'm') &&
+ (v[1] == 'D' || v[1] == 'd') &&
+ v[2] == '5' && v[3] == '\0')
+ alg = CKSUM_MD5;
+ }
+ }
+ return (alg);
+}
+
+static void
+unknowntag_start(struct xar *xar, const char *name)
+{
+ struct unknown_tag *tag;
+
+#if DEBUG
+ fprintf(stderr, "unknowntag_start:%s\n", name);
+#endif
+ tag = malloc(sizeof(*tag));
+ if (tag == NULL)
+ __archive_errx(1, "Out of memory");
+ tag->next = xar->unknowntags;
+ archive_string_init(&(tag->name));
+ archive_strcpy(&(tag->name), name);
+ if (xar->unknowntags == NULL) {
+ xar->xmlsts_unknown = xar->xmlsts;
+ xar->xmlsts = UNKNOWN;
+ }
+ xar->unknowntags = tag;
+}
+
+static void
+unknowntag_end(struct xar *xar, const char *name)
+{
+ struct unknown_tag *tag;
+
+#if DEBUG
+ fprintf(stderr, "unknowntag_end:%s\n", name);
+#endif
+ tag = xar->unknowntags;
+ if (tag == NULL || name == NULL)
+ return;
+ if (strcmp(tag->name.s, name) == 0) {
+ xar->unknowntags = tag->next;
+ archive_string_free(&(tag->name));
+ free(tag);
+ if (xar->unknowntags == NULL)
+ xar->xmlsts = xar->xmlsts_unknown;
+ }
+}
+
+static void
+xml_start(void *userData, const char *name, struct xmlattr_list *list)
+{
+ struct archive_read *a;
+ struct xar *xar;
+ struct xmlattr *attr;
+
+ a = (struct archive_read *)userData;
+ xar = (struct xar *)(a->format->data);
+
+#if DEBUG
+ fprintf(stderr, "xml_sta:[%s]\n", name);
+ for (attr = list->first; attr != NULL; attr = attr->next)
+ fprintf(stderr, " attr:\"%s\"=\"%s\"\n",
+ attr->name, attr->value);
+#endif
+ xar->base64text = 0;
+ switch (xar->xmlsts) {
+ case INIT:
+ if (strcmp(name, "xar") == 0)
+ xar->xmlsts = XAR;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case XAR:
+ if (strcmp(name, "toc") == 0)
+ xar->xmlsts = TOC;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case TOC:
+ if (strcmp(name, "creation-time") == 0)
+ xar->xmlsts = TOC_CREATION_TIME;
+ else if (strcmp(name, "checksum") == 0)
+ xar->xmlsts = TOC_CHECKSUM;
+ else if (strcmp(name, "file") == 0) {
+ file_new(xar, list);
+ xar->xmlsts = TOC_FILE;
+ }
+ else
+ unknowntag_start(xar, name);
+ break;
+ case TOC_CHECKSUM:
+ if (strcmp(name, "offset") == 0)
+ xar->xmlsts = TOC_CHECKSUM_OFFSET;
+ else if (strcmp(name, "size") == 0)
+ xar->xmlsts = TOC_CHECKSUM_SIZE;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case TOC_FILE:
+ if (strcmp(name, "file") == 0) {
+ file_new(xar, list);
+ }
+ else if (strcmp(name, "data") == 0)
+ xar->xmlsts = FILE_DATA;
+ else if (strcmp(name, "ea") == 0) {
+ xattr_new(xar, list);
+ xar->xmlsts = FILE_EA;
+ }
+ else if (strcmp(name, "ctime") == 0)
+ xar->xmlsts = FILE_CTIME;
+ else if (strcmp(name, "mtime") == 0)
+ xar->xmlsts = FILE_MTIME;
+ else if (strcmp(name, "atime") == 0)
+ xar->xmlsts = FILE_ATIME;
+ else if (strcmp(name, "group") == 0)
+ xar->xmlsts = FILE_GROUP;
+ else if (strcmp(name, "gid") == 0)
+ xar->xmlsts = FILE_GID;
+ else if (strcmp(name, "user") == 0)
+ xar->xmlsts = FILE_USER;
+ else if (strcmp(name, "uid") == 0)
+ xar->xmlsts = FILE_UID;
+ else if (strcmp(name, "mode") == 0)
+ xar->xmlsts = FILE_MODE;
+ else if (strcmp(name, "device") == 0)
+ xar->xmlsts = FILE_DEVICE;
+ else if (strcmp(name, "deviceno") == 0)
+ xar->xmlsts = FILE_DEVICENO;
+ else if (strcmp(name, "inode") == 0)
+ xar->xmlsts = FILE_INODE;
+ else if (strcmp(name, "link") == 0)
+ xar->xmlsts = FILE_LINK;
+ else if (strcmp(name, "type") == 0) {
+ xar->xmlsts = FILE_TYPE;
+ for (attr = list->first; attr != NULL;
+ attr = attr->next) {
+ if (strcmp(attr->name, "link") != 0)
+ continue;
+ if (strcmp(attr->value, "original") == 0) {
+ xar->file->hdnext = xar->hdlink_orgs;
+ xar->hdlink_orgs = xar->file;
+ } else {
+ xar->file->link = atol10(attr->value,
+ strlen(attr->value));
+ if (xar->file->link > 0)
+ add_link(xar, xar->file);
+ }
+ }
+ }
+ else if (strcmp(name, "name") == 0) {
+ xar->xmlsts = FILE_NAME;
+ for (attr = list->first; attr != NULL;
+ attr = attr->next) {
+ if (strcmp(attr->name, "enctype") == 0 &&
+ strcmp(attr->value, "base64") == 0)
+ xar->base64text = 1;
+ }
+ }
+ else if (strcmp(name, "acl") == 0)
+ xar->xmlsts = FILE_ACL;
+ else if (strcmp(name, "flags") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ else if (strcmp(name, "ext2") == 0)
+ xar->xmlsts = FILE_EXT2;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case FILE_DATA:
+ if (strcmp(name, "length") == 0)
+ xar->xmlsts = FILE_DATA_LENGTH;
+ else if (strcmp(name, "offset") == 0)
+ xar->xmlsts = FILE_DATA_OFFSET;
+ else if (strcmp(name, "size") == 0)
+ xar->xmlsts = FILE_DATA_SIZE;
+ else if (strcmp(name, "encoding") == 0) {
+ xar->xmlsts = FILE_DATA_ENCODING;
+ xar->file->encoding = getencoding(list);
+ }
+ else if (strcmp(name, "archived-checksum") == 0) {
+ xar->xmlsts = FILE_DATA_A_CHECKSUM;
+ xar->file->a_sum.alg = getsumalgorithm(list);
+ }
+ else if (strcmp(name, "extracted-checksum") == 0) {
+ xar->xmlsts = FILE_DATA_E_CHECKSUM;
+ xar->file->e_sum.alg = getsumalgorithm(list);
+ }
+ else if (strcmp(name, "content") == 0)
+ xar->xmlsts = FILE_DATA_CONTENT;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case FILE_DEVICE:
+ if (strcmp(name, "major") == 0)
+ xar->xmlsts = FILE_DEVICE_MAJOR;
+ else if (strcmp(name, "minor") == 0)
+ xar->xmlsts = FILE_DEVICE_MINOR;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case FILE_DATA_CONTENT:
+ unknowntag_start(xar, name);
+ break;
+ case FILE_EA:
+ if (strcmp(name, "length") == 0)
+ xar->xmlsts = FILE_EA_LENGTH;
+ else if (strcmp(name, "offset") == 0)
+ xar->xmlsts = FILE_EA_OFFSET;
+ else if (strcmp(name, "size") == 0)
+ xar->xmlsts = FILE_EA_SIZE;
+ else if (strcmp(name, "encoding") == 0) {
+ xar->xmlsts = FILE_EA_ENCODING;
+ xar->xattr->encoding = getencoding(list);
+ } else if (strcmp(name, "archived-checksum") == 0)
+ xar->xmlsts = FILE_EA_A_CHECKSUM;
+ else if (strcmp(name, "extracted-checksum") == 0)
+ xar->xmlsts = FILE_EA_E_CHECKSUM;
+ else if (strcmp(name, "name") == 0)
+ xar->xmlsts = FILE_EA_NAME;
+ else if (strcmp(name, "fstype") == 0)
+ xar->xmlsts = FILE_EA_FSTYPE;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case FILE_ACL:
+ if (strcmp(name, "appleextended") == 0)
+ xar->xmlsts = FILE_ACL_APPLEEXTENDED;
+ if (strcmp(name, "default") == 0)
+ xar->xmlsts = FILE_ACL_DEFAULT;
+ else if (strcmp(name, "access") == 0)
+ xar->xmlsts = FILE_ACL_ACCESS;
+ else
+ unknowntag_start(xar, name);
+ break;
+ case FILE_FLAGS:
+ if (!xml_parse_file_flags(xar, name))
+ unknowntag_start(xar, name);
+ break;
+ case FILE_EXT2:
+ if (!xml_parse_file_ext2(xar, name))
+ unknowntag_start(xar, name);
+ break;
+ case TOC_CREATION_TIME:
+ case TOC_CHECKSUM_OFFSET:
+ case TOC_CHECKSUM_SIZE:
+ case FILE_DATA_LENGTH:
+ case FILE_DATA_OFFSET:
+ case FILE_DATA_SIZE:
+ case FILE_DATA_ENCODING:
+ case FILE_DATA_A_CHECKSUM:
+ case FILE_DATA_E_CHECKSUM:
+ case FILE_EA_LENGTH:
+ case FILE_EA_OFFSET:
+ case FILE_EA_SIZE:
+ case FILE_EA_ENCODING:
+ case FILE_EA_A_CHECKSUM:
+ case FILE_EA_E_CHECKSUM:
+ case FILE_EA_NAME:
+ case FILE_EA_FSTYPE:
+ case FILE_CTIME:
+ case FILE_MTIME:
+ case FILE_ATIME:
+ case FILE_GROUP:
+ case FILE_GID:
+ case FILE_USER:
+ case FILE_UID:
+ case FILE_INODE:
+ case FILE_DEVICE_MAJOR:
+ case FILE_DEVICE_MINOR:
+ case FILE_DEVICENO:
+ case FILE_MODE:
+ case FILE_TYPE:
+ case FILE_LINK:
+ case FILE_NAME:
+ case FILE_ACL_DEFAULT:
+ case FILE_ACL_ACCESS:
+ case FILE_ACL_APPLEEXTENDED:
+ case FILE_FLAGS_USER_NODUMP:
+ case FILE_FLAGS_USER_IMMUTABLE:
+ case FILE_FLAGS_USER_APPEND:
+ case FILE_FLAGS_USER_OPAQUE:
+ case FILE_FLAGS_USER_NOUNLINK:
+ case FILE_FLAGS_SYS_ARCHIVED:
+ case FILE_FLAGS_SYS_IMMUTABLE:
+ case FILE_FLAGS_SYS_APPEND:
+ case FILE_FLAGS_SYS_NOUNLINK:
+ case FILE_FLAGS_SYS_SNAPSHOT:
+ case FILE_EXT2_SecureDeletion:
+ case FILE_EXT2_Undelete:
+ case FILE_EXT2_Compress:
+ case FILE_EXT2_Synchronous:
+ case FILE_EXT2_Immutable:
+ case FILE_EXT2_AppendOnly:
+ case FILE_EXT2_NoDump:
+ case FILE_EXT2_NoAtime:
+ case FILE_EXT2_CompDirty:
+ case FILE_EXT2_CompBlock:
+ case FILE_EXT2_NoCompBlock:
+ case FILE_EXT2_CompError:
+ case FILE_EXT2_BTree:
+ case FILE_EXT2_HashIndexed:
+ case FILE_EXT2_iMagic:
+ case FILE_EXT2_Journaled:
+ case FILE_EXT2_NoTail:
+ case FILE_EXT2_DirSync:
+ case FILE_EXT2_TopDir:
+ case FILE_EXT2_Reserved:
+ case UNKNOWN:
+ unknowntag_start(xar, name);
+ break;
+ }
+}
+
+static void
+xml_end(void *userData, const char *name)
+{
+ struct archive_read *a;
+ struct xar *xar;
+
+ a = (struct archive_read *)userData;
+ xar = (struct xar *)(a->format->data);
+
+#if DEBUG
+ fprintf(stderr, "xml_end:[%s]\n", name);
+#endif
+ switch (xar->xmlsts) {
+ case INIT:
+ break;
+ case XAR:
+ if (strcmp(name, "xar") == 0)
+ xar->xmlsts = INIT;
+ break;
+ case TOC:
+ if (strcmp(name, "toc") == 0)
+ xar->xmlsts = XAR;
+ break;
+ case TOC_CREATION_TIME:
+ if (strcmp(name, "creation-time") == 0)
+ xar->xmlsts = TOC;
+ break;
+ case TOC_CHECKSUM:
+ if (strcmp(name, "checksum") == 0)
+ xar->xmlsts = TOC;
+ break;
+ case TOC_CHECKSUM_OFFSET:
+ if (strcmp(name, "offset") == 0)
+ xar->xmlsts = TOC_CHECKSUM;
+ break;
+ case TOC_CHECKSUM_SIZE:
+ if (strcmp(name, "size") == 0)
+ xar->xmlsts = TOC_CHECKSUM;
+ break;
+ case TOC_FILE:
+ if (strcmp(name, "file") == 0) {
+ if (xar->file->parent != NULL &&
+ ((xar->file->mode & AE_IFMT) == AE_IFDIR))
+ xar->file->parent->subdirs++;
+ xar->file = xar->file->parent;
+ if (xar->file == NULL)
+ xar->xmlsts = TOC;
+ }
+ break;
+ case FILE_DATA:
+ if (strcmp(name, "data") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_DATA_LENGTH:
+ if (strcmp(name, "length") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_OFFSET:
+ if (strcmp(name, "offset") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_SIZE:
+ if (strcmp(name, "size") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_ENCODING:
+ if (strcmp(name, "encoding") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_A_CHECKSUM:
+ if (strcmp(name, "archived-checksum") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_E_CHECKSUM:
+ if (strcmp(name, "extracted-checksum") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_DATA_CONTENT:
+ if (strcmp(name, "content") == 0)
+ xar->xmlsts = FILE_DATA;
+ break;
+ case FILE_EA:
+ if (strcmp(name, "ea") == 0) {
+ xar->xmlsts = TOC_FILE;
+ xar->xattr = NULL;
+ }
+ break;
+ case FILE_EA_LENGTH:
+ if (strcmp(name, "length") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_OFFSET:
+ if (strcmp(name, "offset") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_SIZE:
+ if (strcmp(name, "size") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_ENCODING:
+ if (strcmp(name, "encoding") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_A_CHECKSUM:
+ if (strcmp(name, "archived-checksum") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_E_CHECKSUM:
+ if (strcmp(name, "extracted-checksum") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_NAME:
+ if (strcmp(name, "name") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_EA_FSTYPE:
+ if (strcmp(name, "fstype") == 0)
+ xar->xmlsts = FILE_EA;
+ break;
+ case FILE_CTIME:
+ if (strcmp(name, "ctime") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_MTIME:
+ if (strcmp(name, "mtime") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_ATIME:
+ if (strcmp(name, "atime") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_GROUP:
+ if (strcmp(name, "group") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_GID:
+ if (strcmp(name, "gid") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_USER:
+ if (strcmp(name, "user") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_UID:
+ if (strcmp(name, "uid") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_MODE:
+ if (strcmp(name, "mode") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_DEVICE:
+ if (strcmp(name, "device") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_DEVICE_MAJOR:
+ if (strcmp(name, "major") == 0)
+ xar->xmlsts = FILE_DEVICE;
+ break;
+ case FILE_DEVICE_MINOR:
+ if (strcmp(name, "minor") == 0)
+ xar->xmlsts = FILE_DEVICE;
+ break;
+ case FILE_DEVICENO:
+ if (strcmp(name, "deviceno") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_INODE:
+ if (strcmp(name, "inode") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_LINK:
+ if (strcmp(name, "link") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_TYPE:
+ if (strcmp(name, "type") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_NAME:
+ if (strcmp(name, "name") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_ACL:
+ if (strcmp(name, "acl") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_ACL_DEFAULT:
+ if (strcmp(name, "default") == 0)
+ xar->xmlsts = FILE_ACL;
+ break;
+ case FILE_ACL_ACCESS:
+ if (strcmp(name, "access") == 0)
+ xar->xmlsts = FILE_ACL;
+ break;
+ case FILE_ACL_APPLEEXTENDED:
+ if (strcmp(name, "appleextended") == 0)
+ xar->xmlsts = FILE_ACL;
+ break;
+ case FILE_FLAGS:
+ if (strcmp(name, "flags") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_FLAGS_USER_NODUMP:
+ if (strcmp(name, "UserNoDump") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_USER_IMMUTABLE:
+ if (strcmp(name, "UserImmutable") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_USER_APPEND:
+ if (strcmp(name, "UserAppend") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_USER_OPAQUE:
+ if (strcmp(name, "UserOpaque") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_USER_NOUNLINK:
+ if (strcmp(name, "UserNoUnlink") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_SYS_ARCHIVED:
+ if (strcmp(name, "SystemArchived") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_SYS_IMMUTABLE:
+ if (strcmp(name, "SystemImmutable") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_SYS_APPEND:
+ if (strcmp(name, "SystemAppend") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_SYS_NOUNLINK:
+ if (strcmp(name, "SystemNoUnlink") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_FLAGS_SYS_SNAPSHOT:
+ if (strcmp(name, "SystemSnapshot") == 0)
+ xar->xmlsts = FILE_FLAGS;
+ break;
+ case FILE_EXT2:
+ if (strcmp(name, "ext2") == 0)
+ xar->xmlsts = TOC_FILE;
+ break;
+ case FILE_EXT2_SecureDeletion:
+ if (strcmp(name, "SecureDeletion") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Undelete:
+ if (strcmp(name, "Undelete") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Compress:
+ if (strcmp(name, "Compress") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Synchronous:
+ if (strcmp(name, "Synchronous") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Immutable:
+ if (strcmp(name, "Immutable") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_AppendOnly:
+ if (strcmp(name, "AppendOnly") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_NoDump:
+ if (strcmp(name, "NoDump") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_NoAtime:
+ if (strcmp(name, "NoAtime") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_CompDirty:
+ if (strcmp(name, "CompDirty") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_CompBlock:
+ if (strcmp(name, "CompBlock") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_NoCompBlock:
+ if (strcmp(name, "NoCompBlock") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_CompError:
+ if (strcmp(name, "CompError") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_BTree:
+ if (strcmp(name, "BTree") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_HashIndexed:
+ if (strcmp(name, "HashIndexed") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_iMagic:
+ if (strcmp(name, "iMagic") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Journaled:
+ if (strcmp(name, "Journaled") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_NoTail:
+ if (strcmp(name, "NoTail") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_DirSync:
+ if (strcmp(name, "DirSync") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_TopDir:
+ if (strcmp(name, "TopDir") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case FILE_EXT2_Reserved:
+ if (strcmp(name, "Reserved") == 0)
+ xar->xmlsts = FILE_EXT2;
+ break;
+ case UNKNOWN:
+ unknowntag_end(xar, name);
+ break;
+ }
+}
+
+static const int base64[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 00 - 0F */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 10 - 1F */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 62, -1, -1, -1, 63, /* 20 - 2F */
+ 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, -1, -1, -1, -1, -1, -1, /* 30 - 3F */
+ -1, 0, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, /* 40 - 4F */
+ 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, -1, -1, -1, -1, -1, /* 50 - 5F */
+ -1, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, /* 60 - 6F */
+ 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, -1, -1, -1, -1, -1, /* 70 - 7F */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 80 - 8F */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 90 - 9F */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* A0 - AF */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* B0 - BF */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* C0 - CF */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* D0 - DF */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* E0 - EF */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, /* F0 - FF */
+};
+
+static void
+strappend_base64(struct archive_string *as, const char *s, size_t l)
+{
+ unsigned char buff[256];
+ unsigned char *out;
+ const unsigned char *b;
+ size_t len;
+
+ len = 0;
+ out = buff;
+ b = (const unsigned char *)s;
+ while (l > 0) {
+ int n = 0;
+
+ if (l > 0) {
+ if (base64[b[0]] < 0 || base64[b[1]] < 0)
+ break;
+ n = base64[*b++] << 18;
+ n |= base64[*b++] << 12;
+ *out++ = n >> 16;
+ len++;
+ l -= 2;
+ }
+ if (l > 0) {
+ if (base64[*b] < 0)
+ break;
+ n |= base64[*b++] << 6;
+ *out++ = (n >> 8) & 0xFF;
+ len++;
+ --l;
+ }
+ if (l > 0) {
+ if (base64[*b] < 0)
+ break;
+ n |= base64[*b++];
+ *out++ = n & 0xFF;
+ len++;
+ --l;
+ }
+ if (len+3 >= sizeof(buff)) {
+ archive_strncat(as, (const char *)buff, len);
+ len = 0;
+ out = buff;
+ }
+ }
+ if (len > 0)
+ archive_strncat(as, (const char *)buff, len);
+}
+
+static void
+xml_data(void *userData, const char *s, int len)
+{
+ struct archive_read *a;
+ struct xar *xar;
+
+ a = (struct archive_read *)userData;
+ xar = (struct xar *)(a->format->data);
+
+#if DEBUG
+ {
+ char buff[1024];
+ if (len > sizeof(buff)-1)
+ len = sizeof(buff)-1;
+ memcpy(buff, s, len);
+ buff[len] = 0;
+ fprintf(stderr, "\tlen=%d:\"%s\"\n", len, buff);
+ }
+#endif
+ switch (xar->xmlsts) {
+ case TOC_CHECKSUM_OFFSET:
+ xar->toc_chksum_offset = atol10(s, len);
+ break;
+ case TOC_CHECKSUM_SIZE:
+ xar->toc_chksum_size = atol10(s, len);
+ break;
+ default:
+ break;
+ }
+ if (xar->file == NULL)
+ return;
+
+ switch (xar->xmlsts) {
+ case FILE_NAME:
+ if (xar->file->parent != NULL) {
+ archive_string_concat(&(xar->file->pathname),
+ &(xar->file->parent->pathname));
+ archive_strappend_char(&(xar->file->pathname), '/');
+ }
+ xar->file->has |= HAS_PATHNAME;
+ if (xar->base64text)
+ strappend_base64(&(xar->file->pathname), s, len);
+ else
+ archive_strncat(&(xar->file->pathname), s, len);
+ break;
+ case FILE_LINK:
+ xar->file->has |= HAS_SYMLINK;
+ archive_strncpy(&(xar->file->symlink), s, len);
+ break;
+ case FILE_TYPE:
+ if (strncmp("file", s, len) == 0 ||
+ strncmp("hardlink", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFREG;
+ if (strncmp("directory", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFDIR;
+ if (strncmp("symlink", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFLNK;
+ if (strncmp("character special", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFCHR;
+ if (strncmp("block special", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFBLK;
+ if (strncmp("socket", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFSOCK;
+ if (strncmp("fifo", s, len) == 0)
+ xar->file->mode =
+ (xar->file->mode & ~AE_IFMT) | AE_IFIFO;
+ xar->file->has |= HAS_TYPE;
+ break;
+ case FILE_INODE:
+ xar->file->has |= HAS_INO;
+ xar->file->ino64 = atol10(s, len);
+ break;
+ case FILE_DEVICE_MAJOR:
+ xar->file->has |= HAS_DEVMAJOR;
+ xar->file->devmajor = (dev_t)atol10(s, len);
+ break;
+ case FILE_DEVICE_MINOR:
+ xar->file->has |= HAS_DEVMINOR;
+ xar->file->devminor = (dev_t)atol10(s, len);
+ break;
+ case FILE_DEVICENO:
+ xar->file->has |= HAS_DEV;
+ xar->file->dev = (dev_t)atol10(s, len);
+ break;
+ case FILE_MODE:
+ xar->file->has |= HAS_MODE;
+ xar->file->mode =
+ (xar->file->mode & AE_IFMT) |
+ (atol8(s, len) & ~AE_IFMT);
+ break;
+ case FILE_GROUP:
+ xar->file->has |= HAS_GID;
+ archive_strncpy(&(xar->file->gname), s, len);
+ break;
+ case FILE_GID:
+ xar->file->has |= HAS_GID;
+ xar->file->gid = atol10(s, len);
+ break;
+ case FILE_USER:
+ xar->file->has |= HAS_UID;
+ archive_strncpy(&(xar->file->uname), s, len);
+ break;
+ case FILE_UID:
+ xar->file->has |= HAS_UID;
+ xar->file->uid = atol10(s, len);
+ break;
+ case FILE_CTIME:
+ xar->file->has |= HAS_TIME;
+ xar->file->ctime = parse_time(s, len);
+ break;
+ case FILE_MTIME:
+ xar->file->has |= HAS_TIME;
+ xar->file->mtime = parse_time(s, len);
+ break;
+ case FILE_ATIME:
+ xar->file->has |= HAS_TIME;
+ xar->file->atime = parse_time(s, len);
+ break;
+ case FILE_DATA_LENGTH:
+ xar->file->has |= HAS_DATA;
+ xar->file->length = atol10(s, len);
+ break;
+ case FILE_DATA_OFFSET:
+ xar->file->has |= HAS_DATA;
+ xar->file->offset = atol10(s, len);
+ break;
+ case FILE_DATA_SIZE:
+ xar->file->has |= HAS_DATA;
+ xar->file->size = atol10(s, len);
+ break;
+ case FILE_DATA_A_CHECKSUM:
+ xar->file->a_sum.len = atohex(xar->file->a_sum.val,
+ sizeof(xar->file->a_sum.val), s, len);
+ break;
+ case FILE_DATA_E_CHECKSUM:
+ xar->file->e_sum.len = atohex(xar->file->e_sum.val,
+ sizeof(xar->file->e_sum.val), s, len);
+ break;
+ case FILE_EA_LENGTH:
+ xar->file->has |= HAS_XATTR;
+ xar->xattr->length = atol10(s, len);
+ break;
+ case FILE_EA_OFFSET:
+ xar->file->has |= HAS_XATTR;
+ xar->xattr->offset = atol10(s, len);
+ break;
+ case FILE_EA_SIZE:
+ xar->file->has |= HAS_XATTR;
+ xar->xattr->size = atol10(s, len);
+ break;
+ case FILE_EA_A_CHECKSUM:
+ xar->file->has |= HAS_XATTR;
+ xar->xattr->a_sum.len = atohex(xar->xattr->a_sum.val,
+ sizeof(xar->xattr->a_sum.val), s, len);
+ break;
+ case FILE_EA_E_CHECKSUM:
+ xar->file->has |= HAS_XATTR;
+ xar->xattr->e_sum.len = atohex(xar->xattr->e_sum.val,
+ sizeof(xar->xattr->e_sum.val), s, len);
+ break;
+ case FILE_EA_NAME:
+ xar->file->has |= HAS_XATTR;
+ archive_strncpy(&(xar->xattr->name), s, len);
+ break;
+ case FILE_EA_FSTYPE:
+ xar->file->has |= HAS_XATTR;
+ archive_strncpy(&(xar->xattr->fstype), s, len);
+ break;
+ break;
+ case FILE_ACL_DEFAULT:
+ case FILE_ACL_ACCESS:
+ case FILE_ACL_APPLEEXTENDED:
+ xar->file->has |= HAS_ACL;
+ /* TODO */
+ break;
+ case INIT:
+ case XAR:
+ case TOC:
+ case TOC_CREATION_TIME:
+ case TOC_CHECKSUM:
+ case TOC_CHECKSUM_OFFSET:
+ case TOC_CHECKSUM_SIZE:
+ case TOC_FILE:
+ case FILE_DATA:
+ case FILE_DATA_ENCODING:
+ case FILE_DATA_CONTENT:
+ case FILE_DEVICE:
+ case FILE_EA:
+ case FILE_EA_ENCODING:
+ case FILE_ACL:
+ case FILE_FLAGS:
+ case FILE_FLAGS_USER_NODUMP:
+ case FILE_FLAGS_USER_IMMUTABLE:
+ case FILE_FLAGS_USER_APPEND:
+ case FILE_FLAGS_USER_OPAQUE:
+ case FILE_FLAGS_USER_NOUNLINK:
+ case FILE_FLAGS_SYS_ARCHIVED:
+ case FILE_FLAGS_SYS_IMMUTABLE:
+ case FILE_FLAGS_SYS_APPEND:
+ case FILE_FLAGS_SYS_NOUNLINK:
+ case FILE_FLAGS_SYS_SNAPSHOT:
+ case FILE_EXT2:
+ case FILE_EXT2_SecureDeletion:
+ case FILE_EXT2_Undelete:
+ case FILE_EXT2_Compress:
+ case FILE_EXT2_Synchronous:
+ case FILE_EXT2_Immutable:
+ case FILE_EXT2_AppendOnly:
+ case FILE_EXT2_NoDump:
+ case FILE_EXT2_NoAtime:
+ case FILE_EXT2_CompDirty:
+ case FILE_EXT2_CompBlock:
+ case FILE_EXT2_NoCompBlock:
+ case FILE_EXT2_CompError:
+ case FILE_EXT2_BTree:
+ case FILE_EXT2_HashIndexed:
+ case FILE_EXT2_iMagic:
+ case FILE_EXT2_Journaled:
+ case FILE_EXT2_NoTail:
+ case FILE_EXT2_DirSync:
+ case FILE_EXT2_TopDir:
+ case FILE_EXT2_Reserved:
+ case UNKNOWN:
+ break;
+ }
+}
+
+/*
+ * BSD file flags.
+ */
+static int
+xml_parse_file_flags(struct xar *xar, const char *name)
+{
+ const char *flag = NULL;
+
+ if (strcmp(name, "UserNoDump") == 0) {
+ xar->xmlsts = FILE_FLAGS_USER_NODUMP;
+ flag = "nodump";
+ }
+ else if (strcmp(name, "UserImmutable") == 0) {
+ xar->xmlsts = FILE_FLAGS_USER_IMMUTABLE;
+ flag = "uimmutable";
+ }
+ else if (strcmp(name, "UserAppend") == 0) {
+ xar->xmlsts = FILE_FLAGS_USER_APPEND;
+ flag = "uappend";
+ }
+ else if (strcmp(name, "UserOpaque") == 0) {
+ xar->xmlsts = FILE_FLAGS_USER_OPAQUE;
+ flag = "opaque";
+ }
+ else if (strcmp(name, "UserNoUnlink") == 0) {
+ xar->xmlsts = FILE_FLAGS_USER_NOUNLINK;
+ flag = "nouunlink";
+ }
+ else if (strcmp(name, "SystemArchived") == 0) {
+ xar->xmlsts = FILE_FLAGS_SYS_ARCHIVED;
+ flag = "archived";
+ }
+ else if (strcmp(name, "SystemImmutable") == 0) {
+ xar->xmlsts = FILE_FLAGS_SYS_IMMUTABLE;
+ flag = "simmutable";
+ }
+ else if (strcmp(name, "SystemAppend") == 0) {
+ xar->xmlsts = FILE_FLAGS_SYS_APPEND;
+ flag = "sappend";
+ }
+ else if (strcmp(name, "SystemNoUnlink") == 0) {
+ xar->xmlsts = FILE_FLAGS_SYS_NOUNLINK;
+ flag = "nosunlink";
+ }
+ else if (strcmp(name, "SystemSnapshot") == 0) {
+ xar->xmlsts = FILE_FLAGS_SYS_SNAPSHOT;
+ flag = "snapshot";
+ }
+
+ if (flag == NULL)
+ return (0);
+ xar->file->has |= HAS_FFLAGS;
+ if (archive_strlen(&(xar->file->fflags_text)) > 0)
+ archive_strappend_char(&(xar->file->fflags_text), ',');
+ archive_strcat(&(xar->file->fflags_text), flag);
+ return (1);
+}
+
+/*
+ * Linux file flags.
+ */
+static int
+xml_parse_file_ext2(struct xar *xar, const char *name)
+{
+ const char *flag = NULL;
+
+ if (strcmp(name, "SecureDeletion") == 0) {
+ xar->xmlsts = FILE_EXT2_SecureDeletion;
+ flag = "securedeletion";
+ }
+ else if (strcmp(name, "Undelete") == 0) {
+ xar->xmlsts = FILE_EXT2_Undelete;
+ flag = "nouunlink";
+ }
+ else if (strcmp(name, "Compress") == 0) {
+ xar->xmlsts = FILE_EXT2_Compress;
+ flag = "compress";
+ }
+ else if (strcmp(name, "Synchronous") == 0) {
+ xar->xmlsts = FILE_EXT2_Synchronous;
+ flag = "sync";
+ }
+ else if (strcmp(name, "Immutable") == 0) {
+ xar->xmlsts = FILE_EXT2_Immutable;
+ flag = "simmutable";
+ }
+ else if (strcmp(name, "AppendOnly") == 0) {
+ xar->xmlsts = FILE_EXT2_AppendOnly;
+ flag = "sappend";
+ }
+ else if (strcmp(name, "NoDump") == 0) {
+ xar->xmlsts = FILE_EXT2_NoDump;
+ flag = "nodump";
+ }
+ else if (strcmp(name, "NoAtime") == 0) {
+ xar->xmlsts = FILE_EXT2_NoAtime;
+ flag = "noatime";
+ }
+ else if (strcmp(name, "CompDirty") == 0) {
+ xar->xmlsts = FILE_EXT2_CompDirty;
+ flag = "compdirty";
+ }
+ else if (strcmp(name, "CompBlock") == 0) {
+ xar->xmlsts = FILE_EXT2_CompBlock;
+ flag = "comprblk";
+ }
+ else if (strcmp(name, "NoCompBlock") == 0) {
+ xar->xmlsts = FILE_EXT2_NoCompBlock;
+ flag = "nocomprblk";
+ }
+ else if (strcmp(name, "CompError") == 0) {
+ xar->xmlsts = FILE_EXT2_CompError;
+ flag = "comperr";
+ }
+ else if (strcmp(name, "BTree") == 0) {
+ xar->xmlsts = FILE_EXT2_BTree;
+ flag = "btree";
+ }
+ else if (strcmp(name, "HashIndexed") == 0) {
+ xar->xmlsts = FILE_EXT2_HashIndexed;
+ flag = "hashidx";
+ }
+ else if (strcmp(name, "iMagic") == 0) {
+ xar->xmlsts = FILE_EXT2_iMagic;
+ flag = "imagic";
+ }
+ else if (strcmp(name, "Journaled") == 0) {
+ xar->xmlsts = FILE_EXT2_Journaled;
+ flag = "journal";
+ }
+ else if (strcmp(name, "NoTail") == 0) {
+ xar->xmlsts = FILE_EXT2_NoTail;
+ flag = "notail";
+ }
+ else if (strcmp(name, "DirSync") == 0) {
+ xar->xmlsts = FILE_EXT2_DirSync;
+ flag = "dirsync";
+ }
+ else if (strcmp(name, "TopDir") == 0) {
+ xar->xmlsts = FILE_EXT2_TopDir;
+ flag = "topdir";
+ }
+ else if (strcmp(name, "Reserved") == 0) {
+ xar->xmlsts = FILE_EXT2_Reserved;
+ flag = "reserved";
+ }
+
+ if (flag == NULL)
+ return (0);
+ if (archive_strlen(&(xar->file->fflags_text)) > 0)
+ archive_strappend_char(&(xar->file->fflags_text), ',');
+ archive_strcat(&(xar->file->fflags_text), flag);
+ return (1);
+}
+
+#ifdef HAVE_LIBXML_XMLREADER_H
+
+static int
+xml2_xmlattr_setup(struct xmlattr_list *list, xmlTextReaderPtr reader)
+{
+ struct xmlattr *attr;
+ int r;
+
+ list->first = NULL;
+ list->last = &(list->first);
+ r = xmlTextReaderMoveToFirstAttribute(reader);
+ while (r == 1) {
+ attr = malloc(sizeof*(attr));
+ if (attr == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->name = strdup(
+ (const char *)xmlTextReaderConstLocalName(reader));
+ if (attr->name == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->value = strdup(
+ (const char *)xmlTextReaderConstValue(reader));
+ if (attr->value == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->next = NULL;
+ *list->last = attr;
+ list->last = &(attr->next);
+ r = xmlTextReaderMoveToNextAttribute(reader);
+ }
+ return (r);
+}
+
+static int
+xml2_read_cb(void *context, char *buffer, int len)
+{
+ struct archive_read *a;
+ struct xar *xar;
+ const void *d;
+ size_t outbytes;
+ size_t used;
+ int r;
+
+ a = (struct archive_read *)context;
+ xar = (struct xar *)(a->format->data);
+
+ if (xar->toc_remaining <= 0)
+ return (0);
+ d = buffer;
+ outbytes = len;
+ r = rd_contents(a, &d, &outbytes, &used, xar->toc_remaining);
+ if (r != ARCHIVE_OK)
+ return (r);
+ __archive_read_consume(a, used);
+ xar->toc_remaining -= used;
+ xar->offset += used;
+ xar->toc_total += outbytes;
+ PRINT_TOC(buffer, len);
+
+ return ((int)outbytes);
+}
+
+static int
+xml2_close_cb(void *context)
+{
+
+ (void)context; /* UNUSED */
+ return (0);
+}
+
+static void
+xml2_error_hdr(void *arg, const char *msg, xmlParserSeverities severity,
+ xmlTextReaderLocatorPtr locator)
+{
+ struct archive_read *a;
+
+ (void)locator; /* UNUSED */
+ a = (struct archive_read *)arg;
+ switch (severity) {
+ case XML_PARSER_SEVERITY_VALIDITY_WARNING:
+ case XML_PARSER_SEVERITY_WARNING:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "XML Parsing error: %s", msg);
+ break;
+ case XML_PARSER_SEVERITY_VALIDITY_ERROR:
+ case XML_PARSER_SEVERITY_ERROR:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "XML Parsing error: %s", msg);
+ break;
+ }
+}
+
+static int
+xml2_read_toc(struct archive_read *a)
+{
+ xmlTextReaderPtr reader;
+ struct xmlattr_list list;
+ int r;
+
+ reader = xmlReaderForIO(xml2_read_cb, xml2_close_cb, a, NULL, NULL, 0);
+ if (reader == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Couldn't allocate memory for xml parser");
+ return (ARCHIVE_FATAL);
+ }
+ xmlTextReaderSetErrorHandler(reader, xml2_error_hdr, a);
+
+ while ((r = xmlTextReaderRead(reader)) == 1) {
+ const char *name, *value;
+ int type, empty;
+
+ type = xmlTextReaderNodeType(reader);
+ name = (const char *)xmlTextReaderConstLocalName(reader);
+ switch (type) {
+ case XML_READER_TYPE_ELEMENT:
+ empty = xmlTextReaderIsEmptyElement(reader);
+ r = xml2_xmlattr_setup(&list, reader);
+ if (r == 0) {
+ xml_start(a, name, &list);
+ xmlattr_cleanup(&list);
+ if (empty)
+ xml_end(a, name);
+ }
+ break;
+ case XML_READER_TYPE_END_ELEMENT:
+ xml_end(a, name);
+ break;
+ case XML_READER_TYPE_TEXT:
+ value = (const char *)xmlTextReaderConstValue(reader);
+ xml_data(a, value, strlen(value));
+ break;
+ case XML_READER_TYPE_SIGNIFICANT_WHITESPACE:
+ default:
+ break;
+ }
+ if (r < 0)
+ break;
+ }
+ xmlFreeTextReader(reader);
+ xmlCleanupParser();
+
+ return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
+}
+
+#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
+
+static void
+expat_xmlattr_setup(struct xmlattr_list *list, const XML_Char **atts)
+{
+ struct xmlattr *attr;
+
+ list->first = NULL;
+ list->last = &(list->first);
+ if (atts == NULL)
+ return;
+ while (atts[0] != NULL && atts[1] != NULL) {
+ attr = malloc(sizeof*(attr));
+ if (attr == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->name = strdup(atts[0]);
+ if (attr->name == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->value = strdup(atts[1]);
+ if (attr->value == NULL)
+ __archive_errx(1, "Out of memory");
+ attr->next = NULL;
+ *list->last = attr;
+ list->last = &(attr->next);
+ atts += 2;
+ }
+}
+
+static void
+expat_start_cb(void *userData, const XML_Char *name, const XML_Char **atts)
+{
+ struct xmlattr_list list;
+
+ expat_xmlattr_setup(&list, atts);
+ xml_start(userData, (const char *)name, &list);
+ xmlattr_cleanup(&list);
+}
+
+static void
+expat_end_cb(void *userData, const XML_Char *name)
+{
+ xml_end(userData, (const char *)name);
+}
+
+static void
+expat_data_cb(void *userData, const XML_Char *s, int len)
+{
+ xml_data(userData, s, len);
+}
+
+static int
+expat_read_toc(struct archive_read *a)
+{
+ struct xar *xar;
+ XML_Parser parser;
+
+ xar = (struct xar *)(a->format->data);
+
+ /* Initialize XML Parser library. */
+ parser = XML_ParserCreate(NULL);
+ if (parser == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Couldn't allocate memory for xml parser");
+ return (ARCHIVE_FATAL);
+ }
+ XML_SetUserData(parser, a);
+ XML_SetElementHandler(parser, expat_start_cb, expat_end_cb);
+ XML_SetCharacterDataHandler(parser, expat_data_cb);
+ xar->xmlsts = INIT;
+
+ while (xar->toc_remaining) {
+ enum XML_Status xr;
+ const void *d;
+ size_t outbytes;
+ size_t used;
+ int r;
+
+ d = NULL;
+ r = rd_contents(a, &d, &outbytes, &used, xar->toc_remaining);
+ if (r != ARCHIVE_OK)
+ return (r);
+ __archive_read_consume(a, used);
+ xar->toc_remaining -= used;
+ xar->offset += used;
+ xar->toc_total += outbytes;
+ PRINT_TOC(d, outbytes);
+
+ xr = XML_Parse(parser, d, outbytes, xar->toc_remaining == 0);
+ if (xr == XML_STATUS_ERROR) {
+ XML_ParserFree(parser);
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "XML Parsing failed");
+ return (ARCHIVE_FATAL);
+ }
+ }
+ XML_ParserFree(parser);
+ return (ARCHIVE_OK);
+}
+#endif /* defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H) */
+
+#endif /* Support xar format */
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
index f04f69bb205..5a85e71125a 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.24 2008/06/15 05:15:53 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_zip.c 201102 2009-12-28 03:11:36Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -44,6 +44,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.24
#include "archive_read_private.h"
#include "archive_endian.h"
+#ifndef HAVE_ZLIB_H
+#include "archive_crc32.h"
+#endif
+
struct zip {
/* entry_bytes_remaining is the number of bytes we expect. */
int64_t entry_bytes_remaining;
@@ -53,6 +57,9 @@ struct zip {
int64_t entry_compressed_bytes_read;
int64_t entry_uncompressed_bytes_read;
+ /* Running CRC32 of the decompressed data */
+ unsigned long entry_crc32;
+
unsigned version;
unsigned system;
unsigned flags;
@@ -68,9 +75,8 @@ struct zip {
/* Flags to mark progress of decompression. */
char decompress_init;
char end_of_entry;
- char end_of_entry_cleanup;
- long crc32;
+ unsigned long crc32;
ssize_t filename_length;
ssize_t extra_length;
int64_t uncompressed_size;
@@ -147,7 +153,9 @@ archive_read_support_format_zip(struct archive *_a)
r = __archive_read_register_format(a,
zip,
+ "zip",
archive_read_format_zip_bid,
+ NULL,
archive_read_format_zip_read_header,
archive_read_format_zip_read_data,
archive_read_format_zip_read_data_skip,
@@ -164,9 +172,9 @@ archive_read_format_zip_bid(struct archive_read *a)
{
const char *p;
const void *buff;
- size_t bytes_avail;
+ ssize_t bytes_avail, offset;
- if ((p = __archive_read_ahead(a, 4)) == NULL)
+ if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
return (-1);
/*
@@ -186,42 +194,37 @@ archive_read_format_zip_bid(struct archive_read *a)
/*
* Attempt to handle self-extracting archives
* by noting a PE header and searching forward
- * up to 64k for a 'PK\003\004' marker.
+ * up to 128k for a 'PK\003\004' marker.
*/
if (p[0] == 'M' && p[1] == 'Z') {
/*
- * TODO: Additional checks that this really is a PE
- * file before we invoke the 128k lookahead below.
- * No point in allocating a bigger lookahead buffer
- * if we don't need to.
- */
- /*
- * TODO: Of course, the compression layer lookahead
- * buffers aren't dynamically sized yet; they should be.
+ * TODO: Optimize by initializing 'offset' to an
+ * estimate of the likely start of the archive data
+ * based on values in the PE header. Note that we
+ * don't need to be exact, but we mustn't skip too
+ * far. The search below will compensate if we
+ * undershoot.
*/
- bytes_avail = (a->decompressor->read_ahead)(a, &buff, 128*1024);
- p = (const char *)buff;
-
- /*
- * TODO: Optimize by jumping forward based on values
- * in the PE header. Note that we don't need to be
- * exact, but we mustn't skip too far. The search
- * below will compensate if we undershoot. Skipping
- * will also reduce the chance of false positives
- * (which is not really all that high to begin with,
- * so maybe skipping isn't really necessary).
- */
-
- while (p < bytes_avail + (const char *)buff) {
- if (p[0] == 'P' && p[1] == 'K' /* "PK" signature */
- && p[2] == 3 && p[3] == 4 /* File entry */
- && p[8] == 8 /* compression == deflate */
- && p[9] == 0 /* High byte of compression */
- )
- {
- return (30);
+ offset = 0;
+ while (offset < 124000) {
+ /* Get 4k of data beyond where we stopped. */
+ buff = __archive_read_ahead(a, offset + 4096,
+ &bytes_avail);
+ if (bytes_avail < offset + 1)
+ break;
+ p = (const char *)buff + offset;
+ while (p + 9 < (const char *)buff + bytes_avail) {
+ if (p[0] == 'P' && p[1] == 'K' /* signature */
+ && p[2] == 3 && p[3] == 4 /* File entry */
+ && p[8] == 8 /* compression == deflate */
+ && p[9] == 0 /* High byte of compression */
+ )
+ {
+ return (30);
+ }
+ ++p;
}
- ++p;
+ offset = p - (const char *)buff;
}
}
@@ -238,7 +241,8 @@ skip_sfx(struct archive_read *a)
{
const void *h;
const char *p, *q;
- size_t skip, bytes;
+ size_t skip;
+ ssize_t bytes;
/*
* TODO: We should be able to skip forward by a bunch
@@ -248,7 +252,7 @@ skip_sfx(struct archive_read *a)
* reduce the chance of a false positive.
*/
for (;;) {
- bytes = (a->decompressor->read_ahead)(a, &h, 4096);
+ h = __archive_read_ahead(a, 4, &bytes);
if (bytes < 4)
return (ARCHIVE_FATAL);
p = h;
@@ -264,7 +268,7 @@ skip_sfx(struct archive_read *a)
/* TODO: Additional verification here. */
if (memcmp("PK\003\004", p, 4) == 0) {
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
return (ARCHIVE_OK);
}
p += 4;
@@ -276,7 +280,7 @@ skip_sfx(struct archive_read *a)
}
}
skip = p - (const char *)h;
- (a->decompressor->consume)(a, skip);
+ __archive_read_consume(a, skip);
}
}
@@ -296,10 +300,10 @@ archive_read_format_zip_read_header(struct archive_read *a,
zip = (struct zip *)(a->format->data);
zip->decompress_init = 0;
zip->end_of_entry = 0;
- zip->end_of_entry_cleanup = 0;
zip->entry_uncompressed_bytes_read = 0;
zip->entry_compressed_bytes_read = 0;
- if ((h = __archive_read_ahead(a, 4)) == NULL)
+ zip->entry_crc32 = crc32(0, NULL, 0);
+ if ((h = __archive_read_ahead(a, 4, NULL)) == NULL)
return (ARCHIVE_FATAL);
signature = (const char *)h;
@@ -308,7 +312,7 @@ archive_read_format_zip_read_header(struct archive_read *a,
r = skip_sfx(a);
if (r < ARCHIVE_WARN)
return (r);
- if ((h = __archive_read_ahead(a, 4)) == NULL)
+ if ((h = __archive_read_ahead(a, 4, NULL)) == NULL)
return (ARCHIVE_FATAL);
signature = (const char *)h;
}
@@ -325,8 +329,8 @@ archive_read_format_zip_read_header(struct archive_read *a,
* skip the PK00; the first real file header should follow.
*/
if (signature[2] == '0' && signature[3] == '0') {
- (a->decompressor->consume)(a, 4);
- if ((h = __archive_read_ahead(a, 4)) == NULL)
+ __archive_read_consume(a, 4);
+ if ((h = __archive_read_ahead(a, 4, NULL)) == NULL)
return (ARCHIVE_FATAL);
signature = (const char *)h;
if (signature[0] != 'P' || signature[1] != 'K') {
@@ -370,14 +374,14 @@ archive_read_format_zip_read_header(struct archive_read *a,
return (ARCHIVE_FATAL);
}
-int
+static int
zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
struct zip *zip)
{
const struct zip_file_header *p;
const void *h;
- if ((p = __archive_read_ahead(a, sizeof *p)) == NULL) {
+ if ((p = __archive_read_ahead(a, sizeof *p, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
@@ -404,11 +408,11 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->uncompressed_size = archive_le32dec(p->uncompressed_size);
zip->compressed_size = archive_le32dec(p->compressed_size);
- (a->decompressor->consume)(a, sizeof(struct zip_file_header));
+ __archive_read_consume(a, sizeof(struct zip_file_header));
/* Read the filename. */
- if ((h = __archive_read_ahead(a, zip->filename_length)) == NULL) {
+ if ((h = __archive_read_ahead(a, zip->filename_length, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
@@ -416,7 +420,7 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
if (archive_string_ensure(&zip->pathname, zip->filename_length) == NULL)
__archive_errx(1, "Out of memory");
archive_strncpy(&zip->pathname, h, zip->filename_length);
- (a->decompressor->consume)(a, zip->filename_length);
+ __archive_read_consume(a, zip->filename_length);
archive_entry_set_pathname(entry, zip->pathname.s);
if (zip->pathname.s[archive_strlen(&zip->pathname) - 1] == '/')
@@ -425,13 +429,13 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->mode = AE_IFREG | 0777;
/* Read the extra data. */
- if ((h = __archive_read_ahead(a, zip->extra_length)) == NULL) {
+ if ((h = __archive_read_ahead(a, zip->extra_length, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
}
process_extra(h, zip);
- (a->decompressor->consume)(a, zip->extra_length);
+ __archive_read_consume(a, zip->extra_length);
/* Populate some additional entry fields: */
archive_entry_set_mode(entry, zip->mode);
@@ -440,7 +444,9 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
archive_entry_set_mtime(entry, zip->mtime, 0);
archive_entry_set_ctime(entry, zip->ctime, 0);
archive_entry_set_atime(entry, zip->atime, 0);
- archive_entry_set_size(entry, zip->uncompressed_size);
+ /* Set the size only if it's meaningful. */
+ if (0 == (zip->flags & ZIP_LENGTH_AT_END))
+ archive_entry_set_size(entry, zip->uncompressed_size);
zip->entry_bytes_remaining = zip->compressed_size;
zip->entry_offset = 0;
@@ -494,46 +500,6 @@ archive_read_format_zip_read_data(struct archive_read *a,
* ARCHIVE_EOF this time.
*/
if (zip->end_of_entry) {
- if (!zip->end_of_entry_cleanup) {
- if (zip->flags & ZIP_LENGTH_AT_END) {
- const char *p;
-
- if ((p = __archive_read_ahead(a, 16)) == NULL) {
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Truncated ZIP end-of-file record");
- return (ARCHIVE_FATAL);
- }
- zip->crc32 = archive_le32dec(p + 4);
- zip->compressed_size = archive_le32dec(p + 8);
- zip->uncompressed_size = archive_le32dec(p + 12);
- (a->decompressor->consume)(a, 16);
- }
-
- /* Check file size, CRC against these values. */
- if (zip->compressed_size != zip->entry_compressed_bytes_read) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "ZIP compressed data is wrong size");
- return (ARCHIVE_WARN);
- }
- /* Size field only stores the lower 32 bits of the actual size. */
- if ((zip->uncompressed_size & UINT32_MAX)
- != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "ZIP uncompressed data is wrong size");
- return (ARCHIVE_WARN);
- }
-/* TODO: Compute CRC. */
-/*
- if (zip->crc32 != zip->entry_crc32_calculated) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "ZIP data CRC error");
- return (ARCHIVE_WARN);
- }
-*/
- /* End-of-entry cleanup done. */
- zip->end_of_entry_cleanup = 1;
- }
*offset = zip->entry_uncompressed_bytes_read;
*size = 0;
*buff = NULL;
@@ -570,7 +536,53 @@ archive_read_format_zip_read_data(struct archive_read *a,
}
break;
}
- return (r);
+ if (r != ARCHIVE_OK)
+ return (r);
+ /* Update checksum */
+ if (*size)
+ zip->entry_crc32 = crc32(zip->entry_crc32, *buff, *size);
+ /* If we hit the end, swallow any end-of-data marker. */
+ if (zip->end_of_entry) {
+ if (zip->flags & ZIP_LENGTH_AT_END) {
+ const char *p;
+
+ if ((p = __archive_read_ahead(a, 16, NULL)) == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated ZIP end-of-file record");
+ return (ARCHIVE_FATAL);
+ }
+ zip->crc32 = archive_le32dec(p + 4);
+ zip->compressed_size = archive_le32dec(p + 8);
+ zip->uncompressed_size = archive_le32dec(p + 12);
+ __archive_read_consume(a, 16);
+ }
+ /* Check file size, CRC against these values. */
+ if (zip->compressed_size != zip->entry_compressed_bytes_read) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "ZIP compressed data is wrong size");
+ return (ARCHIVE_WARN);
+ }
+ /* Size field only stores the lower 32 bits of the actual size. */
+ if ((zip->uncompressed_size & UINT32_MAX)
+ != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "ZIP uncompressed data is wrong size");
+ return (ARCHIVE_WARN);
+ }
+ /* Check computed CRC against header */
+ if (zip->crc32 != zip->entry_crc32) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "ZIP bad CRC: 0x%lx should be 0x%lx",
+ zip->entry_crc32, zip->crc32);
+ return (ARCHIVE_WARN);
+ }
+ }
+
+ /* Return EOF immediately if this is a non-regular file. */
+ if (AE_IFREG != (zip->mode & AE_IFMT))
+ return (ARCHIVE_EOF);
+ return (ARCHIVE_OK);
}
/*
@@ -608,7 +620,7 @@ zip_read_data_none(struct archive_read *a, const void **buff,
* available bytes; asking for more than that forces the
* decompressor to combine reads by copying data.
*/
- bytes_avail = (a->decompressor->read_ahead)(a, buff, 1);
+ *buff = __archive_read_ahead(a, 1, &bytes_avail);
if (bytes_avail <= 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file data");
@@ -616,7 +628,7 @@ zip_read_data_none(struct archive_read *a, const void **buff,
}
if (bytes_avail > zip->entry_bytes_remaining)
bytes_avail = zip->entry_bytes_remaining;
- (a->decompressor->consume)(a, bytes_avail);
+ __archive_read_consume(a, bytes_avail);
*size = bytes_avail;
*offset = zip->entry_offset;
zip->entry_offset += *size;
@@ -674,7 +686,7 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
* available bytes; asking for more than that forces the
* decompressor to combine reads by copying data.
*/
- bytes_avail = (a->decompressor->read_ahead)(a, &compressed_buff, 1);
+ compressed_buff = __archive_read_ahead(a, 1, &bytes_avail);
if (bytes_avail <= 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file body");
@@ -713,7 +725,7 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
/* Consume as much as the compressor actually used. */
bytes_avail = zip->stream.total_in;
- (a->decompressor->consume)(a, bytes_avail);
+ __archive_read_consume(a, bytes_avail);
zip->entry_bytes_remaining -= bytes_avail;
zip->entry_compressed_bytes_read += bytes_avail;
@@ -748,7 +760,7 @@ archive_read_format_zip_read_data_skip(struct archive_read *a)
zip = (struct zip *)(a->format->data);
/* If we've already read to end of data, we're done. */
- if (zip->end_of_entry_cleanup)
+ if (zip->end_of_entry)
return (ARCHIVE_OK);
/*
@@ -770,12 +782,12 @@ archive_read_format_zip_read_data_skip(struct archive_read *a)
* If the length is at the beginning, we can skip the
* compressed data much more quickly.
*/
- bytes_skipped = (a->decompressor->skip)(a, zip->entry_bytes_remaining);
+ bytes_skipped = __archive_read_skip(a, zip->entry_bytes_remaining);
if (bytes_skipped < 0)
return (ARCHIVE_FATAL);
/* This entry is finished and done. */
- zip->end_of_entry_cleanup = zip->end_of_entry = 1;
+ zip->end_of_entry = 1;
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_string.c b/archivers/libarchive/files/libarchive/archive_string.c
index 21fe5711516..4e57d62e138 100644
--- a/archivers/libarchive/files/libarchive/archive_string.c
+++ b/archivers/libarchive/files/libarchive/archive_string.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.16 2008/06/15 11:28:56 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_string.c 201095 2009-12-28 02:33:22Z kientzle $");
/*
* Basic resizable string support, to simplify manipulating arbitrary-sized
@@ -40,6 +40,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.16 2008/06/15 11:28:
#ifdef HAVE_WCHAR_H
#include <wchar.h>
#endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
#include "archive_private.h"
#include "archive_string.h"
@@ -70,6 +73,18 @@ __archive_string_copy(struct archive_string *dest, struct archive_string *src)
}
void
+__archive_string_concat(struct archive_string *dest, struct archive_string *src)
+{
+ if (src->length > 0) {
+ if (__archive_string_ensure(dest, dest->length + src->length + 1) == NULL)
+ __archive_errx(1, "Out of memory");
+ memcpy(dest->s + dest->length, src->s, src->length);
+ dest->length += src->length;
+ dest->s[dest->length] = 0;
+ }
+}
+
+void
__archive_string_free(struct archive_string *as)
{
as->length = 0;
@@ -100,11 +115,11 @@ __archive_string_ensure(struct archive_string *as, size_t s)
as->buffer_length = 32;
else if (as->buffer_length < 8192)
/* Buffers under 8k are doubled for speed. */
- as->buffer_length *= 2;
+ as->buffer_length += as->buffer_length;
else {
/* Buffers 8k and over grow by at least 25% each time. */
size_t old_length = as->buffer_length;
- as->buffer_length = (as->buffer_length * 5) / 4;
+ as->buffer_length += as->buffer_length / 4;
/* Be safe: If size wraps, release buffer and return NULL. */
if (as->buffer_length < old_length) {
free(as->s);
@@ -127,10 +142,12 @@ __archive_string_ensure(struct archive_string *as, size_t s)
}
struct archive_string *
-__archive_strncat(struct archive_string *as, const char *p, size_t n)
+__archive_strncat(struct archive_string *as, const void *_p, size_t n)
{
size_t s;
- const char *pp;
+ const char *p, *pp;
+
+ p = (const char *)_p;
/* Like strlen(p), except won't examine positions beyond p[n]. */
s = 0;
@@ -148,70 +165,18 @@ __archive_strappend_char(struct archive_string *as, char c)
return (__archive_string_append(as, &c, 1));
}
-struct archive_string *
-__archive_strappend_int(struct archive_string *as, int d, int base)
-{
- static const char *digits = "0123456789abcdef";
-
- if (d < 0) {
- __archive_strappend_char(as, '-');
- d = -d;
- }
- if (d >= base)
- __archive_strappend_int(as, d/base, base);
- __archive_strappend_char(as, digits[d % base]);
- return (as);
-}
-
/*
- * Home-grown wctomb for UTF-8.
+ * Translates a wide character string into UTF-8 and appends
+ * to the archive_string. Note: returns NULL if conversion fails,
+ * but still leaves a best-effort conversion in the argument as.
*/
-static int
-my_wctomb_utf8(char *p, wchar_t wc)
-{
- if (p == NULL)
- /* UTF-8 doesn't use shift states. */
- return (0);
- if (wc <= 0x7f) {
- p[0] = (char)wc;
- return (1);
- }
- if (wc <= 0x7ff) {
- p[0] = 0xc0 | ((wc >> 6) & 0x1f);
- p[1] = 0x80 | (wc & 0x3f);
- return (2);
- }
- if (wc <= 0xffff) {
- p[0] = 0xe0 | ((wc >> 12) & 0x0f);
- p[1] = 0x80 | ((wc >> 6) & 0x3f);
- p[2] = 0x80 | (wc & 0x3f);
- return (3);
- }
- if (wc <= 0x1fffff) {
- p[0] = 0xf0 | ((wc >> 18) & 0x07);
- p[1] = 0x80 | ((wc >> 12) & 0x3f);
- p[2] = 0x80 | ((wc >> 6) & 0x3f);
- p[3] = 0x80 | (wc & 0x3f);
- return (4);
- }
- /* Unicode has no codes larger than 0x1fffff. */
- /*
- * Awkward point: UTF-8 <-> wchar_t conversions
- * can actually fail.
- */
- return (-1);
-}
-
-static int
-my_wcstombs(struct archive_string *as, const wchar_t *w,
- int (*func)(char *, wchar_t))
+struct archive_string *
+__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w)
{
- int n;
char *p;
+ unsigned wc;
char buff[256];
-
- /* Clear the shift state before starting. */
- (*func)(NULL, L'\0');
+ struct archive_string *return_val = as;
/*
* Convert one wide char at a time into 'buff', whenever that
@@ -226,67 +191,50 @@ my_wcstombs(struct archive_string *as, const wchar_t *w,
archive_strcat(as, buff);
p = buff;
}
- n = (*func)(p, *w++);
- if (n == -1)
- return (-1);
- p += n;
+ wc = *w++;
+ /* If this is a surrogate pair, assemble the full code point.*/
+ /* Note: wc must not be wchar_t here, because the full code
+ * point can be more than 16 bits! */
+ if (wc >= 0xD800 && wc <= 0xDBff
+ && *w >= 0xDC00 && *w <= 0xDFFF) {
+ wc -= 0xD800;
+ wc *= 0x400;
+ wc += (*w - 0xDC00);
+ wc += 0x10000;
+ ++w;
+ }
+ /* Translate code point to UTF8 */
+ if (wc <= 0x7f) {
+ *p++ = (char)wc;
+ } else if (wc <= 0x7ff) {
+ *p++ = 0xc0 | ((wc >> 6) & 0x1f);
+ *p++ = 0x80 | (wc & 0x3f);
+ } else if (wc <= 0xffff) {
+ *p++ = 0xe0 | ((wc >> 12) & 0x0f);
+ *p++ = 0x80 | ((wc >> 6) & 0x3f);
+ *p++ = 0x80 | (wc & 0x3f);
+ } else if (wc <= 0x1fffff) {
+ *p++ = 0xf0 | ((wc >> 18) & 0x07);
+ *p++ = 0x80 | ((wc >> 12) & 0x3f);
+ *p++ = 0x80 | ((wc >> 6) & 0x3f);
+ *p++ = 0x80 | (wc & 0x3f);
+ } else {
+ /* Unicode has no codes larger than 0x1fffff. */
+ /* TODO: use \uXXXX escape here instead of ? */
+ *p++ = '?';
+ return_val = NULL;
+ }
}
*p = '\0';
archive_strcat(as, buff);
- return (0);
+ return (return_val);
}
-/*
- * Translates a wide character string into UTF-8 and appends
- * to the archive_string. Note: returns NULL if conversion fails.
- */
-struct archive_string *
-__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w)
-{
- if (my_wcstombs(as, w, my_wctomb_utf8))
- return (NULL);
- return (as);
-}
-
-/*
- * Translates a wide character string into current locale character set
- * and appends to the archive_string. Note: returns NULL if conversion
- * fails.
- */
-struct archive_string *
-__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w)
-{
-#if HAVE_WCTOMB
- if (my_wcstombs(as, w, wctomb))
- return (NULL);
-#else
- /* TODO: Can we do better than this? Are there platforms
- * that have locale support but don't have wctomb()? */
- if (my_wcstombs(as, w, my_wctomb_utf8))
- return (NULL);
-#endif
- return (as);
-}
-
-
-/*
- * Home-grown mbtowc for UTF-8. Some systems lack UTF-8
- * (or even lack mbtowc()) and we need UTF-8 support for pax
- * format. So please don't replace this with a call to the
- * standard mbtowc() function!
- */
static int
-my_mbtowc_utf8(wchar_t *pwc, const char *s, size_t n)
+utf8_to_unicode(int *pwc, const char *s, size_t n)
{
int ch;
- /* Standard behavior: a NULL value for 's' just resets shift state. */
- if (s == NULL)
- return (0);
- /* If length argument is zero, don't look at the first character. */
- if (n <= 0)
- return (-1);
-
/*
* Decode 1-4 bytes depending on the value of the first byte.
*/
@@ -332,34 +280,174 @@ my_mbtowc_utf8(wchar_t *pwc, const char *s, size_t n)
}
/*
- * Return a wide-character string by converting this archive_string
- * from UTF-8.
+ * Return a wide-character Unicode string by converting this archive_string
+ * from UTF-8. We assume that systems with 16-bit wchar_t always use
+ * UTF16 and systems with 32-bit wchar_t can accept UCS4.
*/
wchar_t *
__archive_string_utf8_w(struct archive_string *as)
{
wchar_t *ws, *dest;
+ int wc, wc2;/* Must be large enough for a 21-bit Unicode code point. */
const char *src;
int n;
- int err;
ws = (wchar_t *)malloc((as->length + 1) * sizeof(wchar_t));
if (ws == NULL)
__archive_errx(1, "Out of memory");
- err = 0;
dest = ws;
src = as->s;
while (*src != '\0') {
- n = my_mbtowc_utf8(dest, src, 8);
+ n = utf8_to_unicode(&wc, src, 8);
if (n == 0)
break;
if (n < 0) {
free(ws);
return (NULL);
}
- dest++;
src += n;
+ if (wc >= 0xDC00 && wc <= 0xDBFF) {
+ /* This is a leading surrogate; some idiot
+ * has translated UTF16 to UTF8 without combining
+ * surrogates; rebuild the full code point before
+ * continuing. */
+ n = utf8_to_unicode(&wc2, src, 8);
+ if (n < 0) {
+ free(ws);
+ return (NULL);
+ }
+ if (n == 0) /* Ignore the leading surrogate */
+ break;
+ if (wc2 < 0xDC00 || wc2 > 0xDFFF) {
+ /* If the second character isn't a
+ * trailing surrogate, then someone
+ * has really screwed up and this is
+ * invalid. */
+ free(ws);
+ return (NULL);
+ } else {
+ src += n;
+ wc -= 0xD800;
+ wc *= 0x400;
+ wc += wc2 - 0xDC00;
+ wc += 0x10000;
+ }
+ }
+ if ((sizeof(wchar_t) < 4) && (wc > 0xffff)) {
+ /* We have a code point that won't fit into a
+ * wchar_t; convert it to a surrogate pair. */
+ wc -= 0x10000;
+ *dest++ = ((wc >> 10) & 0x3ff) + 0xD800;
+ *dest++ = (wc & 0x3ff) + 0xDC00;
+ } else
+ *dest++ = wc;
}
- *dest++ = L'\0';
+ *dest = L'\0';
return (ws);
}
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+/*
+ * Translates a wide character string into current locale character set
+ * and appends to the archive_string. Note: returns NULL if conversion
+ * fails.
+ *
+ * Win32 builds use WideCharToMultiByte from the Windows API.
+ * (Maybe Cygwin should too? WideCharToMultiByte will know a
+ * lot more about local character encodings than the wcrtomb()
+ * wrapper is going to know.)
+ */
+struct archive_string *
+__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w)
+{
+ char *p;
+ int l, wl;
+ BOOL useDefaultChar = FALSE;
+
+ wl = (int)wcslen(w);
+ l = wl * 4 + 4;
+ p = malloc(l);
+ if (p == NULL)
+ __archive_errx(1, "Out of memory");
+ /* To check a useDefaultChar is to simulate error handling of
+ * the my_wcstombs() which is running on non Windows system with
+ * wctomb().
+ * And to set NULL for last argument is necessary when a codepage
+ * is not CP_ACP(current locale).
+ */
+ l = WideCharToMultiByte(CP_ACP, 0, w, wl, p, l, NULL, &useDefaultChar);
+ if (l == 0) {
+ free(p);
+ return (NULL);
+ }
+ __archive_string_append(as, p, l);
+ free(p);
+ return (as);
+}
+
+#else
+
+/*
+ * Translates a wide character string into current locale character set
+ * and appends to the archive_string. Note: returns NULL if conversion
+ * fails.
+ *
+ * Non-Windows uses ISO C wcrtomb() or wctomb() to perform the conversion
+ * one character at a time. If a non-Windows platform doesn't have
+ * either of these, fall back to the built-in UTF8 conversion.
+ */
+struct archive_string *
+__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w)
+{
+#if !defined(HAVE_WCTOMB) && !defined(HAVE_WCRTOMB)
+ /* If there's no built-in locale support, fall back to UTF8 always. */
+ return __archive_strappend_w_utf8(as, w);
+#else
+ /* We cannot use the standard wcstombs() here because it
+ * cannot tell us how big the output buffer should be. So
+ * I've built a loop around wcrtomb() or wctomb() that
+ * converts a character at a time and resizes the string as
+ * needed. We prefer wcrtomb() when it's available because
+ * it's thread-safe. */
+ int n;
+ char *p;
+ char buff[256];
+#if HAVE_WCRTOMB
+ mbstate_t shift_state;
+
+ memset(&shift_state, 0, sizeof(shift_state));
+#else
+ /* Clear the shift state before starting. */
+ wctomb(NULL, L'\0');
+#endif
+
+ /*
+ * Convert one wide char at a time into 'buff', whenever that
+ * fills, append it to the string.
+ */
+ p = buff;
+ while (*w != L'\0') {
+ /* Flush the buffer when we have <=16 bytes free. */
+ /* (No encoding has a single character >16 bytes.) */
+ if ((size_t)(p - buff) >= (size_t)(sizeof(buff) - MB_CUR_MAX)) {
+ *p = '\0';
+ archive_strcat(as, buff);
+ p = buff;
+ }
+#if HAVE_WCRTOMB
+ n = wcrtomb(p, *w++, &shift_state);
+#else
+ n = wctomb(p, *w++);
+#endif
+ if (n == -1)
+ return (NULL);
+ p += n;
+ }
+ *p = '\0';
+ archive_strcat(as, buff);
+ return (as);
+#endif
+}
+
+#endif /* _WIN32 && ! __CYGWIN__ */
diff --git a/archivers/libarchive/files/libarchive/archive_string.h b/archivers/libarchive/files/libarchive/archive_string.h
index e59c33af198..25d7a8b1e61 100644
--- a/archivers/libarchive/files/libarchive/archive_string.h
+++ b/archivers/libarchive/files/libarchive/archive_string.h
@@ -22,10 +22,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_string.h,v 1.12 2008/06/15 05:11:08 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_string.h 201092 2009-12-28 02:26:06Z kientzle $
*
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_STRING_H_INCLUDED
#define ARCHIVE_STRING_H_INCLUDED
@@ -66,11 +70,6 @@ struct archive_string *
__archive_strappend_char(struct archive_string *, char);
#define archive_strappend_char __archive_strappend_char
-/* Append an integer in the specified base (2 <= base <= 16). */
-struct archive_string *
-__archive_strappend_int(struct archive_string *as, int d, int base);
-#define archive_strappend_int __archive_strappend_int
-
/* Convert a wide-char string to UTF-8 and append the result. */
struct archive_string *
__archive_strappend_w_utf8(struct archive_string *, const wchar_t *);
@@ -92,14 +91,24 @@ __archive_string_copy(struct archive_string *dest, struct archive_string *src);
#define archive_string_copy(dest, src) \
__archive_string_copy(dest, src)
+/* Concatenate one archive_string to another */
+void
+__archive_string_concat(struct archive_string *dest, struct archive_string *src);
+#define archive_string_concat(dest, src) \
+ __archive_string_concat(dest, src)
+
/* Ensure that the underlying buffer is at least as large as the request. */
struct archive_string *
__archive_string_ensure(struct archive_string *, size_t);
#define archive_string_ensure __archive_string_ensure
/* Append C string, which may lack trailing \0. */
+/* The source is declared void * here because this gets used with
+ * "signed char *", "unsigned char *" and "char *" arguments.
+ * Declaring it "char *" as with some of the other functions just
+ * leads to a lot of extra casts. */
struct archive_string *
-__archive_strncat(struct archive_string *, const char *, size_t);
+__archive_strncat(struct archive_string *, const void *, size_t);
#define archive_strncat __archive_strncat
/* Append a C string to an archive_string, resizing as necessary. */
diff --git a/archivers/libarchive/files/libarchive/archive_string_sprintf.c b/archivers/libarchive/files/libarchive/archive_string_sprintf.c
index 6f77a36a1b8..6d3d8edded8 100644
--- a/archivers/libarchive/files/libarchive/archive_string_sprintf.c
+++ b/archivers/libarchive/files/libarchive/archive_string_sprintf.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.10 2008/03/14 22:00:09 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_string_sprintf.c 189435 2009-03-06 05:14:55Z kientzle $");
/*
* The use of printf()-family functions can be troublesome
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.10 2008/03/1
* implementing this function in terms of vsnprintf() requires
* two calls (one to determine the size, another to format the
* result), which in turn requires duplicating the argument list
- * using va_copy, which isn't yet universally available.
+ * using va_copy, which isn't yet universally available. <sigh>
*
* So, I've implemented a bare minimum of printf()-like capability
* here. This is only used to format error messages, so doesn't
@@ -44,6 +44,30 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.10 2008/03/1
#include "archive_string.h"
#include "archive_private.h"
+/*
+ * Utility functions to format signed/unsigned integers and append
+ * them to an archive_string.
+ */
+static void
+append_uint(struct archive_string *as, uintmax_t d, unsigned base)
+{
+ static const char *digits = "0123456789abcdef";
+ if (d >= base)
+ append_uint(as, d/base, base);
+ archive_strappend_char(as, digits[d % base]);
+}
+
+static void
+append_int(struct archive_string *as, intmax_t d, unsigned base)
+{
+ if (d < 0) {
+ archive_strappend_char(as, '-');
+ d = -d;
+ }
+ append_uint(as, d, base);
+}
+
+
void
__archive_string_sprintf(struct archive_string *as, const char *fmt, ...)
{
@@ -75,7 +99,6 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt,
return;
}
- long_flag = '\0';
for (p = fmt; *p != '\0'; p++) {
const char *saved_p = p;
@@ -86,6 +109,7 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt,
p++;
+ long_flag = '\0';
switch(*p) {
case 'j':
long_flag = 'j';
@@ -111,7 +135,7 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt,
case 'l': s = va_arg(ap, long); break;
default: s = va_arg(ap, int); break;
}
- archive_strappend_int(as, s, 10);
+ append_int(as, s, 10);
break;
case 's':
p2 = va_arg(ap, char *);
@@ -126,9 +150,9 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt,
}
/* Format it in the correct base. */
switch (*p) {
- case 'o': archive_strappend_int(as, u, 8); break;
- case 'u': archive_strappend_int(as, u, 10); break;
- default: archive_strappend_int(as, u, 16); break;
+ case 'o': append_uint(as, u, 8); break;
+ case 'u': append_uint(as, u, 10); break;
+ default: append_uint(as, u, 16); break;
}
break;
default:
diff --git a/archivers/libarchive/files/libarchive/archive_util.3 b/archivers/libarchive/files/libarchive/archive_util.3
index b315c55e515..98609e565a7 100644
--- a/archivers/libarchive/files/libarchive/archive_util.3
+++ b/archivers/libarchive/files/libarchive/archive_util.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/archive_util.3,v 1.8 2008/03/10 14:44:40 jkoshy Exp $
+.\" $FreeBSD: head/lib/libarchive/archive_util.3 201098 2009-12-28 02:58:14Z kientzle $
.\"
.Dd January 8, 2005
.Dt archive_util 3
@@ -34,6 +34,7 @@
.Nm archive_copy_error ,
.Nm archive_errno ,
.Nm archive_error_string ,
+.Nm archive_file_count ,
.Nm archive_format ,
.Nm archive_format_name ,
.Nm archive_set_error
@@ -53,6 +54,8 @@
.Ft const char *
.Fn archive_error_string "struct archive *"
.Ft int
+.Fn archive_file_count "struct archive *"
+.Ft int
.Fn archive_format "struct archive *"
.Ft const char *
.Fn archive_format_name "struct archive *"
@@ -92,6 +95,12 @@ obtained from passing the result of
.Fn archive_errno
to
.Xr strerror 3 .
+.It Fn archive_file_count
+Returns a count of the number of files processed by this archive object.
+The count is incremented by calls to
+.Xr archive_write_header
+or
+.Xr archive_read_next_header .
.It Fn archive_format
Returns a numeric code indicating the format of the current
archive entry.
diff --git a/archivers/libarchive/files/libarchive/archive_util.c b/archivers/libarchive/files/libarchive/archive_util.c
index 7fb46967715..c945d5fa71a 100644
--- a/archivers/libarchive/files/libarchive/archive_util.c
+++ b/archivers/libarchive/files/libarchive/archive_util.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
@@ -24,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.18 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:14Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -99,6 +100,11 @@ archive_error_string(struct archive *a)
return ("(Empty error message)");
}
+int
+archive_file_count(struct archive *a)
+{
+ return (a->file_count);
+}
int
archive_format(struct archive *a)
@@ -155,10 +161,6 @@ void
archive_set_error(struct archive *a, int error_number, const char *fmt, ...)
{
va_list ap;
-#ifdef HAVE_STRERROR_R
- char errbuff[512];
-#endif
- char *errp;
a->archive_error_number = error_number;
if (fmt == NULL) {
@@ -168,23 +170,8 @@ archive_set_error(struct archive *a, int error_number, const char *fmt, ...)
va_start(ap, fmt);
archive_string_vsprintf(&(a->error_string), fmt, ap);
- if (error_number > 0) {
- archive_strcat(&(a->error_string), ": ");
-#ifdef HAVE_STRERROR_R
-#ifdef STRERROR_R_CHAR_P
- errp = strerror_r(error_number, errbuff, sizeof(errbuff));
-#else
- strerror_r(error_number, errbuff, sizeof(errbuff));
- errp = errbuff;
-#endif
-#else
- /* Note: this is not threadsafe! */
- errp = strerror(error_number);
-#endif
- archive_strcat(&(a->error_string), errp);
- }
- a->error = a->error_string.s;
va_end(ap);
+ a->error = a->error_string.s;
}
void
@@ -200,8 +187,205 @@ void
__archive_errx(int retvalue, const char *msg)
{
static const char *msg1 = "Fatal Internal Error in libarchive: ";
- write(2, msg1, strlen(msg1));
- write(2, msg, strlen(msg));
- write(2, "\n", 1);
+ size_t s;
+
+ s = write(2, msg1, strlen(msg1));
+ (void)s; /* UNUSED */
+ s = write(2, msg, strlen(msg));
+ (void)s; /* UNUSED */
+ s = write(2, "\n", 1);
+ (void)s; /* UNUSED */
exit(retvalue);
}
+
+/*
+ * Parse option strings
+ * Detail of option format.
+ * - The option can accept:
+ * "opt-name", "!opt-name", "opt-name=value".
+ *
+ * - The option entries are separated by comma.
+ * e.g "compression=9,opt=XXX,opt-b=ZZZ"
+ *
+ * - The name of option string consist of '-' and alphabet
+ * but character '-' cannot be used for the first character.
+ * (Regular expression is [a-z][-a-z]+)
+ *
+ * - For a specfic format/filter, using the format name with ':'.
+ * e.g "zip:compression=9"
+ * (This "compression=9" option entry is for "zip" format only)
+ *
+ * If another entries follow it, those are not for
+ * the specfic format/filter.
+ * e.g handle "zip:compression=9,opt=XXX,opt-b=ZZZ"
+ * "zip" format/filter handler will get "compression=9"
+ * all format/filter handler will get "opt=XXX"
+ * all format/filter handler will get "opt-b=ZZZ"
+ *
+ * - Whitespace and tab are bypassed.
+ *
+ */
+int
+__archive_parse_options(const char *p, const char *fn, int keysize, char *key,
+ int valsize, char *val)
+{
+ const char *p_org;
+ int apply;
+ int kidx, vidx;
+ int negative;
+ enum {
+ /* Requested for initialization. */
+ INIT,
+ /* Finding format/filter-name and option-name. */
+ F_BOTH,
+ /* Finding option-name only.
+ * (already detected format/filter-name) */
+ F_NAME,
+ /* Getting option-value. */
+ G_VALUE,
+ } state;
+
+ p_org = p;
+ state = INIT;
+ kidx = vidx = negative = 0;
+ apply = 1;
+ while (*p) {
+ switch (state) {
+ case INIT:
+ kidx = vidx = 0;
+ negative = 0;
+ apply = 1;
+ state = F_BOTH;
+ break;
+ case F_BOTH:
+ case F_NAME:
+ if ((*p >= 'a' && *p <= 'z') ||
+ (*p >= '0' && *p <= '9') || *p == '-') {
+ if (kidx == 0 && !(*p >= 'a' && *p <= 'z'))
+ /* Illegal sequence. */
+ return (-1);
+ if (kidx >= keysize -1)
+ /* Too many characters. */
+ return (-1);
+ key[kidx++] = *p++;
+ } else if (*p == '!') {
+ if (kidx != 0)
+ /* Illegal sequence. */
+ return (-1);
+ negative = 1;
+ ++p;
+ } else if (*p == ',') {
+ if (kidx == 0)
+ /* Illegal sequence. */
+ return (-1);
+ if (!negative)
+ val[vidx++] = '1';
+ /* We have got boolean option data. */
+ ++p;
+ if (apply)
+ goto complete;
+ else
+ /* This option does not apply to the
+ * format which the fn variable
+ * indicate. */
+ state = INIT;
+ } else if (*p == ':') {
+ /* obuf data is format name */
+ if (state == F_NAME)
+ /* We already found it. */
+ return (-1);
+ if (kidx == 0)
+ /* Illegal sequence. */
+ return (-1);
+ if (negative)
+ /* We cannot accept "!format-name:". */
+ return (-1);
+ key[kidx] = '\0';
+ if (strcmp(fn, key) != 0)
+ /* This option does not apply to the
+ * format which the fn variable
+ * indicate. */
+ apply = 0;
+ kidx = 0;
+ ++p;
+ state = F_NAME;
+ } else if (*p == '=') {
+ if (kidx == 0)
+ /* Illegal sequence. */
+ return (-1);
+ if (negative)
+ /* We cannot accept "!opt-name=value". */
+ return (-1);
+ ++p;
+ state = G_VALUE;
+ } else if (*p == ' ') {
+ /* Pass the space character */
+ ++p;
+ } else {
+ /* Illegal character. */
+ return (-1);
+ }
+ break;
+ case G_VALUE:
+ if (*p == ',') {
+ if (vidx == 0)
+ /* Illegal sequence. */
+ return (-1);
+ /* We have got option data. */
+ ++p;
+ if (apply)
+ goto complete;
+ else
+ /* This option does not apply to the
+ * format which the fn variable
+ * indicate. */
+ state = INIT;
+ } else if (*p == ' ') {
+ /* Pass the space character */
+ ++p;
+ } else {
+ if (vidx >= valsize -1)
+ /* Too many characters. */
+ return (-1);
+ val[vidx++] = *p++;
+ }
+ break;
+ }
+ }
+
+ switch (state) {
+ case F_BOTH:
+ case F_NAME:
+ if (kidx != 0) {
+ if (!negative)
+ val[vidx++] = '1';
+ /* We have got boolean option. */
+ if (apply)
+ /* This option apply to the format which the
+ * fn variable indicate. */
+ goto complete;
+ }
+ break;
+ case G_VALUE:
+ if (vidx == 0)
+ /* Illegal sequence. */
+ return (-1);
+ /* We have got option value. */
+ if (apply)
+ /* This option apply to the format which the fn
+ * variable indicate. */
+ goto complete;
+ break;
+ case INIT:/* nothing */
+ break;
+ }
+
+ /* End of Option string. */
+ return (0);
+
+complete:
+ key[kidx] = '\0';
+ val[vidx] = '\0';
+ /* Return a size which we've consumed for detecting option */
+ return ((int)(p - p_org));
+}
diff --git a/archivers/libarchive/files/libarchive/archive_virtual.c b/archivers/libarchive/files/libarchive/archive_virtual.c
index a431058c671..a5c0b39b9cc 100644
--- a/archivers/libarchive/files/libarchive/archive_virtual.c
+++ b/archivers/libarchive/files/libarchive/archive_virtual.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_virtual.c,v 1.1 2007/03/03 07:37:36 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_virtual.c 201098 2009-12-28 02:58:14Z kientzle $");
#include "archive.h"
#include "archive_entry.h"
@@ -33,27 +33,40 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_virtual.c,v 1.1 2007/03/03 07:37:
int
archive_write_close(struct archive *a)
{
- return ((a->vtable->archive_write_close)(a));
+ return ((a->vtable->archive_close)(a));
+}
+
+int
+archive_read_close(struct archive *a)
+{
+ return ((a->vtable->archive_close)(a));
}
#if ARCHIVE_API_VERSION > 1
int
archive_write_finish(struct archive *a)
{
- return ((a->vtable->archive_write_finish)(a));
+ return ((a->vtable->archive_finish)(a));
}
#else
/* Temporarily allow library to compile with either 1.x or 2.0 API. */
void
archive_write_finish(struct archive *a)
{
- (void)(a->vtable->archive_write_finish)(a);
+ (void)(a->vtable->archive_finish)(a);
}
#endif
int
+archive_read_finish(struct archive *a)
+{
+ return ((a->vtable->archive_finish)(a));
+}
+
+int
archive_write_header(struct archive *a, struct archive_entry *entry)
{
+ ++a->file_count;
return ((a->vtable->archive_write_header)(a, entry));
}
diff --git a/archivers/libarchive/files/libarchive/archive_windows.c b/archivers/libarchive/files/libarchive/archive_windows.c
index 1f4d273dabb..03a459e7c49 100644
--- a/archivers/libarchive/files/libarchive/archive_windows.c
+++ b/archivers/libarchive/files/libarchive/archive_windows.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
* Copyright (c) 2003-2007 Kees Zeelenberg
* All rights reserved.
*
@@ -43,146 +44,1237 @@
* considering alternative APIs.
*/
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "archive_platform.h"
+#include "archive_private.h"
+#include <ctype.h>
#include <errno.h>
#include <stddef.h>
+#ifdef HAVE_SYS_UTIME_H
#include <sys/utime.h>
+#endif
#include <sys/stat.h>
#include <process.h>
#include <stdlib.h>
+#include <wchar.h>
#include <windows.h>
-#include "archive_platform.h"
-/* Make a link to FROM called TO. */
-int link (from, to)
- const char *from;
- const char *to;
+#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
+
+#if defined(_MSC_VER) && _MSC_VER < 1300
+/* VS 6 does not provide SetFilePointerEx, so define it here. */
+static BOOL SetFilePointerEx(HANDLE hFile,
+ LARGE_INTEGER liDistanceToMove,
+ PLARGE_INTEGER lpNewFilePointer,
+ DWORD dwMoveMethod)
+{
+ LARGE_INTEGER li;
+ li.QuadPart = liDistanceToMove.QuadPart;
+ li.LowPart = SetFilePointer(
+ hFile, li.LowPart, &li.HighPart, dwMoveMethod);
+ if(lpNewFilePointer) {
+ lpNewFilePointer->QuadPart = li.QuadPart;
+ }
+ return li.LowPart != -1 || GetLastError() == NO_ERROR;
+}
+#endif
+
+struct ustat {
+ int64_t st_atime;
+ uint32_t st_atime_nsec;
+ int64_t st_ctime;
+ uint32_t st_ctime_nsec;
+ int64_t st_mtime;
+ uint32_t st_mtime_nsec;
+ gid_t st_gid;
+ /* 64bits ino */
+ int64_t st_ino;
+ mode_t st_mode;
+ uint32_t st_nlink;
+ uint64_t st_size;
+ uid_t st_uid;
+ dev_t st_dev;
+ dev_t st_rdev;
+};
+
+/* Local replacement for undocumented Windows CRT function. */
+static void la_dosmaperr(unsigned long e);
+
+/* Transform 64-bits ino into 32-bits by hashing.
+ * You do not forget that really unique number size is 64-bits.
+ */
+#define INOSIZE (8*sizeof(ino_t)) /* 32 */
+static __inline ino_t
+getino(struct ustat *ub)
+{
+ ULARGE_INTEGER ino64;
+ ino64.QuadPart = ub->st_ino;
+ /* I don't know this hashing is correct way */
+ return (ino64.LowPart ^ (ino64.LowPart >> INOSIZE));
+}
+
+/*
+ * Prepend "\\?\" to the path name and convert it to unicode to permit
+ * an extended-length path for a maximum total path length of 32767
+ * characters.
+ * see also http://msdn.microsoft.com/en-us/library/aa365247.aspx
+ */
+static wchar_t *
+permissive_name(const char *name)
{
- int res;
+ wchar_t *wn, *wnp;
+ wchar_t *ws, *wsp;
+ DWORD l, len, slen;
+ int unc;
+
+ len = (DWORD)strlen(name);
+ wn = malloc((len + 1) * sizeof(wchar_t));
+ if (wn == NULL)
+ return (NULL);
+ l = MultiByteToWideChar(CP_ACP, 0, name, (int)len, wn, (int)len);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wn[l] = L'\0';
+
+ /* Get a full path names */
+ l = GetFullPathNameW(wn, 0, NULL, NULL);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wnp = malloc(l * sizeof(wchar_t));
+ if (wnp == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ len = GetFullPathNameW(wn, l, wnp, NULL);
+ free(wn);
+ wn = wnp;
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'?' && wnp[3] == L'\\')
+ /* We have already permissive names. */
+ return (wn);
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'.' && wnp[3] == L'\\') {
+ /* Device names */
+ if (((wnp[4] >= L'a' && wnp[4] <= L'z') ||
+ (wnp[4] >= L'A' && wnp[4] <= L'Z')) &&
+ wnp[5] == L':' && wnp[6] == L'\\')
+ wnp[2] = L'?';/* Not device names. */
+ return (wn);
+ }
+
+ unc = 0;
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' && wnp[2] != L'\\') {
+ wchar_t *p = &wnp[2];
+
+ /* Skip server-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\') {
+ wchar_t *rp = ++p;
+ /* Skip share-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\' && p != rp) {
+ /* Now, match patterns such as
+ * "\\server-name\share-name\" */
+ wnp += 2;
+ len -= 2;
+ unc = 1;
+ }
+ }
+ }
+
+ slen = 4 + (unc * 4) + len + 1;
+ ws = wsp = malloc(slen * sizeof(wchar_t));
+ if (ws == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ /* prepend "\\?\" */
+ wcsncpy(wsp, L"\\\\?\\", 4);
+ wsp += 4;
+ slen -= 4;
+ if (unc) {
+ /* append "UNC\" ---> "\\?\UNC\" */
+ wcsncpy(wsp, L"UNC\\", 4);
+ wsp += 4;
+ slen -= 4;
+ }
+ wcsncpy(wsp, wnp, slen);
+ wsp[slen - 1] = L'\0'; /* Ensure null termination. */
+ free(wn);
+ return (ws);
+}
- if (from == NULL || to == NULL) {
+static HANDLE
+la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
+ DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+{
+ wchar_t *wpath;
+ HANDLE handle;
+
+ handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
+ lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
+ hTemplateFile);
+ if (handle != INVALID_HANDLE_VALUE)
+ return (handle);
+ if (GetLastError() != ERROR_PATH_NOT_FOUND)
+ return (handle);
+ wpath = permissive_name(path);
+ if (wpath == NULL)
+ return (handle);
+ handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
+ lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
+ hTemplateFile);
+ free(wpath);
+ return (handle);
+}
+
+static void *
+la_GetFunctionKernel32(const char *name)
+{
+ static HINSTANCE lib;
+ static int set;
+ if (!set) {
+ set = 1;
+ lib = LoadLibrary("kernel32.dll");
+ }
+ if (lib == NULL) {
+ fprintf(stderr, "Can't load kernel32.dll?!\n");
+ exit(1);
+ }
+ return (void *)GetProcAddress(lib, name);
+}
+
+static int
+la_CreateHardLinkW(wchar_t *linkname, wchar_t *target)
+{
+ static BOOLEAN (WINAPI *f)(LPWSTR, LPWSTR, LPSECURITY_ATTRIBUTES);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = la_GetFunctionKernel32("CreateHardLinkW");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, NULL);
+}
+
+
+/* Make a link to src called dst. */
+static int
+__link(const char *src, const char *dst)
+{
+ wchar_t *wsrc, *wdst;
+ int res, retval;
+ DWORD attr;
+
+ if (src == NULL || dst == NULL) {
set_errno (EINVAL);
return -1;
}
- if (!_access (from, F_OK))
- res = CopyFile (from, to, FALSE);
- else {
- /* from doesn not exist; try to prepend it with the dirname of to */
- char *fullfrompath, *slash, *todir;
- todir = strdup (to);
- if (!todir)
- return -1;
- slash = strrchr(todir, '/');
- if (slash)
- *slash = '\0';
- fullfrompath = malloc (strlen (from) + strlen (todir) + 2);
- if (!fullfrompath)
- return -1;
- strcpy (fullfrompath, todir);
- strcat (fullfrompath, "/");
- strcat (fullfrompath, from);
- if (todir)
- free (todir);
- if (_access (fullfrompath, R_OK))
- return -1;
- res = CopyFile (fullfrompath, to, FALSE);
- if (fullfrompath)
- free (fullfrompath);
+ wsrc = permissive_name(src);
+ wdst = permissive_name(dst);
+ if (wsrc == NULL || wdst == NULL) {
+ free(wsrc);
+ free(wdst);
+ set_errno (EINVAL);
+ return -1;
}
+ if ((attr = GetFileAttributesW(wsrc)) != (DWORD)-1) {
+ res = la_CreateHardLinkW(wdst, wsrc);
+ } else {
+ /* wsrc does not exist; try src prepend it with the dirname of wdst */
+ wchar_t *wnewsrc, *slash;
+ int i, n, slen, wlen;
+
+ if (strlen(src) >= 3 && isalpha((unsigned char)src[0]) &&
+ src[1] == ':' && src[2] == '\\') {
+ /* Original src name is already full-path */
+ retval = -1;
+ goto exit;
+ }
+ if (src[0] == '\\') {
+ /* Original src name is almost full-path
+ * (maybe src name is without drive) */
+ retval = -1;
+ goto exit;
+ }
+
+ wnewsrc = malloc ((wcslen(wsrc) + wcslen(wdst) + 1) * sizeof(wchar_t));
+ if (wnewsrc == NULL) {
+ errno = ENOMEM;
+ retval = -1;
+ goto exit;
+ }
+ /* Copying a dirname of wdst */
+ wcscpy(wnewsrc, wdst);
+ slash = wcsrchr(wnewsrc, L'\\');
+ if (slash != NULL)
+ *++slash = L'\0';
+ else
+ wcscat(wnewsrc, L"\\");
+ /* Converting multi-byte src to wide-char src */
+ wlen = (int)wcslen(wsrc);
+ slen = (int)strlen(src);
+ n = MultiByteToWideChar(CP_ACP, 0, src, slen, wsrc, wlen);
+ if (n == 0) {
+ free (wnewsrc);
+ retval = -1;
+ goto exit;
+ }
+ for (i = 0; i < n; i++)
+ if (wsrc[i] == L'/')
+ wsrc[i] = L'\\';
+ wcsncat(wnewsrc, wsrc, n);
+ /* Check again */
+ attr = GetFileAttributesW(wnewsrc);
+ if (attr == (DWORD)-1 || (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
+ if (attr == (DWORD)-1)
+ la_dosmaperr(GetLastError());
+ else
+ errno = EPERM;
+ free (wnewsrc);
+ retval = -1;
+ goto exit;
+ }
+ res = la_CreateHardLinkW(wdst, wnewsrc);
+ free (wnewsrc);
+ }
if (res == 0) {
- set_errno (EINVAL);
- return -1;
+ la_dosmaperr(GetLastError());
+ retval = -1;
+ } else
+ retval = 0;
+exit:
+ free(wsrc);
+ free(wdst);
+ return (retval);
+}
+
+/* Make a hard link to src called dst. */
+int
+__la_link(const char *src, const char *dst)
+{
+ return __link(src, dst);
+}
+
+int
+__la_ftruncate(int fd, off_t length)
+{
+ LARGE_INTEGER distance;
+ HANDLE handle;
+
+ if (fd < 0) {
+ errno = EBADF;
+ return (-1);
+ }
+ handle = (HANDLE)_get_osfhandle(fd);
+ if (GetFileType(handle) != FILE_TYPE_DISK) {
+ errno = EBADF;
+ return (-1);
+ }
+ distance.QuadPart = length;
+ if (!SetFilePointerEx(handle, distance, NULL, FILE_BEGIN)) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ if (!SetEndOfFile(handle)) {
+ la_dosmaperr(GetLastError());
+ return (-1);
}
- return 0;
+ return (0);
}
-/* Make a symbolic link to FROM called TO. */
-int symlink (from, to)
- const char *from;
- const char *to;
+#define WINTIME(sec, usec) ((Int32x32To64(sec, 10000000) + EPOC_TIME) + (usec * 10))
+static int
+__hutimes(HANDLE handle, const struct __timeval *times)
{
- return link (from, to);
+ ULARGE_INTEGER wintm;
+ FILETIME fatime, fmtime;
+
+ wintm.QuadPart = WINTIME(times[0].tv_sec, times[0].tv_usec);
+ fatime.dwLowDateTime = wintm.LowPart;
+ fatime.dwHighDateTime = wintm.HighPart;
+ wintm.QuadPart = WINTIME(times[1].tv_sec, times[1].tv_usec);
+ fmtime.dwLowDateTime = wintm.LowPart;
+ fmtime.dwHighDateTime = wintm.HighPart;
+ if (SetFileTime(handle, NULL, &fatime, &fmtime) == 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ return (0);
}
-static int get_dev_ino (HANDLE hFile, dev_t *dev, ino_t *ino)
+int
+__la_futimes(int fd, const struct __timeval *times)
{
-/* dev_t: short (2 bytes); ino_t: unsigned int (4 bytes) */
-#define LODWORD(l) ((DWORD)((DWORDLONG)(l)))
-#define HIDWORD(l) ((DWORD)(((DWORDLONG)(l)>>32)&0xFFFFFFFF))
-#define MAKEDWORDLONG(a,b) ((DWORDLONG)(((DWORD)(a))|(((DWORDLONG)((DWORD)(b)))<<32)))
-#define INOSIZE (8*sizeof(ino_t)) /* 32 */
-//#define DEVSIZE (8*sizeof(dev_t)) /* 16 */
-#define SEQNUMSIZE (16)
-
- BY_HANDLE_FILE_INFORMATION FileInformation;
- uint64_t ino64, FileReferenceNumber ;
- ino_t resino;
- dev_t resdev;
- DWORD VolumeSerialNumber;
+ return (__hutimes((HANDLE)_get_osfhandle(fd), times));
+}
+
+int
+__la_utimes(const char *name, const struct __timeval *times)
+{
+ int ret;
+ HANDLE handle;
+
+ handle = la_CreateFile(name, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (handle == INVALID_HANDLE_VALUE) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ ret = __hutimes(handle, times);
+ CloseHandle(handle);
+ return (ret);
+}
+
+int
+__la_chdir(const char *path)
+{
+ wchar_t *ws;
+ int r;
+
+ r = SetCurrentDirectoryA(path);
+ if (r == 0) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ } else
+ return (0);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ r = SetCurrentDirectoryW(ws);
+ free(ws);
+ if (r == 0) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ return (0);
+}
+
+int
+__la_chmod(const char *path, mode_t mode)
+{
+ wchar_t *ws;
+ DWORD attr;
+ BOOL r;
+
+ ws = NULL;
+ attr = GetFileAttributesA(path);
+ if (attr == (DWORD)-1) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ attr = GetFileAttributesW(ws);
+ if (attr == (DWORD)-1) {
+ free(ws);
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ }
+ if (mode & _S_IWRITE)
+ attr &= ~FILE_ATTRIBUTE_READONLY;
+ else
+ attr |= FILE_ATTRIBUTE_READONLY;
+ if (ws == NULL)
+ r = SetFileAttributesA(path, attr);
+ else {
+ r = SetFileAttributesW(ws, attr);
+ free(ws);
+ }
+ if (r == 0) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ return (0);
+}
+
+/*
+ * This fcntl is limited implemention.
+ */
+int
+__la_fcntl(int fd, int cmd, int val)
+{
+ HANDLE handle;
+
+ handle = (HANDLE)_get_osfhandle(fd);
+ if (GetFileType(handle) == FILE_TYPE_PIPE) {
+ if (cmd == F_SETFL && val == 0) {
+ DWORD mode = PIPE_WAIT;
+ if (SetNamedPipeHandleState(
+ handle, &mode, NULL, NULL) != 0)
+ return (0);
+ }
+ }
+ errno = EINVAL;
+ return (-1);
+}
+
+__int64
+__la_lseek(int fd, __int64 offset, int whence)
+{
+ LARGE_INTEGER distance;
+ LARGE_INTEGER newpointer;
+ HANDLE handle;
+
+ if (fd < 0) {
+ errno = EBADF;
+ return (-1);
+ }
+ handle = (HANDLE)_get_osfhandle(fd);
+ if (GetFileType(handle) != FILE_TYPE_DISK) {
+ errno = EBADF;
+ return (-1);
+ }
+ distance.QuadPart = offset;
+ if (!SetFilePointerEx(handle, distance, &newpointer, whence)) {
+ DWORD lasterr;
+
+ lasterr = GetLastError();
+ if (lasterr == ERROR_BROKEN_PIPE)
+ return (0);
+ if (lasterr == ERROR_ACCESS_DENIED)
+ errno = EBADF;
+ else
+ la_dosmaperr(lasterr);
+ return (-1);
+ }
+ return (newpointer.QuadPart);
+}
+
+int
+__la_mkdir(const char *path, mode_t mode)
+{
+ wchar_t *ws;
+ int r;
+
+ (void)mode;/* UNUSED */
+ r = CreateDirectoryA(path, NULL);
+ if (r == 0) {
+ DWORD lasterr = GetLastError();
+ if (lasterr != ERROR_FILENAME_EXCED_RANGE &&
+ lasterr != ERROR_PATH_NOT_FOUND) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ } else
+ return (0);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ r = CreateDirectoryW(ws, NULL);
+ free(ws);
+ if (r == 0) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ return (0);
+}
+
+/* Windows' mbstowcs is differrent error handling from other unix mbstowcs.
+ * That one is using MultiByteToWideChar function with MB_PRECOMPOSED and
+ * MB_ERR_INVALID_CHARS flags.
+ * This implements for only to pass libarchive_test.
+ */
+size_t
+__la_mbstowcs(wchar_t *wcstr, const char *mbstr, size_t nwchars)
+{
+
+ return (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
+ mbstr, (int)strlen(mbstr), wcstr,
+ (int)nwchars));
+}
+
+int
+__la_open(const char *path, int flags, ...)
+{
+ va_list ap;
+ wchar_t *ws;
+ int r, pmode;
+ DWORD attr;
+
+ va_start(ap, flags);
+ pmode = va_arg(ap, int);
+ va_end(ap);
+ ws = NULL;
+ if ((flags & ~O_BINARY) == O_RDONLY) {
+ /*
+ * When we open a directory, _open function returns
+ * "Permission denied" error.
+ */
+ attr = GetFileAttributesA(path);
+ if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND) {
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ attr = GetFileAttributesW(ws);
+ }
+ if (attr == (DWORD)-1) {
+ la_dosmaperr(GetLastError());
+ free(ws);
+ return (-1);
+ }
+ if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+ HANDLE handle;
+
+ if (ws != NULL)
+ handle = CreateFileW(ws, 0, 0, NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS |
+ FILE_ATTRIBUTE_READONLY,
+ NULL);
+ else
+ handle = CreateFileA(path, 0, 0, NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS |
+ FILE_ATTRIBUTE_READONLY,
+ NULL);
+ free(ws);
+ if (handle == INVALID_HANDLE_VALUE) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ r = _open_osfhandle((intptr_t)handle, _O_RDONLY);
+ return (r);
+ }
+ }
+ if (ws == NULL) {
+#if defined(__BORLANDC__)
+ /* Borland has no mode argument.
+ TODO: Fix mode of new file. */
+ r = _open(path, flags);
+#else
+ r = _open(path, flags, pmode);
+#endif
+ if (r < 0 && errno == EACCES && (flags & O_CREAT) != 0) {
+ /* simular other POSIX system action to pass a test */
+ attr = GetFileAttributesA(path);
+ if (attr == (DWORD)-1)
+ la_dosmaperr(GetLastError());
+ else if (attr & FILE_ATTRIBUTE_DIRECTORY)
+ errno = EISDIR;
+ else
+ errno = EACCES;
+ return (-1);
+ }
+ if (r >= 0 || errno != ENOENT)
+ return (r);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ }
+ r = _wopen(ws, flags, pmode);
+ if (r < 0 && errno == EACCES && (flags & O_CREAT) != 0) {
+ /* simular other POSIX system action to pass a test */
+ attr = GetFileAttributesW(ws);
+ if (attr == (DWORD)-1)
+ la_dosmaperr(GetLastError());
+ else if (attr & FILE_ATTRIBUTE_DIRECTORY)
+ errno = EISDIR;
+ else
+ errno = EACCES;
+ }
+ free(ws);
+ return (r);
+}
+
+ssize_t
+__la_read(int fd, void *buf, size_t nbytes)
+{
+ HANDLE handle;
+ DWORD bytes_read, lasterr;
+ int r;
+
+#ifdef _WIN64
+ if (nbytes > UINT32_MAX)
+ nbytes = UINT32_MAX;
+#endif
+ if (fd < 0) {
+ errno = EBADF;
+ return (-1);
+ }
+ handle = (HANDLE)_get_osfhandle(fd);
+ if (GetFileType(handle) == FILE_TYPE_PIPE) {
+ DWORD sta;
+ if (GetNamedPipeHandleState(
+ handle, &sta, NULL, NULL, NULL, NULL, 0) != 0 &&
+ (sta & PIPE_NOWAIT) == 0) {
+ DWORD avail = -1;
+ int cnt = 3;
+
+ while (PeekNamedPipe(
+ handle, NULL, 0, NULL, &avail, NULL) != 0 &&
+ avail == 0 && --cnt)
+ Sleep(100);
+ if (avail == 0)
+ return (0);
+ }
+ }
+ r = ReadFile(handle, buf, (uint32_t)nbytes,
+ &bytes_read, NULL);
+ if (r == 0) {
+ lasterr = GetLastError();
+ if (lasterr == ERROR_NO_DATA) {
+ errno = EAGAIN;
+ return (-1);
+ }
+ if (lasterr == ERROR_BROKEN_PIPE)
+ return (0);
+ if (lasterr == ERROR_ACCESS_DENIED)
+ errno = EBADF;
+ else
+ la_dosmaperr(lasterr);
+ return (-1);
+ }
+ return ((ssize_t)bytes_read);
+}
+
+/* Remove directory */
+int
+__la_rmdir(const char *path)
+{
+ wchar_t *ws;
+ int r;
+
+ r = _rmdir(path);
+ if (r >= 0 || errno != ENOENT)
+ return (r);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ r = _wrmdir(ws);
+ free(ws);
+ return (r);
+}
+
+/* Convert Windows FILETIME to UTC */
+__inline static void
+fileTimeToUTC(const FILETIME *filetime, time_t *time, long *ns)
+{
+ ULARGE_INTEGER utc;
+
+ utc.HighPart = filetime->dwHighDateTime;
+ utc.LowPart = filetime->dwLowDateTime;
+ if (utc.QuadPart >= EPOC_TIME) {
+ utc.QuadPart -= EPOC_TIME;
+ *time = (time_t)(utc.QuadPart / 10000000); /* milli seconds base */
+ *ns = (long)(utc.QuadPart % 10000000) * 100;/* nano seconds base */
+ } else {
+ *time = 0;
+ *ns = 0;
+ }
+}
+
+/* Stat by handle
+ * Windows' stat() does not accept path which is added "\\?\" especially "?"
+ * character.
+ * It means we cannot access a long name path(which is longer than MAX_PATH).
+ * So I've implemented simular Windows' stat() to access the long name path.
+ * And I've added some feature.
+ * 1. set st_ino by nFileIndexHigh and nFileIndexLow of
+ * BY_HANDLE_FILE_INFORMATION.
+ * 2. set st_nlink by nNumberOfLinks of BY_HANDLE_FILE_INFORMATION.
+ * 3. set st_dev by dwVolumeSerialNumber by BY_HANDLE_FILE_INFORMATION.
+ */
+static int
+__hstat(HANDLE handle, struct ustat *st)
+{
+ BY_HANDLE_FILE_INFORMATION info;
+ ULARGE_INTEGER ino64;
+ DWORD ftype;
+ mode_t mode;
+ time_t time;
+ long ns;
+
+ switch (ftype = GetFileType(handle)) {
+ case FILE_TYPE_UNKNOWN:
+ errno = EBADF;
+ return (-1);
+ case FILE_TYPE_CHAR:
+ case FILE_TYPE_PIPE:
+ if (ftype == FILE_TYPE_CHAR) {
+ st->st_mode = S_IFCHR;
+ st->st_size = 0;
+ } else {
+ DWORD avail;
+
+ st->st_mode = S_IFIFO;
+ if (PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL))
+ st->st_size = avail;
+ else
+ st->st_size = 0;
+ }
+ st->st_atime = 0;
+ st->st_atime_nsec = 0;
+ st->st_mtime = 0;
+ st->st_mtime_nsec = 0;
+ st->st_ctime = 0;
+ st->st_ctime_nsec = 0;
+ st->st_ino = 0;
+ st->st_nlink = 1;
+ st->st_uid = 0;
+ st->st_gid = 0;
+ st->st_rdev = 0;
+ st->st_dev = 0;
+ return (0);
+ case FILE_TYPE_DISK:
+ break;
+ default:
+ /* This ftype is undocumented type. */
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+
+ ZeroMemory(&info, sizeof(info));
+ if (!GetFileInformationByHandle (handle, &info)) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+
+ mode = S_IRUSR | S_IRGRP | S_IROTH;
+ if ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0)
+ mode |= S_IWUSR | S_IWGRP | S_IWOTH;
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
+ else
+ mode |= S_IFREG;
+ st->st_mode = mode;
- *ino = 0;
- *dev = 0;
- if (hFile == INVALID_HANDLE_VALUE) /* file cannot be opened */
- return 0;
- ZeroMemory (&FileInformation, sizeof(FileInformation));
- if (!GetFileInformationByHandle (hFile, &FileInformation)) /* cannot obtain FileInformation */
- return 0;
- ino64 = (uint64_t) MAKEDWORDLONG (
- FileInformation.nFileIndexLow, FileInformation.nFileIndexHigh);
- FileReferenceNumber = ino64 & ((~(0ULL)) >> SEQNUMSIZE); /* remove sequence number */
- /* transform 64-bits ino into 32-bits by hashing */
- resino = (ino_t) (
- ( (LODWORD(FileReferenceNumber)) ^ ((LODWORD(FileReferenceNumber)) >> INOSIZE) )
-// ^
-// ( (HIDWORD(FileReferenceNumber)) ^ ((HIDWORD(FileReferenceNumber)) >> INOSIZE) )
- );
- *ino = resino;
- VolumeSerialNumber = FileInformation.dwVolumeSerialNumber;
- //resdev = (unsigned short) ( (LOWORD(VolumeSerialNumber)) ^ ((HIWORD(VolumeSerialNumber)) >> DEVSIZE) );
- resdev = (dev_t) VolumeSerialNumber;
- *dev = resdev;
-//printf ("get_dev_ino: dev = %d; ino = %u\n", resdev, resino);
- return 0;
-}
-
-int get_dev_ino_fd (int fd, dev_t *dev, ino_t *ino)
-{
- HANDLE hFile;
- hFile = (HANDLE) _get_osfhandle (fd);
- return get_dev_ino (hFile, dev, ino);
-}
-
-int get_dev_ino_filename (char *path, dev_t *dev, ino_t *ino)
-{
- HANDLE hFile;
- int res;
- if (!path || !*path) /* path = NULL */
- return 0;
- if (_access (path, F_OK)) /* path does not exist */
- return -1;
-/* obtain handle to file "name"; FILE_FLAG_BACKUP_SEMANTICS is used to open directories */
- hFile = CreateFile (path, 0, 0, NULL, OPEN_EXISTING,
+ fileTimeToUTC(&info.ftLastAccessTime, &time, &ns);
+ st->st_atime = time;
+ st->st_atime_nsec = ns;
+ fileTimeToUTC(&info.ftLastWriteTime, &time, &ns);
+ st->st_mtime = time;
+ st->st_mtime_nsec = ns;
+ fileTimeToUTC(&info.ftCreationTime, &time, &ns);
+ st->st_ctime = time;
+ st->st_ctime_nsec = ns;
+ st->st_size =
+ ((int64_t)(info.nFileSizeHigh) * ((int64_t)MAXDWORD + 1))
+ + (int64_t)(info.nFileSizeLow);
+#ifdef SIMULATE_WIN_STAT
+ st->st_ino = 0;
+ st->st_nlink = 1;
+ st->st_dev = 0;
+#else
+ /* Getting FileIndex as i-node. We have to remove a sequence which
+ * is high-16-bits of nFileIndexHigh. */
+ ino64.HighPart = info.nFileIndexHigh & 0x0000FFFFUL;
+ ino64.LowPart = info.nFileIndexLow;
+ st->st_ino = ino64.QuadPart;
+ st->st_nlink = info.nNumberOfLinks;
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ ++st->st_nlink;/* Add parent directory. */
+ st->st_dev = info.dwVolumeSerialNumber;
+#endif
+ st->st_uid = 0;
+ st->st_gid = 0;
+ st->st_rdev = 0;
+ return (0);
+}
+
+static void
+copy_stat(struct stat *st, struct ustat *us)
+{
+ st->st_atime = us->st_atime;
+ st->st_ctime = us->st_ctime;
+ st->st_mtime = us->st_mtime;
+ st->st_gid = us->st_gid;
+ st->st_ino = getino(us);
+ st->st_mode = us->st_mode;
+ st->st_nlink = us->st_nlink;
+ st->st_size = us->st_size;
+ st->st_uid = us->st_uid;
+ st->st_dev = us->st_dev;
+ st->st_rdev = us->st_rdev;
+}
+
+int
+__la_fstat(int fd, struct stat *st)
+{
+ struct ustat u;
+ int ret;
+
+ if (fd < 0) {
+ errno = EBADF;
+ return (-1);
+ }
+ ret = __hstat((HANDLE)_get_osfhandle(fd), &u);
+ if (ret >= 0) {
+ copy_stat(st, &u);
+ if (u.st_mode & (S_IFCHR | S_IFIFO)) {
+ st->st_dev = fd;
+ st->st_rdev = fd;
+ }
+ }
+ return (ret);
+}
+
+int
+__la_stat(const char *path, struct stat *st)
+{
+ HANDLE handle;
+ struct ustat u;
+ int ret;
+
+ handle = la_CreateFile(path, 0, 0, NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY,
NULL);
- res = get_dev_ino (hFile, dev, ino);
- CloseHandle (hFile);
- return res;
+ if (handle == INVALID_HANDLE_VALUE) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ ret = __hstat(handle, &u);
+ CloseHandle(handle);
+ if (ret >= 0) {
+ char *p;
+
+ copy_stat(st, &u);
+ p = strrchr(path, '.');
+ if (p != NULL && strlen(p) == 4) {
+ char exttype[4];
+
+ ++ p;
+ exttype[0] = toupper(*p++);
+ exttype[1] = toupper(*p++);
+ exttype[2] = toupper(*p++);
+ exttype[3] = '\0';
+ if (!strcmp(exttype, "EXE") || !strcmp(exttype, "CMD") ||
+ !strcmp(exttype, "BAT") || !strcmp(exttype, "COM"))
+ st->st_mode |= S_IXUSR | S_IXGRP | S_IXOTH;
+ }
+ }
+ return (ret);
}
-int fstati64 (int fd, struct _stati64 *st)
+int
+__la_unlink(const char *path)
{
- int res;
- res = _fstati64 (fd, st);
- if (res < 0)
- return -1;
- if (st->st_ino == 0)
- res = get_dev_ino_fd (fd, &st->st_dev, &st->st_ino);
-// printf ("fstat: dev = %u; ino = %u\n", st->st_dev, st->st_ino);
- return res;
+ wchar_t *ws;
+ int r;
+
+ r = _unlink(path);
+ if (r >= 0 || errno != ENOENT)
+ return (r);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ r = _wunlink(ws);
+ free(ws);
+ return (r);
+}
+
+/*
+ * This waitpid is limited implemention.
+ */
+pid_t
+__la_waitpid(pid_t wpid, int *status, int option)
+{
+ HANDLE child;
+ DWORD cs, ret;
+
+ (void)option;/* UNUSED */
+ child = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, wpid);
+ if (child == NULL) {
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ ret = WaitForSingleObject(child, INFINITE);
+ if (ret == WAIT_FAILED) {
+ CloseHandle(child);
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ if (GetExitCodeProcess(child, &cs) == 0) {
+ CloseHandle(child);
+ la_dosmaperr(GetLastError());
+ return (-1);
+ }
+ if (cs == STILL_ACTIVE)
+ *status = 0x100;
+ else
+ *status = (int)(cs & 0xff);
+ CloseHandle(child);
+ return (wpid);
+}
+
+ssize_t
+__la_write(int fd, const void *buf, size_t nbytes)
+{
+ DWORD bytes_written;
+
+#ifdef _WIN64
+ if (nbytes > UINT32_MAX)
+ nbytes = UINT32_MAX;
+#endif
+ if (fd < 0) {
+ errno = EBADF;
+ return (-1);
+ }
+ if (!WriteFile((HANDLE)_get_osfhandle(fd), buf, (uint32_t)nbytes,
+ &bytes_written, NULL)) {
+ DWORD lasterr;
+
+ lasterr = GetLastError();
+ if (lasterr == ERROR_ACCESS_DENIED)
+ errno = EBADF;
+ else
+ la_dosmaperr(lasterr);
+ return (-1);
+ }
+ return (bytes_written);
}
-#endif /* _WIN32 */
+/*
+ * The following function was modified from PostgreSQL sources and is
+ * subject to the copyright below.
+ */
+/*-------------------------------------------------------------------------
+ *
+ * win32error.c
+ * Map win32 error codes to errno values
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * $PostgreSQL: pgsql/src/port/win32error.c,v 1.4 2008/01/01 19:46:00 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+/*
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+*/
+
+static const struct {
+ DWORD winerr;
+ int doserr;
+} doserrors[] =
+{
+ { ERROR_INVALID_FUNCTION, EINVAL },
+ { ERROR_FILE_NOT_FOUND, ENOENT },
+ { ERROR_PATH_NOT_FOUND, ENOENT },
+ { ERROR_TOO_MANY_OPEN_FILES, EMFILE },
+ { ERROR_ACCESS_DENIED, EACCES },
+ { ERROR_INVALID_HANDLE, EBADF },
+ { ERROR_ARENA_TRASHED, ENOMEM },
+ { ERROR_NOT_ENOUGH_MEMORY, ENOMEM },
+ { ERROR_INVALID_BLOCK, ENOMEM },
+ { ERROR_BAD_ENVIRONMENT, E2BIG },
+ { ERROR_BAD_FORMAT, ENOEXEC },
+ { ERROR_INVALID_ACCESS, EINVAL },
+ { ERROR_INVALID_DATA, EINVAL },
+ { ERROR_INVALID_DRIVE, ENOENT },
+ { ERROR_CURRENT_DIRECTORY, EACCES },
+ { ERROR_NOT_SAME_DEVICE, EXDEV },
+ { ERROR_NO_MORE_FILES, ENOENT },
+ { ERROR_LOCK_VIOLATION, EACCES },
+ { ERROR_SHARING_VIOLATION, EACCES },
+ { ERROR_BAD_NETPATH, ENOENT },
+ { ERROR_NETWORK_ACCESS_DENIED, EACCES },
+ { ERROR_BAD_NET_NAME, ENOENT },
+ { ERROR_FILE_EXISTS, EEXIST },
+ { ERROR_CANNOT_MAKE, EACCES },
+ { ERROR_FAIL_I24, EACCES },
+ { ERROR_INVALID_PARAMETER, EINVAL },
+ { ERROR_NO_PROC_SLOTS, EAGAIN },
+ { ERROR_DRIVE_LOCKED, EACCES },
+ { ERROR_BROKEN_PIPE, EPIPE },
+ { ERROR_DISK_FULL, ENOSPC },
+ { ERROR_INVALID_TARGET_HANDLE, EBADF },
+ { ERROR_INVALID_HANDLE, EINVAL },
+ { ERROR_WAIT_NO_CHILDREN, ECHILD },
+ { ERROR_CHILD_NOT_COMPLETE, ECHILD },
+ { ERROR_DIRECT_ACCESS_HANDLE, EBADF },
+ { ERROR_NEGATIVE_SEEK, EINVAL },
+ { ERROR_SEEK_ON_DEVICE, EACCES },
+ { ERROR_DIR_NOT_EMPTY, ENOTEMPTY },
+ { ERROR_NOT_LOCKED, EACCES },
+ { ERROR_BAD_PATHNAME, ENOENT },
+ { ERROR_MAX_THRDS_REACHED, EAGAIN },
+ { ERROR_LOCK_FAILED, EACCES },
+ { ERROR_ALREADY_EXISTS, EEXIST },
+ { ERROR_FILENAME_EXCED_RANGE, ENOENT },
+ { ERROR_NESTING_NOT_ALLOWED, EAGAIN },
+ { ERROR_NOT_ENOUGH_QUOTA, ENOMEM }
+};
+
+static void
+la_dosmaperr(unsigned long e)
+{
+ int i;
+
+ if (e == 0)
+ {
+ errno = 0;
+ return;
+ }
+
+ for (i = 0; i < sizeof(doserrors); i++)
+ {
+ if (doserrors[i].winerr == e)
+ {
+ errno = doserrors[i].doserr;
+ return;
+ }
+ }
+
+ /* fprintf(stderr, "unrecognized win32 error code: %lu", e); */
+ errno = EINVAL;
+ return;
+}
+
+#if !defined(HAVE_OPENSSL_MD5_H) && !defined(HAVE_OPENSSL_SHA_H)
+/*
+ * Message digest functions.
+ */
+static void
+Digest_Init(Digest_CTX *ctx, ALG_ID algId)
+{
+
+ ctx->valid = 0;
+ if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
+ PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
+ if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
+ return;
+ if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
+ PROV_RSA_FULL, CRYPT_NEWKEYSET))
+ return;
+ }
+
+ if (!CryptCreateHash(ctx->cryptProv, algId, 0, 0, &ctx->hash)) {
+ CryptReleaseContext(ctx->cryptProv, 0);
+ return;
+ }
+
+ ctx->valid = 1;
+}
+
+static void
+Digest_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len)
+{
+
+ if (!ctx->valid)
+ return;
+
+ CryptHashData(ctx->hash,
+ (unsigned char *)(uintptr_t)buf,
+ (DWORD)len, 0);
+}
+
+static void
+Digest_Final(unsigned char *buf, int bufsize, Digest_CTX *ctx)
+{
+ DWORD siglen = bufsize;
+
+ if (!ctx->valid)
+ return;
+
+ CryptGetHashParam(ctx->hash, HP_HASHVAL, buf, &siglen, 0);
+ CryptDestroyHash(ctx->hash);
+ CryptReleaseContext(ctx->cryptProv, 0);
+ ctx->valid = 0;
+}
+
+#define DIGEST_INIT(name, algid) \
+void name ## _Init(Digest_CTX *ctx)\
+{\
+ Digest_Init(ctx, algid);\
+}
+
+#define DIGEST_UPDATE(name) \
+void name ## _Update(Digest_CTX *ctx, const unsigned char *buf, size_t len)\
+{\
+ Digest_Update(ctx, buf, len);\
+}
+
+#define DIGEST_FINAL(name, size) \
+void name ## _Final(unsigned char *buf, Digest_CTX *ctx)\
+{\
+ Digest_Final(buf, size, ctx);\
+}
+
+DIGEST_INIT(MD5, CALG_MD5)
+DIGEST_UPDATE(MD5)
+DIGEST_FINAL(MD5, MD5_DIGEST_LENGTH)
+
+DIGEST_INIT(SHA1, CALG_SHA1)
+DIGEST_UPDATE(SHA1)
+DIGEST_FINAL(SHA1, SHA1_DIGEST_LENGTH)
+
+/*
+ * SHA256 nor SHA384 nor SHA512 are not supported on Windows XP and Windows 2000.
+ */
+#ifdef CALG_SHA_256
+DIGEST_INIT(SHA256, CALG_SHA_256)
+DIGEST_UPDATE(SHA256)
+DIGEST_FINAL(SHA256, SHA256_DIGEST_LENGTH)
+#endif
+
+#ifdef CALG_SHA_384
+DIGEST_INIT(SHA384, CALG_SHA_384)
+DIGEST_UPDATE(SHA384)
+DIGEST_FINAL(SHA384, SHA384_DIGEST_LENGTH)
+#endif
+
+#ifdef CALG_SHA_512
+DIGEST_INIT(SHA512, CALG_SHA_512)
+DIGEST_UPDATE(SHA512)
+DIGEST_FINAL(SHA512, SHA384_DIGEST_LENGTH)
+#endif
+
+#endif /* !HAVE_OPENSSL_MD5_H && !HAVE_OPENSSL_SHA_H */
+
+#endif /* _WIN32 && !__CYGWIN__ */
diff --git a/archivers/libarchive/files/libarchive/archive_windows.h b/archivers/libarchive/files/libarchive/archive_windows.h
index 9bc21e4de8f..b68e72e9870 100644
--- a/archivers/libarchive/files/libarchive/archive_windows.h
+++ b/archivers/libarchive/files/libarchive/archive_windows.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
* Copyright (c) 2003-2006 Tim Kientzle
* All rights reserved.
*
@@ -26,101 +27,254 @@
* $FreeBSD$
*/
-#ifndef LIBARCHIVE_NONPOSIX_H_INCLUDED
-#define LIBARCHIVE_NONPOSIX_H_INCLUDED
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
+/*
+ * TODO: A lot of stuff in here isn't actually used by libarchive and
+ * can be trimmed out. Note that this file is used by libarchive and
+ * libarchive_test but nowhere else. (But note that it gets compiled
+ * with many different Windows environments, including MinGW, Visual
+ * Studio, and Cygwin. Significant changes should be tested in all three.)
+ */
+
+/*
+ * TODO: Don't use off_t in here. Use __int64 instead. Note that
+ * Visual Studio and the Windows SDK define off_t as 32 bits; Win32's
+ * more modern file handling APIs all use __int64 instead of off_t.
+ */
+
+#ifndef LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED
+#define LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED
/* Start of configuration for native Win32 */
#include <errno.h>
-#define set_errno(val) ((errno)=val)
+#define set_errno(val) ((errno)=val)
#include <io.h>
+#include <stdlib.h> //brings in NULL
+#if defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
+#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <process.h>
#include <direct.h>
+#define NOCRYPT
+#include <windows.h>
+//#define EFTYPE 7
+
+#if !defined(STDIN_FILENO)
+#define STDIN_FILENO 0
+#endif
-#define EFTYPE 7
-#define STDIN_FILENO 0
-#define STDOUT_FILENO 1
-#define STDERR_FILENO 2
+#if !defined(STDOUT_FILENO)
+#define STDOUT_FILENO 1
+#endif
+
+#if !defined(STDERR_FILENO)
+#define STDERR_FILENO 2
+#endif
+
+#if defined(_MSC_VER)
/* TODO: Fix the code, don't suppress the warnings. */
#pragma warning(disable:4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
-#pragma warning(disable:4146) /* unary minus operator applied to unsigned type, result still unsigned */
-#pragma warning(disable:4996) /* 'function': was declared deprecated */
-#pragma warning(disable:4267) /* Conversion, possible loss of data */
-
-/* Basic definitions for system and integer types. */
-#ifndef _SSIZE_T_
-# define SSIZE_MAX LONG_MAX
-#define _SSIZE_T_
-#endif /* _SSIZE_T_ */
+#endif
+#if defined(__BORLANDC__)
+#pragma warn -8068 /* Constant out of range in comparison. */
+#pragma warn -8072 /* Suspicious pointer arithmetic. */
+#endif
#ifndef NULL
#ifdef __cplusplus
-#define NULL 0
+#define NULL 0
#else
-#define NULL ((void *)0)
+#define NULL ((void *)0)
#endif
#endif
-/* Replacement for major/minor/makedev. */
-#define major(x) ((int)(0x00ff & ((x) >> 8)))
-#define minor(x) ((int)(0xffff00ff & (x)))
-#define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
-
-#define EFTYPE 7
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
-#endif /* STDERR_FILENO */
-
/* Alias the Windows _function to the POSIX equivalent. */
-#define chdir _chdir
-#define chmod _chmod
+#define access _access
+#define chdir __la_chdir
+#define chmod __la_chmod
#define close _close
+#define fcntl __la_fcntl
+#ifndef fileno
#define fileno _fileno
-#define fstat _fstat
-#define lseek _lseek
-#define open _open
-#define stat _stat
-#define mkdir(d,m) _mkdir(d)
+#endif
+#define fstat __la_fstat
+#define ftruncate __la_ftruncate
+#define futimes __la_futimes
+#define getcwd _getcwd
+#define link __la_link
+#define lseek __la_lseek
+#define lstat __la_stat
+#define mbstowcs __la_mbstowcs
+#define mkdir(d,m) __la_mkdir(d, m)
#define mktemp _mktemp
-#define read _read
-#define rmdir _rmdir
+#define open __la_open
+#define read __la_read
+#define rmdir __la_rmdir
+#if !defined(__BORLANDC__)
+#define setmode _setmode
+#endif
+#define stat(path,stref) __la_stat(path,stref)
+#if !defined(__BORLANDC__)
#define strdup _strdup
+#endif
#define tzset _tzset
+#if !defined(__BORLANDC__)
#define umask _umask
-#define write _write
+#endif
+#define unlink __la_unlink
+#define utimes __la_utimes
+#define waitpid __la_waitpid
+#define write __la_write
-#define O_RDONLY _O_RDONLY
+#ifndef O_RDONLY
+#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_TRUNC _O_TRUNC
#define O_CREAT _O_CREAT
#define O_EXCL _O_EXCL
+#define O_BINARY _O_BINARY
+#endif
-#define S_ISUID 0004000
-#define S_ISGID 0002000
-#define S_ISVTX 0001000
+#ifndef _S_IFIFO
+ #define _S_IFIFO 0010000 /* pipe */
+#endif
+#ifndef _S_IFCHR
+ #define _S_IFCHR 0020000 /* character special */
+#endif
+#ifndef _S_IFDIR
+ #define _S_IFDIR 0040000 /* directory */
+#endif
+#ifndef _S_IFBLK
+ #define _S_IFBLK 0060000 /* block special */
+#endif
+#ifndef _S_IFLNK
+ #define _S_IFLNK 0120000 /* symbolic link */
+#endif
+#ifndef _S_IFSOCK
+ #define _S_IFSOCK 0140000 /* socket */
+#endif
+#ifndef _S_IFREG
+ #define _S_IFREG 0100000 /* regular */
+#endif
+#ifndef _S_IFMT
+ #define _S_IFMT 0170000 /* file type mask */
+#endif
-#define S_IFMT 0170000
-#define S_IFDIR _S_IFDIR
-#define S_IFREG _S_IFREG
+#ifndef S_IFIFO
+#define S_IFIFO _S_IFIFO
+#endif
+//#define S_IFCHR _S_IFCHR
+//#define S_IFDIR _S_IFDIR
+#ifndef S_IFBLK
+#define S_IFBLK _S_IFBLK
+#endif
+#ifndef S_IFLNK
+#define S_IFLNK _S_IFLNK
+#endif
+#ifndef S_IFSOCK
+#define S_IFSOCK _S_IFSOCK
+#endif
+//#define S_IFREG _S_IFREG
+//#define S_IFMT _S_IFMT
-#define S_ISDIR(m) (((m) & 0170000) == _S_IFDIR) /* directory */
-#define S_ISCHR(m) (((m) & 0170000) == _S_IFCHR) /* char special */
-#define S_ISREG(m) (((m) & 0170000) == _S_IFREG) /* regular file */
+#ifndef S_ISBLK
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* block special */
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo or socket */
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* char special */
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */
+#endif
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* Symbolic link */
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) /* Socket */
-/* Windows doesn't have the following, so they're trivial. */
-#define S_ISBLK(m) (0) /* block special */
-#define S_ISFIFO(m) (0) /* fifo or socket */
-#define S_ISLNK(m) (0) /* Symbolic link */
-#define S_ISSOCK(m) (0) /* Socket */
+#define _S_ISUID 0004000 /* set user id on execution */
+#define _S_ISGID 0002000 /* set group id on execution */
+#define _S_ISVTX 0001000 /* save swapped text even after use */
+#define S_ISUID _S_ISUID
+#define S_ISGID _S_ISGID
+#define S_ISVTX _S_ISVTX
+
+#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
+#define _S_IXUSR _S_IEXEC /* read permission, user */
+#define _S_IWUSR _S_IWRITE /* write permission, user */
+#define _S_IRUSR _S_IREAD /* execute/search permission, user */
+#define _S_IRWXG (_S_IRWXU >> 3)
+#define _S_IXGRP (_S_IXUSR >> 3) /* read permission, group */
+#define _S_IWGRP (_S_IWUSR >> 3) /* write permission, group */
+#define _S_IRGRP (_S_IRUSR >> 3) /* execute/search permission, group */
+#define _S_IRWXO (_S_IRWXG >> 3)
+#define _S_IXOTH (_S_IXGRP >> 3) /* read permission, other */
+#define _S_IWOTH (_S_IWGRP >> 3) /* write permission, other */
+#define _S_IROTH (_S_IRGRP >> 3) /* execute/search permission, other */
+
+#ifndef S_IRWXU
+#define S_IRWXU _S_IRWXU
+#define S_IXUSR _S_IXUSR
+#define S_IWUSR _S_IWUSR
+#define S_IRUSR _S_IRUSR
+#endif
+#define S_IRWXG _S_IRWXG
+#define S_IXGRP _S_IXGRP
+#define S_IWGRP _S_IWGRP
+#define S_IRGRP _S_IRGRP
+#define S_IRWXO _S_IRWXO
+#define S_IXOTH _S_IXOTH
+#define S_IWOTH _S_IWOTH
+#define S_IROTH _S_IROTH
+
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
+#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
+#define F_GETLK 7 /* Get record locking info. */
+#define F_SETLK 8 /* Set record locking info (non-blocking). */
+#define F_SETLKW 9 /* Set record locking info (blocking). */
+
+/* XXX missing */
+#define F_GETLK64 7 /* Get record locking info. */
+#define F_SETLK64 8 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 9 /* Set record locking info (blocking). */
+
+/* File descriptor flags used with F_GETFD and F_SETFD. */
+#define FD_CLOEXEC 1 /* Close on exec. */
+
+//NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else...
+#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
+//#define O_NDELAY O_NONBLOCK
+
+/* Symbolic constants for the access() function */
+#if !defined(F_OK)
+ #define R_OK 4 /* Test for read permission */
+ #define W_OK 2 /* Test for write permission */
+ #define X_OK 1 /* Test for execute permission */
+ #define F_OK 0 /* Test for existence of file */
+#endif
+
+
+#ifdef _LARGEFILE_SOURCE
+# define __USE_LARGEFILE 1 /* declare fseeko and ftello */
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# define __USE_FILE_OFFSET64 1 /* replace 32-bit functions by 64-bit ones */
+#endif
+
+#if __USE_LARGEFILE && __USE_FILE_OFFSET64
/* replace stat and seek by their large-file equivalents */
#undef stat
-#define stat _stati64
-#undef fstat
-#define fstat _fstati64
+#define stat _stati64
#undef lseek
#define lseek _lseeki64
@@ -135,18 +289,134 @@
# define ftello ftello64
# define ftell64 ftello64
#endif /* __MINGW32__ */
+#endif /* LARGE_FILES */
+
+#ifdef USE_WINSOCK_TIMEVAL
+/* Winsock timeval has long size tv_sec. */
+#define __timeval timeval
+#else
+struct _timeval64i32 {
+ time_t tv_sec;
+ long tv_usec;
+};
+#define __timeval _timeval64i32
+#endif
+
+/* Message digest define */
+#if !defined(HAVE_OPENSSL_MD5_H) && !defined(HAVE_OPENSSL_SHA_H)
+# if defined(_MSC_VER) && _MSC_VER < 1300
+# define _WIN32_WINNT 0x0400
+# endif
+#include <wincrypt.h>
+typedef struct {
+ int valid;
+ HCRYPTPROV cryptProv;
+ HCRYPTHASH hash;
+} Digest_CTX;
+#endif
+
+#if !defined(HAVE_OPENSSL_MD5_H) && defined(CALG_MD5)
+#define MD5_DIGEST_LENGTH 16
+#define HAVE_MD5 1
+#define MD5_CTX Digest_CTX
+#endif
+#ifndef HAVE_OPENSSL_SHA_H
+#ifdef CALG_SHA1
+#define SHA1_DIGEST_LENGTH 20
+#define HAVE_SHA1 1
+#define SHA1_CTX Digest_CTX
+#endif
+#ifdef CALG_SHA_256
+#define SHA256_DIGEST_LENGTH 32
+#define HAVE_SHA256 1
+#define SHA256_CTX Digest_CTX
+#endif
+#ifdef CALG_SHA_384
+#define SHA384_DIGEST_LENGTH 48
+#define HAVE_SHA384 1
+#define SHA384_CTX Digest_CTX
+#endif
+#ifdef CALG_SHA_512
+#define SHA512_DIGEST_LENGTH 64
+#define HAVE_SHA512 1
+#define SHA512_CTX Digest_CTX
+#endif
+#endif /* HAVE_OPENSSL_SHA_H */
/* End of Win32 definitions. */
-#ifdef __cplusplus
-extern "C" {
+/* Tell libarchive code that we have simulations for these. */
+#ifndef HAVE_FTRUNCATE
+#define HAVE_FTRUNCATE 1
+#endif
+#ifndef HAVE_FUTIMES
+#define HAVE_FUTIMES 1
+#endif
+#ifndef HAVE_UTIMES
+#define HAVE_UTIMES 1
+#endif
+#ifndef HAVE_LINK
+#define HAVE_LINK 1
#endif
-extern int link (const char *from, const char *to);
-extern int symlink (const char *from, const char *to);
+/* Replacement POSIX function */
+extern int __la_chdir(const char *path);
+extern int __la_chmod(const char *path, mode_t mode);
+extern int __la_fcntl(int fd, int cmd, int val);
+extern int __la_fstat(int fd, struct stat *st);
+extern int __la_ftruncate(int fd, off_t length);
+extern int __la_futimes(int fd, const struct __timeval *times);
+extern int __la_link(const char *src, const char *dst);
+extern __int64 __la_lseek(int fd, __int64 offset, int whence);
+extern size_t __la_mbstowcs(wchar_t *wcstr, const char *mbstr, size_t nwchars);
+extern int __la_mkdir(const char *path, mode_t mode);
+extern int __la_open(const char *path, int flags, ...);
+extern ssize_t __la_read(int fd, void *buf, size_t nbytes);
+extern int __la_rmdir(const char *path);
+extern int __la_stat(const char *path, struct stat *st);
+extern int __la_unlink(const char *path);
+extern int __la_utimes(const char *name, const struct __timeval *times);
+extern pid_t __la_waitpid(pid_t wpid, int *status, int option);
+extern ssize_t __la_write(int fd, const void *buf, size_t nbytes);
-#ifdef __cplusplus
-}
+#define _stat64i32(path, st) __la_stat(path, st)
+#define _stat64(path, st) __la_stat(path, st)
+/* for status returned by la_waitpid */
+#define WIFEXITED(sts) ((sts & 0x100) == 0)
+#define WEXITSTATUS(sts) (sts & 0x0FF)
+
+/* Message digest function */
+#if !defined(HAVE_OPENSSL_MD5_H) && !defined(HAVE_OPENSSL_SHA_H)
+#ifdef MD5_DIGEST_LENGTH
+extern void MD5_Init(Digest_CTX *ctx);
+extern void MD5_Update(Digest_CTX *ctx, const unsigned char *buf,
+ size_t len);
+extern void MD5_Final(unsigned char *buf, Digest_CTX *ctx);
+#endif
+#ifdef SHA1_DIGEST_LENGTH
+extern void SHA1_Init(Digest_CTX *ctx);
+extern void SHA1_Update(Digest_CTX *ctx, const unsigned char *buf,
+ size_t len);
+extern void SHA1_Final(unsigned char *buf, Digest_CTX *ctx);
+#endif
+#ifdef SHA256_DIGEST_LENGTH
+extern void SHA256_Init(Digest_CTX *ctx);
+extern void SHA256_Update(Digest_CTX *ctx, const unsigned char *buf,
+ size_t len);
+extern void SHA256_Final(unsigned char *buf, Digest_CTX *ctx);
+#endif
+#ifdef SHA384_DIGEST_LENGTH
+extern void SHA384_Init(Digest_CTX *ctx);
+extern void SHA384_Update(Digest_CTX *ctx, const unsigned char *buf,
+ size_t len);
+extern void SHA384_Final(unsigned char *buf, Digest_CTX *ctx);
+#endif
+#ifdef SHA512_DIGEST_LENGTH
+extern void SHA512_Init(Digest_CTX *ctx);
+extern void SHA512_Update(Digest_CTX *ctx, const unsigned char *buf,
+ size_t len);
+extern void SHA512_Final(unsigned char *buf, Digest_CTX *ctx);
+#endif
#endif
-#endif /* LIBARCHIVE_NONPOSIX_H_INCLUDED */
+#endif /* LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED */
diff --git a/archivers/libarchive/files/libarchive/archive_write.3 b/archivers/libarchive/files/libarchive/archive_write.3
index 14003f43c36..ffe0c9b45f0 100644
--- a/archivers/libarchive/files/libarchive/archive_write.3
+++ b/archivers/libarchive/files/libarchive/archive_write.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/archive_write.3,v 1.24 2008/05/26 17:00:23 kientzle Exp $
+.\" $FreeBSD: head/lib/libarchive/archive_write.3 201110 2009-12-28 03:31:29Z kientzle $
.\"
.Dd May 11, 2008
.Dt archive_write 3
@@ -43,6 +43,9 @@
.Nm archive_write_set_compression_gzip ,
.Nm archive_write_set_compression_none ,
.Nm archive_write_set_compression_program ,
+.Nm archive_write_set_compressor_options ,
+.Nm archive_write_set_format_options ,
+.Nm archive_write_set_options ,
.Nm archive_write_open ,
.Nm archive_write_open_fd ,
.Nm archive_write_open_FILE ,
@@ -73,10 +76,7 @@
.Ft int
.Fn archive_write_set_compression_none "struct archive *"
.Ft int
-.Fo archive_write_set_compression_program
-.Fa "struct archive *"
-.Fa "const char * cmd"
-.Fc
+.Fn archive_write_set_compression_program "struct archive *" "const char * cmd"
.Ft int
.Fn archive_write_set_format_cpio "struct archive *"
.Ft int
@@ -90,6 +90,12 @@
.Ft int
.Fn archive_write_set_format_ustar "struct archive *"
.Ft int
+.Fn archive_write_set_format_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_compressor_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_options "struct archive *" "const char *"
+.Ft int
.Fo archive_write_open
.Fa "struct archive *"
.Fa "void *client_data"
@@ -210,6 +216,68 @@ Note that the compressed output is always properly blocked.
The archive will be fed into the specified compression program.
The output of that program is blocked and written to the client
write callbacks.
+.It Xo
+.Fn archive_write_set_compressor_options ,
+.Fn archive_write_set_format_options ,
+.Fn archive_write_set_options
+.Xc
+Specifies options that will be passed to the currently-enabled
+compressor and/or format writer.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar option=value
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.It Ar option
+The option will be provided to every module with a value of
+.Dq 1 .
+.It Ar !option
+The option will be provided to every module with a NULL value.
+.It Ar module:option=value , Ar module:option , Ar module:!option
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The return value will be
+.Cm ARCHIVE_OK
+if any module accepts the option, or
+.Cm ARCHIVE_WARN
+if no module accepted the option, or
+.Cm ARCHIVE_FATAL
+if there was a fatal error while attempting to process the option.
+.Pp
+The currently supported options are:
+.Bl -tag -compact -width indent
+.It Compressor gzip
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+gzip compression level.
+.El
+.It Compressor xz
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+compression level.
+.El
+.It Format mtree
+.Bl -tag -compact -width indent
+.It Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname
+Enable a particular keyword in the mtree output.
+Prefix with an exclamation mark to disable the corresponding keyword.
+The default is equivalent to
+.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
+.It Cm all
+Enables all of the above keywords.
+.It Cm use-set
+Enables generation of
+.Cm /set
+lines that specify default values for the following files and/or directories.
+.It Cm indent
+XXX needs explanation XXX
+.El
+.El
.It Fn archive_write_open
Freeze the settings, open the archive, and prepare for writing entries.
This is the most generic form of this function, which accepts
@@ -342,7 +410,7 @@ to register an error code and message and return
.Fo archive_write_callback
.Fa "struct archive *"
.Fa "void *client_data"
-.Fa "void *buffer"
+.Fa "const void *buffer"
.Fa "size_t length"
.Fc
.El
@@ -385,6 +453,9 @@ and
.Xr close 2
system calls.
.Bd -literal -offset indent
+#ifdef __linux__
+#define _FILE_OFFSET_BITS 64
+#endif
#include <sys/stat.h>
#include <archive.h>
#include <archive_entry.h>
@@ -410,7 +481,7 @@ myopen(struct archive *a, void *client_data)
}
ssize_t
-mywrite(struct archive *a, void *client_data, void *buff, size_t n)
+mywrite(struct archive *a, void *client_data, const void *buff, size_t n)
{
struct mydata *mydata = client_data;
diff --git a/archivers/libarchive/files/libarchive/archive_write.c b/archivers/libarchive/files/libarchive/archive_write.c
index 1a3ddc9a5e6..e0d942b0754 100644
--- a/archivers/libarchive/files/libarchive/archive_write.c
+++ b/archivers/libarchive/files/libarchive/archive_write.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write.c,v 1.27 2008/03/14 23:09:02 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write.c 201099 2009-12-28 03:03:00Z kientzle $");
/*
* This file contains the "essential" portions of the write API, that
@@ -72,8 +72,8 @@ archive_write_vtable(void)
static int inited = 0;
if (!inited) {
- av.archive_write_close = _archive_write_close;
- av.archive_write_finish = _archive_write_finish;
+ av.archive_close = _archive_write_close;
+ av.archive_finish = _archive_write_finish;
av.archive_write_header = _archive_write_header;
av.archive_write_finish_entry = _archive_write_finish_entry;
av.archive_write_data = _archive_write_data;
@@ -125,6 +125,115 @@ archive_write_new(void)
}
/*
+ * Set write options for the format. Returns 0 if successful.
+ */
+int
+archive_write_set_format_options(struct archive *_a, const char *s)
+{
+ struct archive_write *a = (struct archive_write *)_a;
+ char key[64], val[64];
+ int len, r, ret = ARCHIVE_OK;
+
+ __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ ARCHIVE_STATE_NEW, "archive_write_set_format_options");
+ archive_clear_error(&a->archive);
+
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
+ if (a->format_options == NULL)
+ /* This format does not support option. */
+ return (ARCHIVE_OK);
+
+ while ((len = __archive_parse_options(s, a->format_name,
+ sizeof(key), key, sizeof(val), val)) > 0) {
+ if (val[0] == '\0')
+ r = a->format_options(a, key, NULL);
+ else
+ r = a->format_options(a, key, val);
+ if (r == ARCHIVE_FATAL)
+ return (r);
+ if (r < ARCHIVE_OK) { /* This key was not handled. */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported option ``%s''", key);
+ ret = ARCHIVE_WARN;
+ }
+ s += len;
+ }
+ if (len < 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Malformed options string.");
+ return (ARCHIVE_WARN);
+ }
+ return (ret);
+}
+
+/*
+ * Set write options for the compressor. Returns 0 if successful.
+ */
+int
+archive_write_set_compressor_options(struct archive *_a, const char *s)
+{
+ struct archive_write *a = (struct archive_write *)_a;
+ char key[64], val[64];
+ int len, r;
+ int ret = ARCHIVE_OK;
+
+ __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ ARCHIVE_STATE_NEW, "archive_write_set_compressor_options");
+ archive_clear_error(&a->archive);
+
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
+ if (a->compressor.options == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported option ``%s''", s);
+ /* This compressor does not support option. */
+ return (ARCHIVE_WARN);
+ }
+
+ while ((len = __archive_parse_options(s, a->archive.compression_name,
+ sizeof(key), key, sizeof(val), val)) > 0) {
+ if (val[0] == '\0')
+ r = a->compressor.options(a, key, NULL);
+ else
+ r = a->compressor.options(a, key, val);
+ if (r == ARCHIVE_FATAL)
+ return (r);
+ if (r < ARCHIVE_OK) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported option ``%s''", key);
+ ret = ARCHIVE_WARN;
+ }
+ s += len;
+ }
+ if (len < 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Illegal format options.");
+ return (ARCHIVE_WARN);
+ }
+ return (ret);
+}
+
+/*
+ * Set write options for the format and the compressor. Returns 0 if successful.
+ */
+int
+archive_write_set_options(struct archive *_a, const char *s)
+{
+ int r1, r2;
+
+ r1 = archive_write_set_format_options(_a, s);
+ if (r1 < ARCHIVE_WARN)
+ return (r1);
+ r2 = archive_write_set_compressor_options(_a, s);
+ if (r2 < ARCHIVE_WARN)
+ return (r2);
+ if (r1 == ARCHIVE_WARN && r2 == ARCHIVE_WARN)
+ return (ARCHIVE_WARN);
+ return (ARCHIVE_OK);
+}
+
+/*
* Set the block size. Returns 0 if successful.
*/
int
@@ -203,7 +312,6 @@ archive_write_open(struct archive *_a, void *client_data,
struct archive_write *a = (struct archive_write *)_a;
int ret;
- ret = ARCHIVE_OK;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_NEW, "archive_write_open");
archive_clear_error(&a->archive);
@@ -314,7 +422,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
if (a->skip_file_dev != 0 &&
archive_entry_dev(entry) == a->skip_file_dev &&
a->skip_file_ino != 0 &&
- archive_entry_ino(entry) == a->skip_file_ino) {
+ archive_entry_ino64(entry) == a->skip_file_ino) {
archive_set_error(&a->archive, 0,
"Can't add archive to itself");
return (ARCHIVE_FAILED);
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk.3 b/archivers/libarchive/files/libarchive/archive_write_disk.3
index d68a0ffca3d..5ed4a5038f1 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk.3
+++ b/archivers/libarchive/files/libarchive/archive_write_disk.3
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/archive_write_disk.3,v 1.3 2008/05/26 17:00:23 kientzle Exp $
+.\" $FreeBSD: src/lib/libarchive/archive_write_disk.3,v 1.4 2008/09/04 05:22:00 kientzle Exp $
.\"
-.Dd March 2, 2007
+.Dd August 5, 2008
.Dt archive_write_disk 3
.Os
.Sh NAME
@@ -169,11 +169,11 @@ The default is to not refuse such paths.
Note that paths ending in
.Pa ..
always cause an error, regardless of this flag.
-.El
.It Cm ARCHIVE_EXTRACT_SPARSE
Scan data for blocks of NUL bytes and try to recreate them with holes.
This results in sparse files, independent of whether the archive format
supports or uses them.
+.El
.It Xo
.Fn archive_write_disk_set_group_lookup ,
.Fn archive_write_disk_set_user_lookup
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk.c b/archivers/libarchive/files/libarchive/archive_write_disk.c
index 238173c42a2..f61ae175925 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk.c
+++ b/archivers/libarchive/files/libarchive/archive_write_disk.c
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19:05:29 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk.c 201159 2009-12-29 05:35:40Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -33,6 +33,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
#ifdef HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
@@ -48,10 +54,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19
#ifdef HAVE_SYS_UTIME_H
#include <sys/utime.h>
#endif
-
-#ifdef HAVE_EXT2FS_EXT2_FS_H
-#include <ext2fs/ext2_fs.h> /* for Linux file flags */
-#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -64,6 +66,16 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h> /* for Linux file flags */
#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h> /* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h> /* Linux file flags, broken on Cygwin */
+#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
@@ -96,10 +108,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19
struct fixup_entry {
struct fixup_entry *next;
mode_t mode;
- int64_t mtime;
int64_t atime;
- unsigned long mtime_nanos;
+ int64_t birthtime;
+ int64_t mtime;
unsigned long atime_nanos;
+ unsigned long birthtime_nanos;
+ unsigned long mtime_nanos;
unsigned long fflags_set;
int fixup; /* bitmask of what needs fixing */
char *name;
@@ -140,6 +154,7 @@ struct archive_write_disk {
uid_t user_uid;
dev_t skip_file_dev;
ino_t skip_file_ino;
+ time_t start_time;
gid_t (*lookup_gid)(void *private, const char *gname, gid_t gid);
void (*cleanup_gid)(void *private);
@@ -175,7 +190,9 @@ struct archive_write_disk {
int fd;
/* Current offset for writing data to the file. */
off_t offset;
- /* Maximum size of file. */
+ /* Last offset actually written to disk. */
+ off_t fd_offset;
+ /* Maximum size of file, -1 if unknown. */
off_t filesize;
/* Dir we were in before this restore; only for deep paths. */
int restore_pwd;
@@ -184,8 +201,6 @@ struct archive_write_disk {
/* UID/GID to use in restoring this entry. */
uid_t uid;
gid_t gid;
- /* Last offset written to disk. */
- off_t last_offset;
};
/*
@@ -226,11 +241,13 @@ static int set_fflags_platform(struct archive_write_disk *, int fd,
unsigned long fflags_set, unsigned long fflags_clear);
static int set_ownership(struct archive_write_disk *);
static int set_mode(struct archive_write_disk *, int mode);
-static int set_time(struct archive_write_disk *);
+static int set_time(int, int, const char *, time_t, long, time_t, long);
+static int set_times(struct archive_write_disk *);
static struct fixup_entry *sort_dir_list(struct fixup_entry *p);
static gid_t trivial_lookup_gid(void *, const char *, gid_t);
static uid_t trivial_lookup_uid(void *, const char *, uid_t);
-
+static ssize_t write_data_block(struct archive_write_disk *,
+ const char *, size_t);
static struct archive_vtable *archive_write_disk_vtable(void);
@@ -273,8 +290,8 @@ archive_write_disk_vtable(void)
static int inited = 0;
if (!inited) {
- av.archive_write_close = _archive_write_close;
- av.archive_write_finish = _archive_write_finish;
+ av.archive_close = _archive_write_close;
+ av.archive_finish = _archive_write_finish;
av.archive_write_header = _archive_write_header;
av.archive_write_finish_entry = _archive_write_finish_entry;
av.archive_write_data = _archive_write_data;
@@ -332,11 +349,14 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
}
a->entry = archive_entry_clone(entry);
a->fd = -1;
- a->last_offset = 0;
+ a->fd_offset = 0;
a->offset = 0;
a->uid = a->user_uid;
a->mode = archive_entry_mode(a->entry);
- a->filesize = archive_entry_size(a->entry);
+ if (archive_entry_size_is_set(a->entry))
+ a->filesize = archive_entry_size(a->entry);
+ else
+ a->filesize = -1;
archive_strcpy(&(a->_name_data), archive_entry_pathname(a->entry));
a->name = a->_name_data.s;
archive_clear_error(&a->archive);
@@ -397,12 +417,16 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
a->mode &= ~S_ISVTX;
a->mode &= ~a->user_umask;
}
+#if !defined(_WIN32) || defined(__CYGWIN__)
if (a->flags & ARCHIVE_EXTRACT_OWNER)
a->todo |= TODO_OWNER;
+#endif
if (a->flags & ARCHIVE_EXTRACT_TIME)
a->todo |= TODO_TIMES;
if (a->flags & ARCHIVE_EXTRACT_ACL)
a->todo |= TODO_ACLS;
+ if (a->flags & ARCHIVE_EXTRACT_XATTR)
+ a->todo |= TODO_XATTR;
if (a->flags & ARCHIVE_EXTRACT_FFLAGS)
a->todo |= TODO_FFLAGS;
if (a->flags & ARCHIVE_EXTRACT_SECURE_SYMLINKS) {
@@ -417,10 +441,24 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
ret = restore_entry(a);
+ /*
+ * TODO: There are rumours that some extended attributes must
+ * be restored before file data is written. If this is true,
+ * then we either need to write all extended attributes both
+ * before and after restoring the data, or find some rule for
+ * determining which must go first and which last. Due to the
+ * many ways people are using xattrs, this may prove to be an
+ * intractable problem.
+ */
+
#ifdef HAVE_FCHDIR
/* If we changed directory above, restore it here. */
if (a->restore_pwd >= 0) {
- fchdir(a->restore_pwd);
+ r = fchdir(a->restore_pwd);
+ if (r != 0) {
+ archive_set_error(&a->archive, errno, "chdir() failure");
+ ret = ARCHIVE_FATAL;
+ }
close(a->restore_pwd);
a->restore_pwd = -1;
}
@@ -438,13 +476,35 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
fe->mode = a->mode;
}
- if (a->deferred & TODO_TIMES) {
+ if ((a->deferred & TODO_TIMES)
+ && (archive_entry_mtime_is_set(entry)
+ || archive_entry_atime_is_set(entry))) {
fe = current_fixup(a, archive_entry_pathname(entry));
fe->fixup |= TODO_TIMES;
- fe->mtime = archive_entry_mtime(entry);
- fe->mtime_nanos = archive_entry_mtime_nsec(entry);
- fe->atime = archive_entry_atime(entry);
- fe->atime_nanos = archive_entry_atime_nsec(entry);
+ if (archive_entry_atime_is_set(entry)) {
+ fe->atime = archive_entry_atime(entry);
+ fe->atime_nanos = archive_entry_atime_nsec(entry);
+ } else {
+ /* If atime is unset, use start time. */
+ fe->atime = a->start_time;
+ fe->atime_nanos = 0;
+ }
+ if (archive_entry_mtime_is_set(entry)) {
+ fe->mtime = archive_entry_mtime(entry);
+ fe->mtime_nanos = archive_entry_mtime_nsec(entry);
+ } else {
+ /* If mtime is unset, use start time. */
+ fe->mtime = a->start_time;
+ fe->mtime_nanos = 0;
+ }
+ if (archive_entry_birthtime_is_set(entry)) {
+ fe->birthtime = archive_entry_birthtime(entry);
+ fe->birthtime_nanos = archive_entry_birthtime_nsec(entry);
+ } else {
+ /* If birthtime is unset, use mtime. */
+ fe->birthtime = fe->mtime;
+ fe->birthtime_nanos = fe->mtime_nanos;
+ }
}
if (a->deferred & TODO_FFLAGS) {
@@ -454,7 +514,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
}
/* We've created the object and are ready to pour data into it. */
- if (ret == ARCHIVE_OK)
+ if (ret >= ARCHIVE_WARN)
a->archive.state = ARCHIVE_STATE_DATA;
/*
* If it's not open, tell our client not to try writing.
@@ -483,87 +543,125 @@ archive_write_disk_set_skip_file(struct archive *_a, dev_t d, ino_t i)
}
static ssize_t
-_archive_write_data_block(struct archive *_a,
- const void *buff, size_t size, off_t offset)
+write_data_block(struct archive_write_disk *a, const char *buff, size_t size)
{
- struct archive_write_disk *a = (struct archive_write_disk *)_a;
+ uint64_t start_size = size;
ssize_t bytes_written = 0;
- ssize_t block_size, bytes_to_write;
- int r = ARCHIVE_OK;
+ ssize_t block_size = 0, bytes_to_write;
- __archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
- ARCHIVE_STATE_DATA, "archive_write_disk_block");
- if (a->fd < 0) {
- archive_set_error(&a->archive, 0, "File not open");
+ if (size == 0)
+ return (ARCHIVE_OK);
+
+ if (a->filesize == 0 || a->fd < 0) {
+ archive_set_error(&a->archive, 0,
+ "Attempt to write to an empty file");
return (ARCHIVE_WARN);
}
- archive_clear_error(&a->archive);
if (a->flags & ARCHIVE_EXTRACT_SPARSE) {
+#if HAVE_STRUCT_STAT_ST_BLKSIZE
+ int r;
if ((r = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK)
return (r);
block_size = a->pst->st_blksize;
- } else
- block_size = -1;
-
- if ((off_t)(offset + size) > a->filesize) {
- size = (size_t)(a->filesize - a->offset);
- archive_set_error(&a->archive, 0,
- "Write request too large");
- r = ARCHIVE_WARN;
+#else
+ /* XXX TODO XXX Is there a more appropriate choice here ? */
+ /* This needn't match the filesystem allocation size. */
+ block_size = 16*1024;
+#endif
}
+ /* If this write would run beyond the file size, truncate it. */
+ if (a->filesize >= 0 && (off_t)(a->offset + size) > a->filesize)
+ start_size = size = (size_t)(a->filesize - a->offset);
+
/* Write the data. */
while (size > 0) {
- if (block_size != -1) {
- const char *buf;
+ if (block_size == 0) {
+ bytes_to_write = size;
+ } else {
+ /* We're sparsifying the file. */
+ const char *p, *end;
+ off_t block_end;
- for (buf = buff; size; ++buf, --size, ++offset) {
- if (*buf != '\0')
+ /* Skip leading zero bytes. */
+ for (p = buff, end = buff + size; p < end; ++p) {
+ if (*p != '\0')
break;
}
+ a->offset += p - buff;
+ size -= p - buff;
+ buff = p;
if (size == 0)
break;
- bytes_to_write = block_size - offset % block_size;
- buff = buf;
- } else
+
+ /* Calculate next block boundary after offset. */
+ block_end
+ = (a->offset / block_size + 1) * block_size;
+
+ /* If the adjusted write would cross block boundary,
+ * truncate it to the block boundary. */
bytes_to_write = size;
+ if (a->offset + bytes_to_write > block_end)
+ bytes_to_write = block_end - a->offset;
+ }
/* Seek if necessary to the specified offset. */
- if (offset != a->last_offset) {
- if (lseek(a->fd, offset, SEEK_SET) < 0) {
- archive_set_error(&a->archive, errno, "Seek failed");
+ if (a->offset != a->fd_offset) {
+ if (lseek(a->fd, a->offset, SEEK_SET) < 0) {
+ archive_set_error(&a->archive, errno,
+ "Seek failed");
return (ARCHIVE_FATAL);
}
+ a->fd_offset = a->offset;
+ a->archive.file_position = a->offset;
+ a->archive.raw_position = a->offset;
}
- bytes_written = write(a->fd, buff, size);
+ bytes_written = write(a->fd, buff, bytes_to_write);
if (bytes_written < 0) {
archive_set_error(&a->archive, errno, "Write failed");
return (ARCHIVE_WARN);
}
- buff = (const char *)buff + bytes_written;
+ buff += bytes_written;
size -= bytes_written;
- offset += bytes_written;
- a->last_offset = a->offset = offset;
+ a->offset += bytes_written;
+ a->archive.file_position += bytes_written;
+ a->archive.raw_position += bytes_written;
+ a->fd_offset = a->offset;
}
+ return (start_size - size);
+}
+
+static ssize_t
+_archive_write_data_block(struct archive *_a,
+ const void *buff, size_t size, off_t offset)
+{
+ struct archive_write_disk *a = (struct archive_write_disk *)_a;
+ ssize_t r;
+
+ __archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
+ ARCHIVE_STATE_DATA, "archive_write_disk_block");
+
a->offset = offset;
- return (r);
+ r = write_data_block(a, buff, size);
+ if (r < ARCHIVE_OK)
+ return (r);
+ if ((size_t)r < size) {
+ archive_set_error(&a->archive, 0,
+ "Write request too large");
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
}
static ssize_t
_archive_write_data(struct archive *_a, const void *buff, size_t size)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
- int r;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_data");
- if (a->fd < 0)
- return (ARCHIVE_OK);
- r = _archive_write_data_block(_a, buff, size, a->offset);
- if (r < ARCHIVE_OK)
- return (r);
- return size;
+ return (write_data_block(a, buff, size));
}
static int
@@ -579,24 +677,38 @@ _archive_write_finish_entry(struct archive *_a)
return (ARCHIVE_OK);
archive_clear_error(&a->archive);
- if (a->last_offset != a->filesize && a->fd >= 0) {
+ /* Pad or truncate file to the right size. */
+ if (a->fd < 0) {
+ /* There's no file. */
+ } else if (a->filesize < 0) {
+ /* File size is unknown, so we can't set the size. */
+ } else if (a->fd_offset == a->filesize) {
+ /* Last write ended at exactly the filesize; we're done. */
+ /* Hopefully, this is the common case. */
+ } else {
+#if HAVE_FTRUNCATE
if (ftruncate(a->fd, a->filesize) == -1 &&
a->filesize == 0) {
archive_set_error(&a->archive, errno,
"File size could not be restored");
return (ARCHIVE_FAILED);
}
+#endif
/*
- * Explicitly stat the file as some platforms might not
- * implement the XSI option to extend files via ftruncate.
+ * Not all platforms implement the XSI option to
+ * extend files via ftruncate. Stat() the file again
+ * to see what happened.
*/
a->pst = NULL;
if ((ret = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK)
return (ret);
- if (a->st.st_size != a->filesize) {
+ /* We can use lseek()/write() to extend the file if
+ * ftruncate didn't work or isn't available. */
+ if (a->st.st_size < a->filesize) {
const char nul = '\0';
- if (lseek(a->fd, a->st.st_size - 1, SEEK_SET) < 0) {
- archive_set_error(&a->archive, errno, "Seek failed");
+ if (lseek(a->fd, a->filesize - 1, SEEK_SET) < 0) {
+ archive_set_error(&a->archive, errno,
+ "Seek failed");
return (ARCHIVE_FATAL);
}
if (write(a->fd, &nul, 1) < 0) {
@@ -604,6 +716,7 @@ _archive_write_finish_entry(struct archive *_a)
"Write to restore size failed");
return (ARCHIVE_FATAL);
}
+ a->pst = NULL;
}
}
@@ -636,22 +749,37 @@ _archive_write_finish_entry(struct archive *_a)
int r2 = set_mode(a, a->mode);
if (r2 < ret) ret = r2;
}
- if (a->todo & TODO_TIMES) {
- int r2 = set_time(a);
- if (r2 < ret) ret = r2;
- }
if (a->todo & TODO_ACLS) {
int r2 = set_acls(a);
if (r2 < ret) ret = r2;
}
+
+ /*
+ * Security-related extended attributes (such as
+ * security.capability on Linux) have to be restored last,
+ * since they're implicitly removed by other file changes.
+ */
if (a->todo & TODO_XATTR) {
int r2 = set_xattrs(a);
if (r2 < ret) ret = r2;
}
+
+ /*
+ * Some flags prevent file modification; they must be restored after
+ * file contents are written.
+ */
if (a->todo & TODO_FFLAGS) {
int r2 = set_fflags(a);
if (r2 < ret) ret = r2;
}
+ /*
+ * Time has to be restored after all other metadata;
+ * otherwise atime will get changed.
+ */
+ if (a->todo & TODO_TIMES) {
+ int r2 = set_times(a);
+ if (r2 < ret) ret = r2;
+ }
/* If there's an fd, we can close it now. */
if (a->fd >= 0) {
@@ -718,6 +846,7 @@ archive_write_disk_new(void)
a->archive.vtable = archive_write_disk_vtable();
a->lookup_uid = trivial_lookup_uid;
a->lookup_gid = trivial_lookup_gid;
+ a->start_time = time(NULL);
#ifdef HAVE_GETEUID
a->user_uid = geteuid();
#endif /* HAVE_GETEUID */
@@ -768,7 +897,7 @@ edit_deep_directories(struct archive_write_disk *a)
*tail = '\0'; /* Terminate dir portion */
ret = create_dir(a, a->name);
if (ret == ARCHIVE_OK && chdir(a->name) != 0)
- ret = ARCHIVE_WARN;
+ ret = ARCHIVE_FAILED;
*tail = '/'; /* Restore the / we removed. */
if (ret != ARCHIVE_OK)
return;
@@ -809,7 +938,7 @@ restore_entry(struct archive_write_disk *a)
/* We tried, but couldn't get rid of it. */
archive_set_error(&a->archive, errno,
"Could not unlink");
- return(ARCHIVE_WARN);
+ return(ARCHIVE_FAILED);
}
}
@@ -828,7 +957,7 @@ restore_entry(struct archive_write_disk *a)
&& (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) {
/* If we're not overwriting, we're done. */
archive_set_error(&a->archive, en, "Already exists");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
/*
@@ -843,7 +972,7 @@ restore_entry(struct archive_write_disk *a)
if (rmdir(a->name) != 0) {
archive_set_error(&a->archive, errno,
"Can't remove already-existing dir");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
a->pst = NULL;
/* Try again. */
@@ -853,15 +982,31 @@ restore_entry(struct archive_write_disk *a)
* We know something is in the way, but we don't know what;
* we need to find out before we go any further.
*/
- if (lstat(a->name, &a->st) != 0) {
+ int r = 0;
+ /*
+ * The SECURE_SYMLINK logic has already removed a
+ * symlink to a dir if the client wants that. So
+ * follow the symlink if we're creating a dir.
+ */
+ if (S_ISDIR(a->mode))
+ r = stat(a->name, &a->st);
+ /*
+ * If it's not a dir (or it's a broken symlink),
+ * then don't follow it.
+ */
+ if (r != 0 || !S_ISDIR(a->mode))
+ r = lstat(a->name, &a->st);
+ if (r != 0) {
archive_set_error(&a->archive, errno,
"Can't stat existing object");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
- /* TODO: if it's a symlink... */
-
- if (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER) {
+ /*
+ * NO_OVERWRITE_NEWER doesn't apply to directories.
+ */
+ if ((a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER)
+ && !S_ISDIR(a->st.st_mode)) {
if (!older(&(a->st), a->entry)) {
archive_set_error(&a->archive, 0,
"File on disk is not older; skipping.");
@@ -883,7 +1028,7 @@ restore_entry(struct archive_write_disk *a)
if (unlink(a->name) != 0) {
archive_set_error(&a->archive, errno,
"Can't unlink already-existing object");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
a->pst = NULL;
/* Try again. */
@@ -893,7 +1038,7 @@ restore_entry(struct archive_write_disk *a)
if (rmdir(a->name) != 0) {
archive_set_error(&a->archive, errno,
"Can't remove already-existing dir");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
/* Try again. */
en = create_filesystem_object(a);
@@ -915,8 +1060,9 @@ restore_entry(struct archive_write_disk *a)
if (en) {
/* Everything failed; give up here. */
- archive_set_error(&a->archive, en, "Can't create '%s'", a->name);
- return (ARCHIVE_WARN);
+ archive_set_error(&a->archive, en, "Can't create '%s'",
+ a->name);
+ return (ARCHIVE_FAILED);
}
a->pst = NULL; /* Cached stat data no longer valid. */
@@ -928,7 +1074,7 @@ restore_entry(struct archive_write_disk *a)
* the failed system call. Note: This function should only ever perform
* a single system call.
*/
-int
+static int
create_filesystem_object(struct archive_write_disk *a)
{
/* Create the entry. */
@@ -940,6 +1086,9 @@ create_filesystem_object(struct archive_write_disk *a)
/* Since link(2) and symlink(2) don't handle modes, we're done here. */
linkname = archive_entry_hardlink(a->entry);
if (linkname != NULL) {
+#if !HAVE_LINK
+ return (EPERM);
+#else
r = link(linkname, a->name) ? errno : 0;
/*
* New cpio and pax formats allow hardlink entries
@@ -953,7 +1102,7 @@ create_filesystem_object(struct archive_write_disk *a)
* If the hardlink does carry data, let the last
* archive entry decide ownership.
*/
- if (r == 0 && a->filesize == 0) {
+ if (r == 0 && a->filesize <= 0) {
a->todo = 0;
a->deferred = 0;
} if (r == 0 && a->filesize > 0) {
@@ -962,10 +1111,16 @@ create_filesystem_object(struct archive_write_disk *a)
r = errno;
}
return (r);
+#endif
}
linkname = archive_entry_symlink(a->entry);
- if (linkname != NULL)
+ if (linkname != NULL) {
+#if HAVE_SYMLINK
return symlink(linkname, a->name) ? errno : 0;
+#else
+ return (EPERM);
+#endif
+ }
/*
* The remaining system calls all set permissions, so let's
@@ -997,22 +1152,22 @@ create_filesystem_object(struct archive_write_disk *a)
* S_IFCHR for the mknod() call. This is correct. */
r = mknod(a->name, mode | S_IFCHR,
archive_entry_rdev(a->entry));
+ break;
#else
/* TODO: Find a better way to warn about our inability
* to restore a char device node. */
return (EINVAL);
#endif /* HAVE_MKNOD */
- break;
case AE_IFBLK:
#ifdef HAVE_MKNOD
r = mknod(a->name, mode | S_IFBLK,
archive_entry_rdev(a->entry));
+ break;
#else
/* TODO: Find a better way to warn about our inability
* to restore a block device node. */
return (EINVAL);
#endif /* HAVE_MKNOD */
- break;
case AE_IFDIR:
mode = (mode | MINIMUM_DIR_MODE) & MAXIMUM_DIR_MODE;
r = mkdir(a->name, mode);
@@ -1032,12 +1187,12 @@ create_filesystem_object(struct archive_write_disk *a)
case AE_IFIFO:
#ifdef HAVE_MKFIFO
r = mkfifo(a->name, mode);
+ break;
#else
/* TODO: Find a better way to warn about our inability
* to restore a fifo. */
return (EINVAL);
#endif /* HAVE_MKFIFO */
- break;
}
/* All the system calls above set errno on failure. */
@@ -1091,11 +1246,24 @@ _archive_write_close(struct archive *_a)
if (p->fixup & TODO_TIMES) {
#ifdef HAVE_UTIMES
/* {f,l,}utimes() are preferred, when available. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ struct __timeval times[2];
+#else
struct timeval times[2];
- times[1].tv_sec = p->mtime;
- times[1].tv_usec = p->mtime_nanos / 1000;
+#endif
times[0].tv_sec = p->atime;
times[0].tv_usec = p->atime_nanos / 1000;
+#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
+ /* if it's valid and not mtime, push the birthtime first */
+ if (((times[1].tv_sec = p->birthtime) < p->mtime) &&
+ (p->birthtime > 0))
+ {
+ times[1].tv_usec = p->birthtime_nanos / 1000;
+ utimes(p->name, times);
+ }
+#endif
+ times[1].tv_sec = p->mtime;
+ times[1].tv_usec = p->mtime_nanos / 1000;
#ifdef HAVE_LUTIMES
lutimes(p->name, times);
#else
@@ -1136,6 +1304,8 @@ _archive_write_finish(struct archive *_a)
(a->cleanup_gid)(a->lookup_gid_data);
if (a->cleanup_uid != NULL && a->lookup_uid_data != NULL)
(a->cleanup_uid)(a->lookup_uid_data);
+ if (a->entry)
+ archive_entry_free(a->entry);
archive_string_free(&a->_name_data);
archive_string_free(&a->archive.error_string);
archive_string_free(&a->path_safe);
@@ -1250,9 +1420,15 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
* scan the path and both can be optimized by comparing against other
* recent paths.
*/
+/* TODO: Extend this to support symlinks on Windows Vista and later. */
static int
check_symlinks(struct archive_write_disk *a)
{
+#if !defined(HAVE_LSTAT)
+ /* Platform doesn't have lstat, so we can't look for symlinks. */
+ (void)a; /* UNUSED */
+ return (ARCHIVE_OK);
+#else
char *pn, *p;
char c;
int r;
@@ -1293,7 +1469,7 @@ check_symlinks(struct archive_write_disk *a)
"Could not remove symlink %s",
a->name);
pn[0] = c;
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
a->pst = NULL;
/*
@@ -1317,7 +1493,7 @@ check_symlinks(struct archive_write_disk *a)
"Cannot remove intervening symlink %s",
a->name);
pn[0] = c;
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
a->pst = NULL;
} else {
@@ -1325,7 +1501,7 @@ check_symlinks(struct archive_write_disk *a)
"Cannot extract through symlink %s",
a->name);
pn[0] = c;
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
}
}
@@ -1333,7 +1509,59 @@ check_symlinks(struct archive_write_disk *a)
/* We've checked and/or cleaned the whole path, so remember it. */
archive_strcpy(&a->path_safe, a->name);
return (ARCHIVE_OK);
+#endif
+}
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+/*
+ * 1. Convert a path separator from '\' to '/' .
+ * We shouldn't check multi-byte character directly because some
+ * character-set have been using the '\' character for a part of
+ * its multibyte character code.
+ * 2. Replace unusable characters in Windows with underscore('_').
+ * See also : http://msdn.microsoft.com/en-us/library/aa365247.aspx
+ */
+static void
+cleanup_pathname_win(struct archive_write_disk *a)
+{
+ wchar_t wc;
+ char *p;
+ size_t alen, l;
+
+ alen = 0;
+ l = 0;
+ for (p = a->name; *p != '\0'; p++) {
+ ++alen;
+ if (*p == '\\')
+ l = 1;
+ /* Rewrite the path name if its character is a unusable. */
+ if (*p == ':' || *p == '*' || *p == '?' || *p == '"' ||
+ *p == '<' || *p == '>' || *p == '|')
+ *p = '_';
+ }
+ if (alen == 0 || l == 0)
+ return;
+ /*
+ * Convert path separator.
+ */
+ p = a->name;
+ while (*p != '\0' && alen) {
+ l = mbtowc(&wc, p, alen);
+ if (l == -1) {
+ while (*p != '\0') {
+ if (*p == '\\')
+ *p = '/';
+ ++p;
+ }
+ break;
+ }
+ if (l == 1 && wc == L'\\')
+ *p = '/';
+ p += l;
+ alen -= l;
+ }
}
+#endif
/*
* Canonicalize the pathname. In particular, this strips duplicate
@@ -1346,7 +1574,6 @@ cleanup_pathname(struct archive_write_disk *a)
{
char *dest, *src;
char separator = '\0';
- int lastdotdot = 0; /* True if last elt copied was '..' */
dest = src = a->name;
if (*src == '\0') {
@@ -1355,6 +1582,9 @@ cleanup_pathname(struct archive_write_disk *a)
return (ARCHIVE_FAILED);
}
+#if defined(_WIN32) || defined(__CYGWIN__)
+ cleanup_pathname_win(a);
+#endif
/* Skip leading '/'. */
if (*src == '/')
separator = *src++;
@@ -1385,9 +1615,7 @@ cleanup_pathname(struct archive_write_disk *a)
"Path contains '..'");
return (ARCHIVE_FAILED);
}
- lastdotdot = 1;
- } else
- lastdotdot = 0;
+ }
/*
* Note: Under no circumstances do we
* remove '..' elements. In
@@ -1395,10 +1623,8 @@ cleanup_pathname(struct archive_write_disk *a)
* '/foo/../bar/' should create the
* 'foo' dir as a side-effect.
*/
- } else
- lastdotdot = 0;
- } else
- lastdotdot = 0;
+ }
+ }
/* Copy current element, including leading '/'. */
if (separator)
@@ -1417,13 +1643,6 @@ cleanup_pathname(struct archive_write_disk *a)
* We've just copied zero or more path elements, not including the
* final '/'.
*/
- if (lastdotdot) {
- /* Trailing '..' is always wrong. */
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_MISC,
- "Path contains trailing '..'");
- return (ARCHIVE_FAILED);
- }
if (dest == a->name) {
/*
* Nothing got copied. The path must have been something
@@ -1463,7 +1682,7 @@ create_parent_dir(struct archive_write_disk *a, char *path)
* Create the specified dir, recursing to create parents as necessary.
*
* Returns ARCHIVE_OK if the path exists when we're done here.
- * Otherwise, returns ARCHIVE_WARN.
+ * Otherwise, returns ARCHIVE_FAILED.
* Assumes path is in mutable storage; path is unchanged on exit.
*/
static int
@@ -1475,8 +1694,6 @@ create_dir(struct archive_write_disk *a, char *path)
mode_t mode_final, mode;
int r;
- r = ARCHIVE_OK;
-
/* Check for special names and just skip them. */
slash = strrchr(path, '/');
if (slash == NULL)
@@ -1508,18 +1725,18 @@ create_dir(struct archive_write_disk *a, char *path)
if ((a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) {
archive_set_error(&a->archive, EEXIST,
"Can't create directory '%s'", path);
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
if (unlink(path) != 0) {
archive_set_error(&a->archive, errno,
"Can't create directory '%s': "
"Conflicting file cannot be removed");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
} else if (errno != ENOENT && errno != ENOTDIR) {
/* Stat failed? */
archive_set_error(&a->archive, errno, "Can't test directory '%s'", path);
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
} else if (slash != NULL) {
*slash = '\0';
r = create_dir(a, path);
@@ -1559,8 +1776,9 @@ create_dir(struct archive_write_disk *a, char *path)
if (stat(path, &st) == 0 && S_ISDIR(st.st_mode))
return (ARCHIVE_OK);
- archive_set_error(&a->archive, errno, "Failed to create dir '%s'", path);
- return (ARCHIVE_WARN);
+ archive_set_error(&a->archive, errno, "Failed to create dir '%s'",
+ path);
+ return (ARCHIVE_FAILED);
}
/*
@@ -1576,12 +1794,17 @@ create_dir(struct archive_write_disk *a, char *path)
static int
set_ownership(struct archive_write_disk *a)
{
+#ifndef __CYGWIN__
+/* unfortunately, on win32 there is no 'root' user with uid 0,
+ so we just have to try the chown and see if it works */
+
/* If we know we can't change it, don't bother trying. */
if (a->user_uid != 0 && a->user_uid != a->uid) {
archive_set_error(&a->archive, errno,
"Can't set UID=%d", a->uid);
return (ARCHIVE_WARN);
}
+#endif
#ifdef HAVE_FCHOWN
/* If we have an fd, we can avoid a race. */
@@ -1614,48 +1837,62 @@ set_ownership(struct archive_write_disk *a)
return (ARCHIVE_WARN);
}
-#ifdef HAVE_UTIMES
+
+#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS)
+/*
+ * utimensat() and futimens() are defined in POSIX.1-2008. They provide ns
+ * resolution and setting times on fd and on symlinks, too.
+ */
+static int
+set_time(int fd, int mode, const char *name,
+ time_t atime, long atime_nsec,
+ time_t mtime, long mtime_nsec)
+{
+ struct timespec ts[2];
+ ts[0].tv_sec = atime;
+ ts[0].tv_nsec = atime_nsec;
+ ts[1].tv_sec = mtime;
+ ts[1].tv_nsec = mtime_nsec;
+ if (fd >= 0)
+ return futimens(fd, ts);
+ return utimensat(AT_FDCWD, name, ts, AT_SYMLINK_NOFOLLOW);
+}
+#elif HAVE_UTIMES
/*
- * The utimes()-family functions provide high resolution and
+ * The utimes()-family functions provide µs-resolution and
* a way to set time on an fd or a symlink. We prefer them
- * when they're available.
+ * when they're available and utimensat/futimens aren't there.
*/
static int
-set_time(struct archive_write_disk *a)
+set_time(int fd, int mode, const char *name,
+ time_t atime, long atime_nsec,
+ time_t mtime, long mtime_nsec)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ struct __timeval times[2];
+#else
struct timeval times[2];
+#endif
- times[1].tv_sec = archive_entry_mtime(a->entry);
- times[1].tv_usec = archive_entry_mtime_nsec(a->entry) / 1000;
-
- times[0].tv_sec = archive_entry_atime(a->entry);
- times[0].tv_usec = archive_entry_atime_nsec(a->entry) / 1000;
+ times[0].tv_sec = atime;
+ times[0].tv_usec = atime_nsec / 1000;
+ times[1].tv_sec = mtime;
+ times[1].tv_usec = mtime_nsec / 1000;
#ifdef HAVE_FUTIMES
- if (a->fd >= 0 && futimes(a->fd, times) == 0) {
- return (ARCHIVE_OK);
- }
+ if (fd >= 0)
+ return (futimes(fd, times));
+#else
+ (void)fd; /* UNUSED */
#endif
-
#ifdef HAVE_LUTIMES
- if (lutimes(a->name, times) != 0)
+ (void)mode; /* UNUSED */
+ return (lutimes(name, times));
#else
- if (!S_ISLNK(a->mode) && utimes(a->name, times) != 0)
+ if (S_ISLNK(mode))
+ return (0);
+ return (utimes(name, times));
#endif
- {
- archive_set_error(&a->archive, errno, "Can't update time for %s",
- a->name);
- return (ARCHIVE_WARN);
- }
-
- /*
- * Note: POSIX does not provide a portable way to restore ctime.
- * (Apart from resetting the system clock, which is distasteful.)
- * So, any restoration of ctime will necessarily be OS-specific.
- */
-
- /* XXX TODO: Can FreeBSD restore ctime? XXX */
- return (ARCHIVE_OK);
}
#elif defined(HAVE_UTIME)
/*
@@ -1663,31 +1900,93 @@ set_time(struct archive_write_disk *a)
* if utimes() isn't available.
*/
static int
-set_time(struct archive_write_disk *a)
+set_time(int fd, int mode, const char *name,
+ time_t atime, long atime_nsec,
+ time_t mtime, long mtime_nsec)
{
struct utimbuf times;
-
- times.modtime = archive_entry_mtime(a->entry);
- times.actime = archive_entry_atime(a->entry);
- if (!S_ISLNK(a->mode) && utime(a->name, &times) != 0) {
- archive_set_error(&a->archive, errno,
- "Can't update time for %s", a->name);
- return (ARCHIVE_WARN);
- }
- return (ARCHIVE_OK);
+ (void)fd; /* UNUSED */
+ (void)name; /* UNUSED */
+ (void)atime_nsec; /* UNUSED */
+ (void)mtime_nsec; /* UNUSED */
+ times.actime = atime;
+ times.modtime = mtime;
+ if (S_ISLNK(mode))
+ return (ARCHIVE_OK);
+ return (utime(name, &times));
}
#else
-/* This platform doesn't give us a way to restore the time. */
static int
-set_time(struct archive_write_disk *a)
+set_time(int fd, int mode, const char *name,
+ time_t atime, long atime_nsec,
+ time_t mtime, long mtime_nsec)
{
- (void)a; /* UNUSED */
- archive_set_error(&a->archive, errno,
- "Can't update time for %s", a->name);
return (ARCHIVE_WARN);
}
#endif
+static int
+set_times(struct archive_write_disk *a)
+{
+ time_t atime = a->start_time, mtime = a->start_time;
+ long atime_nsec = 0, mtime_nsec = 0;
+
+ /* If no time was provided, we're done. */
+ if (!archive_entry_atime_is_set(a->entry)
+#if HAVE_STRUCT_STAT_ST_BIRTHTIME
+ && !archive_entry_birthtime_is_set(a->entry)
+#endif
+ && !archive_entry_mtime_is_set(a->entry))
+ return (ARCHIVE_OK);
+
+ /* If no atime was specified, use start time instead. */
+ /* In theory, it would be marginally more correct to use
+ * time(NULL) here, but that would cost us an extra syscall
+ * for little gain. */
+ if (archive_entry_atime_is_set(a->entry)) {
+ atime = archive_entry_atime(a->entry);
+ atime_nsec = archive_entry_atime_nsec(a->entry);
+ }
+
+ /*
+ * If you have struct stat.st_birthtime, we assume BSD birthtime
+ * semantics, in which {f,l,}utimes() updates birthtime to earliest
+ * mtime. So we set the time twice, first using the birthtime,
+ * then using the mtime.
+ */
+#if HAVE_STRUCT_STAT_ST_BIRTHTIME
+ /* If birthtime is set, flush that through to disk first. */
+ if (archive_entry_birthtime_is_set(a->entry))
+ if (set_time(a->fd, a->mode, a->name, atime, atime_nsec,
+ archive_entry_birthtime(a->entry),
+ archive_entry_birthtime_nsec(a->entry))) {
+ archive_set_error(&a->archive, errno,
+ "Can't update time for %s",
+ a->name);
+ return (ARCHIVE_WARN);
+ }
+#endif
+
+ if (archive_entry_mtime_is_set(a->entry)) {
+ mtime = archive_entry_mtime(a->entry);
+ mtime_nsec = archive_entry_mtime_nsec(a->entry);
+ }
+ if (set_time(a->fd, a->mode, a->name,
+ atime, atime_nsec, mtime, mtime_nsec)) {
+ archive_set_error(&a->archive, errno,
+ "Can't update time for %s",
+ a->name);
+ return (ARCHIVE_WARN);
+ }
+
+ /*
+ * Note: POSIX does not provide a portable way to restore ctime.
+ * (Apart from resetting the system clock, which is distasteful.)
+ * So, any restoration of ctime will necessarily be OS-specific.
+ */
+
+ return (ARCHIVE_OK);
+}
static int
set_mode(struct archive_write_disk *a, int mode)
@@ -1706,6 +2005,7 @@ set_mode(struct archive_write_disk *a, int mode)
return (r);
if (a->pst->st_gid != a->gid) {
mode &= ~ S_ISGID;
+#if !defined(_WIN32) || defined(__CYGWIN__)
if (a->flags & ARCHIVE_EXTRACT_OWNER) {
/*
* This is only an error if you
@@ -1718,16 +2018,19 @@ set_mode(struct archive_write_disk *a, int mode)
"Can't restore SGID bit");
r = ARCHIVE_WARN;
}
+#endif
}
/* While we're here, double-check the UID. */
if (a->pst->st_uid != a->uid
&& (a->todo & TODO_SUID)) {
mode &= ~ S_ISUID;
+#if !defined(_WIN32) || defined(__CYGWIN__)
if (a->flags & ARCHIVE_EXTRACT_OWNER) {
archive_set_error(&a->archive, -1,
"Can't restore SUID bit");
r = ARCHIVE_WARN;
}
+#endif
}
a->todo &= ~TODO_SGID_CHECK;
a->todo &= ~TODO_SUID_CHECK;
@@ -1739,11 +2042,13 @@ set_mode(struct archive_write_disk *a, int mode)
*/
if (a->user_uid != a->uid) {
mode &= ~ S_ISUID;
+#if !defined(_WIN32) || defined(__CYGWIN__)
if (a->flags & ARCHIVE_EXTRACT_OWNER) {
archive_set_error(&a->archive, -1,
"Can't make file SUID");
r = ARCHIVE_WARN;
}
+#endif
}
a->todo &= ~TODO_SUID_CHECK;
}
@@ -1861,7 +2166,10 @@ set_fflags(struct archive_write_disk *a)
}
-#if ( defined(HAVE_LCHFLAGS) || defined(HAVE_CHFLAGS) || defined(HAVE_FCHFLAGS) ) && !defined(__linux)
+#if ( defined(HAVE_LCHFLAGS) || defined(HAVE_CHFLAGS) || defined(HAVE_FCHFLAGS) ) && defined(HAVE_STRUCT_STAT_ST_FLAGS)
+/*
+ * BSD reads flags using stat() and sets them with one of {f,l,}chflags()
+ */
static int
set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
@@ -1910,11 +2218,9 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
return (ARCHIVE_WARN);
}
-#elif defined(__linux) && defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS)
-
+#elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS)
/*
- * Linux has flags too, but uses ioctl() to access them instead of
- * having a separate chflags() system call.
+ * Linux uses ioctl() to read and write file flags.
*/
static int
set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
@@ -1982,7 +2288,7 @@ cleanup:
return (ret);
}
-#else /* Not HAVE_CHFLAGS && Not __linux */
+#else
/*
* Of course, some systems have neither BSD chflags() nor Linux' flags
@@ -2171,6 +2477,71 @@ set_xattrs(struct archive_write_disk *a)
}
return (ret);
}
+#elif HAVE_EXTATTR_SET_FILE
+/*
+ * Restore extended attributes - FreeBSD implementation
+ */
+static int
+set_xattrs(struct archive_write_disk *a)
+{
+ struct archive_entry *entry = a->entry;
+ static int warning_done = 0;
+ int ret = ARCHIVE_OK;
+ int i = archive_entry_xattr_reset(entry);
+
+ while (i--) {
+ const char *name;
+ const void *value;
+ size_t size;
+ archive_entry_xattr_next(entry, &name, &value, &size);
+ if (name != NULL) {
+ int e;
+ int namespace;
+
+ if (strncmp(name, "user.", 5) == 0) {
+ /* "user." attributes go to user namespace */
+ name += 5;
+ namespace = EXTATTR_NAMESPACE_USER;
+ } else {
+ /* Warn about other extended attributes. */
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Can't restore extended attribute ``%s''",
+ name);
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ errno = 0;
+#if HAVE_EXTATTR_SET_FD
+ if (a->fd >= 0)
+ e = extattr_set_fd(a->fd, namespace, name, value, size);
+ else
+#endif
+ /* TODO: should we use extattr_set_link() instead? */
+ {
+ e = extattr_set_file(archive_entry_pathname(entry),
+ namespace, name, value, size);
+ }
+ if (e != (int)size) {
+ if (errno == ENOTSUP) {
+ if (!warning_done) {
+ warning_done = 1;
+ archive_set_error(&a->archive, errno,
+ "Cannot restore extended "
+ "attributes on this file "
+ "system");
+ }
+ } else {
+ archive_set_error(&a->archive, errno,
+ "Failed to set extended attribute");
+ }
+
+ ret = ARCHIVE_WARN;
+ }
+ }
+ }
+ return (ret);
+}
#else
/*
* Restore extended attributes - stub implementation for unsupported systems
@@ -2233,19 +2604,25 @@ older(struct stat *st, struct archive_entry *entry)
/* Definitely older. */
if (st->st_mtimespec.tv_nsec < archive_entry_mtime_nsec(entry))
return (1);
- /* Definitely younger. */
- if (st->st_mtimespec.tv_nsec > archive_entry_mtime_nsec(entry))
- return (0);
#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
/* Definitely older. */
if (st->st_mtim.tv_nsec < archive_entry_mtime_nsec(entry))
return (1);
- /* Definitely older. */
- if (st->st_mtim.tv_nsec > archive_entry_mtime_nsec(entry))
- return (0);
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+ /* older. */
+ if (st->st_mtime_n < archive_entry_mtime_nsec(entry))
+ return (1);
+#elif HAVE_STRUCT_STAT_ST_UMTIME
+ /* older. */
+ if (st->st_umtime * 1000 < archive_entry_mtime_nsec(entry))
+ return (1);
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+ /* older. */
+ if (st->st_mtime_usec * 1000 < archive_entry_mtime_nsec(entry))
+ return (1);
#else
/* This system doesn't have high-res timestamps. */
#endif
- /* Same age, so not older. */
+ /* Same age or newer, so not older. */
return (0);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk_private.h b/archivers/libarchive/files/libarchive/archive_write_disk_private.h
index 1e8ad6922ef..707c0cf03b2 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk_private.h
+++ b/archivers/libarchive/files/libarchive/archive_write_disk_private.h
@@ -23,9 +23,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_write_disk_private.h,v 1.1 2007/03/03 07:37:36 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_write_disk_private.h 201086 2009-12-28 02:17:53Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
#define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c b/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
index 427b87615a0..cfa06e84547 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk_set_standard_lookup.c,v 1.4 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk_set_standard_lookup.c 201083 2009-12-28 02:09:57Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -118,12 +118,35 @@ lookup_gid(void *private_data, const char *gname, gid_t gid)
b->hash = h;
#if HAVE_GRP_H
{
- struct group *grent = getgrnam(gname);
- if (grent != NULL)
- gid = grent->gr_gid;
+ char _buffer[128];
+ size_t bufsize = 128;
+ char *buffer = _buffer;
+ struct group grent, *result;
+ int r;
+
+ for (;;) {
+ result = &grent; /* Old getgrnam_r ignores last arg. */
+ r = getgrnam_r(gname, &grent, buffer, bufsize, &result);
+ if (r == 0)
+ break;
+ if (r != ERANGE)
+ break;
+ bufsize *= 2;
+ if (buffer != _buffer)
+ free(buffer);
+ buffer = malloc(bufsize);
+ if (buffer == NULL)
+ break;
+ }
+ if (result != NULL)
+ gid = result->gr_gid;
+ if (buffer != _buffer)
+ free(buffer);
}
-#elif _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
/* TODO: do a gname->gid lookup for Windows. */
+#else
+ #error No way to perform gid lookups on this platform
#endif
b->id = gid;
@@ -155,12 +178,35 @@ lookup_uid(void *private_data, const char *uname, uid_t uid)
b->hash = h;
#if HAVE_PWD_H
{
- struct passwd *pwent = getpwnam(uname);
- if (pwent != NULL)
- uid = pwent->pw_uid;
+ char _buffer[128];
+ size_t bufsize = 128;
+ char *buffer = _buffer;
+ struct passwd pwent, *result;
+ int r;
+
+ for (;;) {
+ result = &pwent; /* Old getpwnam_r ignores last arg. */
+ r = getpwnam_r(uname, &pwent, buffer, bufsize, &result);
+ if (r == 0)
+ break;
+ if (r != ERANGE)
+ break;
+ bufsize *= 2;
+ if (buffer != _buffer)
+ free(buffer);
+ buffer = malloc(bufsize);
+ if (buffer == NULL)
+ break;
+ }
+ if (result != NULL)
+ uid = result->pw_uid;
+ if (buffer != _buffer)
+ free(buffer);
}
-#elif _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
/* TODO: do a uname->uid lookup for Windows. */
+#else
+ #error No way to look up uids on this platform
#endif
b->id = uid;
@@ -186,8 +232,8 @@ hash(const char *p)
as used by ELF for hashing function names. */
unsigned g, h = 0;
while (*p != '\0') {
- h = ( h << 4 ) + *p++;
- if (( g = h & 0xF0000000 )) {
+ h = (h << 4) + *p++;
+ if ((g = h & 0xF0000000) != 0) {
h ^= g >> 24;
h &= 0x0FFFFFFF;
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_open_fd.c b/archivers/libarchive/files/libarchive/archive_write_open_fd.c
index 35e258c4cc2..3a60398710b 100644
--- a/archivers/libarchive/files/libarchive/archive_write_open_fd.c
+++ b/archivers/libarchive/files/libarchive/archive_write_open_fd.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_fd.c,v 1.9 2007/01/09 08:05:56 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_open_fd.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -32,6 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_fd.c,v 1.9 2007/01/09
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -64,6 +70,9 @@ archive_write_open_fd(struct archive *a, int fd)
return (ARCHIVE_FATAL);
}
mine->fd = fd;
+#if defined(__CYGWIN__) || defined(_WIN32)
+ setmode(mine->fd, O_BINARY);
+#endif
return (archive_write_open(a, mine,
file_open, file_write, file_close));
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_open_filename.c b/archivers/libarchive/files/libarchive/archive_write_open_filename.c
index 72eeb54053d..6a9c77816fd 100644
--- a/archivers/libarchive/files/libarchive/archive_write_open_filename.c
+++ b/archivers/libarchive/files/libarchive/archive_write_open_filename.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.20 2008/02/19 05:46:58 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_open_filename.c 191165 2009-04-17 00:39:35Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -71,24 +71,18 @@ archive_write_open_filename(struct archive *a, const char *filename)
{
struct write_file_data *mine;
- if (filename == NULL || filename[0] == '\0') {
- mine = (struct write_file_data *)malloc(sizeof(*mine));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- mine->filename[0] = '\0'; /* Record that we're using stdout. */
- } else {
- mine = (struct write_file_data *)malloc(sizeof(*mine) + strlen(filename));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- strcpy(mine->filename, filename);
+ if (filename == NULL || filename[0] == '\0')
+ return (archive_write_open_fd(a, 1));
+
+ mine = (struct write_file_data *)malloc(sizeof(*mine) + strlen(filename));
+ if (mine == NULL) {
+ archive_set_error(a, ENOMEM, "No memory");
+ return (ARCHIVE_FATAL);
}
+ strcpy(mine->filename, filename);
mine->fd = -1;
return (archive_write_open(a, mine,
- file_open, file_write, file_close));
+ file_open, file_write, file_close));
}
static int
@@ -104,21 +98,11 @@ file_open(struct archive *a, void *client_data)
/*
* Open the file.
*/
- if (mine->filename[0] != '\0') {
- mine->fd = open(mine->filename, flags, 0666);
- if (mine->fd < 0) {
- archive_set_error(a, errno, "Failed to open '%s'",
- mine->filename);
- return (ARCHIVE_FATAL);
- }
- } else {
- /*
- * NULL filename is stdout.
- */
- mine->fd = 1;
- /* By default, pad archive when writing to stdout. */
- if (archive_write_get_bytes_in_last_block(a) < 0)
- archive_write_set_bytes_in_last_block(a, 0);
+ mine->fd = open(mine->filename, flags, 0666);
+ if (mine->fd < 0) {
+ archive_set_error(a, errno, "Failed to open '%s'",
+ mine->filename);
+ return (ARCHIVE_FATAL);
}
if (fstat(mine->fd, &st) != 0) {
@@ -172,8 +156,7 @@ file_close(struct archive *a, void *client_data)
struct write_file_data *mine = (struct write_file_data *)client_data;
(void)a; /* UNUSED */
- if (mine->filename[0] != '\0')
- close(mine->fd);
+ close(mine->fd);
free(mine);
return (ARCHIVE_OK);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_private.h b/archivers/libarchive/files/libarchive/archive_write_private.h
index 55c24ad96ca..f9b656555b3 100644
--- a/archivers/libarchive/files/libarchive/archive_write_private.h
+++ b/archivers/libarchive/files/libarchive/archive_write_private.h
@@ -22,9 +22,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_write_private.h,v 1.3 2008/03/15 11:04:45 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/archive_write_private.h 201155 2009-12-29 05:20:12Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef ARCHIVE_WRITE_PRIVATE_H_INCLUDED
#define ARCHIVE_WRITE_PRIVATE_H_INCLUDED
@@ -37,7 +41,7 @@ struct archive_write {
/* Dev/ino of the archive being written. */
dev_t skip_file_dev;
- ino_t skip_file_ino;
+ int64_t skip_file_ino;
/* Utility: Pointer to a block of nulls. */
const unsigned char *nulls;
@@ -77,6 +81,8 @@ struct archive_write {
void *data;
void *config;
int (*init)(struct archive_write *);
+ int (*options)(struct archive_write *,
+ const char *key, const char *value);
int (*finish)(struct archive_write *);
int (*write)(struct archive_write *, const void *, size_t);
} compressor;
@@ -86,7 +92,10 @@ struct archive_write {
* initialized by archive_write_set_format_XXX() calls.
*/
void *format_data;
+ const char *format_name;
int (*format_init)(struct archive_write *);
+ int (*format_options)(struct archive_write *,
+ const char *key, const char *value);
int (*format_finish)(struct archive_write *);
int (*format_destroy)(struct archive_write *);
int (*format_finish_entry)(struct archive_write *);
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
index 272ae26e520..beb2379e5e4 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
@@ -25,10 +25,7 @@
#include "archive_platform.h"
-/* Don't compile this if we don't have bzlib. */
-#if HAVE_BZLIB_H
-
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_bzip2.c,v 1.13 2007/12/30 04:58:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_bzip2.c 201091 2009-12-28 02:22:41Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -48,6 +45,17 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_bzip2.c,v 1
#include "archive_private.h"
#include "archive_write_private.h"
+#ifndef HAVE_BZLIB_H
+int
+archive_write_set_compression_bzip2(struct archive *a)
+{
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "bzip2 compression not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have bzlib. */
+
struct private_data {
bz_stream stream;
int64_t total_in;
@@ -55,6 +63,9 @@ struct private_data {
size_t compressed_buffer_size;
};
+struct private_config {
+ int compression_level;
+};
/*
* Yuck. bzlib.h is not const-correct, so I need this one bit
@@ -65,6 +76,8 @@ struct private_data {
static int archive_compressor_bzip2_finish(struct archive_write *);
static int archive_compressor_bzip2_init(struct archive_write *);
+static int archive_compressor_bzip2_options(struct archive_write *,
+ const char *, const char *);
static int archive_compressor_bzip2_write(struct archive_write *,
const void *, size_t);
static int drive_compressor(struct archive_write *, struct private_data *,
@@ -77,9 +90,21 @@ int
archive_write_set_compression_bzip2(struct archive *_a)
{
struct archive_write *a = (struct archive_write *)_a;
+ struct private_config *config;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_NEW, "archive_write_set_compression_bzip2");
+ config = malloc(sizeof(*config));
+ if (config == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+ a->compressor.config = config;
+ a->compressor.finish = archive_compressor_bzip2_finish;
+ config->compression_level = 9; /* default */
a->compressor.init = &archive_compressor_bzip2_init;
+ a->compressor.options = &archive_compressor_bzip2_options;
+ a->archive.compression_code = ARCHIVE_COMPRESSION_BZIP2;
+ a->archive.compression_name = "bzip2";
return (ARCHIVE_OK);
}
@@ -91,10 +116,9 @@ archive_compressor_bzip2_init(struct archive_write *a)
{
int ret;
struct private_data *state;
+ struct private_config *config;
- a->archive.compression_code = ARCHIVE_COMPRESSION_BZIP2;
- a->archive.compression_name = "bzip2";
-
+ config = (struct private_config *)a->compressor.config;
if (a->client_opener != NULL) {
ret = (a->client_opener)(&a->archive, a->client_data);
if (ret != 0)
@@ -122,10 +146,10 @@ archive_compressor_bzip2_init(struct archive_write *a)
state->stream.next_out = state->compressed;
state->stream.avail_out = state->compressed_buffer_size;
a->compressor.write = archive_compressor_bzip2_write;
- a->compressor.finish = archive_compressor_bzip2_finish;
/* Initialize compression library */
- ret = BZ2_bzCompressInit(&(state->stream), 9, 0, 30);
+ ret = BZ2_bzCompressInit(&(state->stream),
+ config->compression_level, 0, 30);
if (ret == BZ_OK) {
a->compressor.data = state;
return (ARCHIVE_OK);
@@ -161,6 +185,32 @@ archive_compressor_bzip2_init(struct archive_write *a)
}
/*
+ * Set write options.
+ */
+static int
+archive_compressor_bzip2_options(struct archive_write *a, const char *key,
+ const char *value)
+{
+ struct private_config *config;
+
+ config = (struct private_config *)a->compressor.config;
+ if (strcmp(key, "compression-level") == 0) {
+ if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+ value[1] != '\0')
+ return (ARCHIVE_WARN);
+ config->compression_level = value[0] - '0';
+ /* Make '0' be a synonym for '1'. */
+ /* This way, bzip2 compressor supports the same 0..9
+ * range of levels as gzip. */
+ if (config->compression_level < 1)
+ config->compression_level = 1;
+ return (ARCHIVE_OK);
+ }
+
+ return (ARCHIVE_WARN);
+}
+
+/*
* Write data to the compressed stream.
*
* Returns ARCHIVE_OK if all data written, error otherwise.
@@ -205,83 +255,87 @@ archive_compressor_bzip2_finish(struct archive_write *a)
ssize_t bytes_written;
unsigned tocopy;
- state = (struct private_data *)a->compressor.data;
ret = ARCHIVE_OK;
- if (a->client_writer == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "No write callback is registered?\n"
- "This is probably an internal programming error.");
- ret = ARCHIVE_FATAL;
- goto cleanup;
- }
+ state = (struct private_data *)a->compressor.data;
+ if (state != NULL) {
+ if (a->client_writer == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_PROGRAMMER,
+ "No write callback is registered?\n"
+ "This is probably an internal programming error.");
+ ret = ARCHIVE_FATAL;
+ goto cleanup;
+ }
- /* By default, always pad the uncompressed data. */
- if (a->pad_uncompressed) {
- tocopy = a->bytes_per_block -
- (state->total_in % a->bytes_per_block);
- while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
- SET_NEXT_IN(state, a->nulls);
- state->stream.avail_in = tocopy < a->null_length ?
- tocopy : a->null_length;
- state->total_in += state->stream.avail_in;
- tocopy -= state->stream.avail_in;
- ret = drive_compressor(a, state, 0);
- if (ret != ARCHIVE_OK)
- goto cleanup;
+ /* By default, always pad the uncompressed data. */
+ if (a->pad_uncompressed) {
+ tocopy = a->bytes_per_block -
+ (state->total_in % a->bytes_per_block);
+ while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+ SET_NEXT_IN(state, a->nulls);
+ state->stream.avail_in = tocopy < a->null_length ?
+ tocopy : a->null_length;
+ state->total_in += state->stream.avail_in;
+ tocopy -= state->stream.avail_in;
+ ret = drive_compressor(a, state, 0);
+ if (ret != ARCHIVE_OK)
+ goto cleanup;
+ }
}
- }
- /* Finish compression cycle. */
- if ((ret = drive_compressor(a, state, 1)))
- goto cleanup;
-
- /* Optionally, pad the final compressed block. */
- block_length = state->stream.next_out - state->compressed;
-
-
- /* Tricky calculation to determine size of last block. */
- target_block_length = block_length;
- if (a->bytes_in_last_block <= 0)
- /* Default or Zero: pad to full block */
- target_block_length = a->bytes_per_block;
- else
- /* Round length to next multiple of bytes_in_last_block. */
- target_block_length = a->bytes_in_last_block *
- ( (block_length + a->bytes_in_last_block - 1) /
- a->bytes_in_last_block);
- if (target_block_length > a->bytes_per_block)
- target_block_length = a->bytes_per_block;
- if (block_length < target_block_length) {
- memset(state->stream.next_out, 0,
- target_block_length - block_length);
- block_length = target_block_length;
- }
+ /* Finish compression cycle. */
+ if ((ret = drive_compressor(a, state, 1)))
+ goto cleanup;
+
+ /* Optionally, pad the final compressed block. */
+ block_length = state->stream.next_out - state->compressed;
+
+ /* Tricky calculation to determine size of last block. */
+ if (a->bytes_in_last_block <= 0)
+ /* Default or Zero: pad to full block */
+ target_block_length = a->bytes_per_block;
+ else
+ /* Round length to next multiple of bytes_in_last_block. */
+ target_block_length = a->bytes_in_last_block *
+ ( (block_length + a->bytes_in_last_block - 1) /
+ a->bytes_in_last_block);
+ if (target_block_length > a->bytes_per_block)
+ target_block_length = a->bytes_per_block;
+ if (block_length < target_block_length) {
+ memset(state->stream.next_out, 0,
+ target_block_length - block_length);
+ block_length = target_block_length;
+ }
- /* Write the last block */
- bytes_written = (a->client_writer)(&a->archive, a->client_data,
- state->compressed, block_length);
+ /* Write the last block */
+ bytes_written = (a->client_writer)(&a->archive, a->client_data,
+ state->compressed, block_length);
- /* TODO: Handle short write of final block. */
- if (bytes_written <= 0)
- ret = ARCHIVE_FATAL;
- else {
- a->archive.raw_position += ret;
- ret = ARCHIVE_OK;
- }
+ /* TODO: Handle short write of final block. */
+ if (bytes_written <= 0)
+ ret = ARCHIVE_FATAL;
+ else {
+ a->archive.raw_position += ret;
+ ret = ARCHIVE_OK;
+ }
- /* Cleanup: shut down compressor, release memory, etc. */
+ /* Cleanup: shut down compressor, release memory, etc. */
cleanup:
- switch (BZ2_bzCompressEnd(&(state->stream))) {
- case BZ_OK:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "Failed to clean up compressor");
- ret = ARCHIVE_FATAL;
- }
+ switch (BZ2_bzCompressEnd(&(state->stream))) {
+ case BZ_OK:
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
+ "Failed to clean up compressor");
+ ret = ARCHIVE_FATAL;
+ }
- free(state->compressed);
- free(state);
+ free(state->compressed);
+ free(state);
+ }
+ /* Free configuration data even if we were never fully initialized. */
+ free(a->compressor.config);
+ a->compressor.config = NULL;
return (ret);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_compress.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_compress.c
index f913a23c53b..77c73ee5f27 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_compress.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_compress.c
@@ -58,7 +58,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_compress.c,v 1.1 2008/03/14 20:35:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_compress.c 201111 2009-12-28 03:33:05Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -243,7 +243,6 @@ output_code(struct archive_write *a, int ocode)
int bits, ret, clear_flg, bit_offset;
clear_flg = ocode == CLEAR;
- bits = state->code_len;
/*
* Since ocode is always >= 8 bits, only need to mask the first
@@ -426,10 +425,9 @@ archive_compressor_compress_finish(struct archive_write *a)
ssize_t block_length, target_block_length, bytes_written;
int ret;
struct private_data *state;
- unsigned tocopy;
+ size_t tocopy;
state = (struct private_data *)a->compressor.data;
- ret = 0;
if (a->client_writer == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"No write callback is registered? "
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
index 18abbdf67b5..f0176e25f74 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
@@ -25,10 +25,7 @@
#include "archive_platform.h"
-/* Don't compile this if we don't have zlib. */
-#if HAVE_ZLIB_H
-
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.16 2008/02/21 03:21:50 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_gzip.c 201081 2009-12-28 02:04:42Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -48,6 +45,17 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.
#include "archive_private.h"
#include "archive_write_private.h"
+#ifndef HAVE_ZLIB_H
+int
+archive_write_set_compression_gzip(struct archive *a)
+{
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "gzip compression not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have zlib. */
+
struct private_data {
z_stream stream;
int64_t total_in;
@@ -56,6 +64,10 @@ struct private_data {
unsigned long crc;
};
+struct private_config {
+ int compression_level;
+};
+
/*
* Yuck. zlib.h is not const-correct, so I need this one bit
@@ -66,6 +78,8 @@ struct private_data {
static int archive_compressor_gzip_finish(struct archive_write *);
static int archive_compressor_gzip_init(struct archive_write *);
+static int archive_compressor_gzip_options(struct archive_write *,
+ const char *, const char *);
static int archive_compressor_gzip_write(struct archive_write *,
const void *, size_t);
static int drive_compressor(struct archive_write *, struct private_data *,
@@ -79,9 +93,19 @@ int
archive_write_set_compression_gzip(struct archive *_a)
{
struct archive_write *a = (struct archive_write *)_a;
+ struct private_config *config;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_NEW, "archive_write_set_compression_gzip");
+ config = malloc(sizeof(*config));
+ if (config == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+ a->compressor.config = config;
+ a->compressor.finish = &archive_compressor_gzip_finish;
+ config->compression_level = Z_DEFAULT_COMPRESSION;
a->compressor.init = &archive_compressor_gzip_init;
+ a->compressor.options = &archive_compressor_gzip_options;
a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP;
a->archive.compression_name = "gzip";
return (ARCHIVE_OK);
@@ -95,10 +119,10 @@ archive_compressor_gzip_init(struct archive_write *a)
{
int ret;
struct private_data *state;
+ struct private_config *config;
time_t t;
- a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP;
- a->archive.compression_name = "gzip";
+ config = (struct private_config *)a->compressor.config;
if (a->client_opener != NULL) {
ret = (a->client_opener)(&a->archive, a->client_data);
@@ -163,11 +187,10 @@ archive_compressor_gzip_init(struct archive_write *a)
state->stream.avail_out -= 10;
a->compressor.write = archive_compressor_gzip_write;
- a->compressor.finish = archive_compressor_gzip_finish;
/* Initialize compression library. */
ret = deflateInit2(&(state->stream),
- Z_DEFAULT_COMPRESSION,
+ config->compression_level,
Z_DEFLATED,
-15 /* < 0 to suppress zlib header */,
8,
@@ -206,6 +229,27 @@ archive_compressor_gzip_init(struct archive_write *a)
}
/*
+ * Set write options.
+ */
+static int
+archive_compressor_gzip_options(struct archive_write *a, const char *key,
+ const char *value)
+{
+ struct private_config *config;
+
+ config = (struct private_config *)a->compressor.config;
+ if (strcmp(key, "compression-level") == 0) {
+ if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+ value[1] != '\0')
+ return (ARCHIVE_WARN);
+ config->compression_level = value[0] - '0';
+ return (ARCHIVE_OK);
+ }
+
+ return (ARCHIVE_WARN);
+}
+
+/*
* Write data to the compressed stream.
*/
static int
@@ -237,7 +281,6 @@ archive_compressor_gzip_write(struct archive_write *a, const void *buff,
return (ARCHIVE_OK);
}
-
/*
* Finish the compression...
*/
@@ -252,113 +295,117 @@ archive_compressor_gzip_finish(struct archive_write *a)
state = (struct private_data *)a->compressor.data;
ret = 0;
- if (a->client_writer == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
- "No write callback is registered? "
- "This is probably an internal programming error.");
- ret = ARCHIVE_FATAL;
- goto cleanup;
- }
+ if (state != NULL) {
+ if (a->client_writer == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_PROGRAMMER,
+ "No write callback is registered? "
+ "This is probably an internal programming error.");
+ ret = ARCHIVE_FATAL;
+ goto cleanup;
+ }
+
+ /* By default, always pad the uncompressed data. */
+ if (a->pad_uncompressed) {
+ tocopy = a->bytes_per_block -
+ (state->total_in % a->bytes_per_block);
+ while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+ SET_NEXT_IN(state, a->nulls);
+ state->stream.avail_in = tocopy < a->null_length ?
+ tocopy : a->null_length;
+ state->crc = crc32(state->crc, a->nulls,
+ state->stream.avail_in);
+ state->total_in += state->stream.avail_in;
+ tocopy -= state->stream.avail_in;
+ ret = drive_compressor(a, state, 0);
+ if (ret != ARCHIVE_OK)
+ goto cleanup;
+ }
+ }
+
+ /* Finish compression cycle */
+ if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
+ goto cleanup;
- /* By default, always pad the uncompressed data. */
- if (a->pad_uncompressed) {
- tocopy = a->bytes_per_block -
- (state->total_in % a->bytes_per_block);
- while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
- SET_NEXT_IN(state, a->nulls);
- state->stream.avail_in = tocopy < a->null_length ?
- tocopy : a->null_length;
- state->crc = crc32(state->crc, a->nulls,
- state->stream.avail_in);
- state->total_in += state->stream.avail_in;
- tocopy -= state->stream.avail_in;
- ret = drive_compressor(a, state, 0);
- if (ret != ARCHIVE_OK)
+ /* Build trailer: 4-byte CRC and 4-byte length. */
+ trailer[0] = (state->crc)&0xff;
+ trailer[1] = (state->crc >> 8)&0xff;
+ trailer[2] = (state->crc >> 16)&0xff;
+ trailer[3] = (state->crc >> 24)&0xff;
+ trailer[4] = (state->total_in)&0xff;
+ trailer[5] = (state->total_in >> 8)&0xff;
+ trailer[6] = (state->total_in >> 16)&0xff;
+ trailer[7] = (state->total_in >> 24)&0xff;
+
+ /* Add trailer to current block. */
+ tocopy = 8;
+ if (tocopy > state->stream.avail_out)
+ tocopy = state->stream.avail_out;
+ memcpy(state->stream.next_out, trailer, tocopy);
+ state->stream.next_out += tocopy;
+ state->stream.avail_out -= tocopy;
+
+ /* If it overflowed, flush and start a new block. */
+ if (tocopy < 8) {
+ bytes_written = (a->client_writer)(&a->archive, a->client_data,
+ state->compressed, state->compressed_buffer_size);
+ if (bytes_written <= 0) {
+ ret = ARCHIVE_FATAL;
goto cleanup;
+ }
+ a->archive.raw_position += bytes_written;
+ state->stream.next_out = state->compressed;
+ state->stream.avail_out = state->compressed_buffer_size;
+ memcpy(state->stream.next_out, trailer + tocopy, 8-tocopy);
+ state->stream.next_out += 8-tocopy;
+ state->stream.avail_out -= 8-tocopy;
}
- }
- /* Finish compression cycle */
- if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
- goto cleanup;
-
- /* Build trailer: 4-byte CRC and 4-byte length. */
- trailer[0] = (state->crc)&0xff;
- trailer[1] = (state->crc >> 8)&0xff;
- trailer[2] = (state->crc >> 16)&0xff;
- trailer[3] = (state->crc >> 24)&0xff;
- trailer[4] = (state->total_in)&0xff;
- trailer[5] = (state->total_in >> 8)&0xff;
- trailer[6] = (state->total_in >> 16)&0xff;
- trailer[7] = (state->total_in >> 24)&0xff;
-
- /* Add trailer to current block. */
- tocopy = 8;
- if (tocopy > state->stream.avail_out)
- tocopy = state->stream.avail_out;
- memcpy(state->stream.next_out, trailer, tocopy);
- state->stream.next_out += tocopy;
- state->stream.avail_out -= tocopy;
-
- /* If it overflowed, flush and start a new block. */
- if (tocopy < 8) {
+ /* Optionally, pad the final compressed block. */
+ block_length = state->stream.next_out - state->compressed;
+
+ /* Tricky calculation to determine size of last block. */
+ if (a->bytes_in_last_block <= 0)
+ /* Default or Zero: pad to full block */
+ target_block_length = a->bytes_per_block;
+ else
+ /* Round length to next multiple of bytes_in_last_block. */
+ target_block_length = a->bytes_in_last_block *
+ ( (block_length + a->bytes_in_last_block - 1) /
+ a->bytes_in_last_block);
+ if (target_block_length > a->bytes_per_block)
+ target_block_length = a->bytes_per_block;
+ if (block_length < target_block_length) {
+ memset(state->stream.next_out, 0,
+ target_block_length - block_length);
+ block_length = target_block_length;
+ }
+
+ /* Write the last block */
bytes_written = (a->client_writer)(&a->archive, a->client_data,
- state->compressed, state->compressed_buffer_size);
+ state->compressed, block_length);
if (bytes_written <= 0) {
ret = ARCHIVE_FATAL;
goto cleanup;
}
a->archive.raw_position += bytes_written;
- state->stream.next_out = state->compressed;
- state->stream.avail_out = state->compressed_buffer_size;
- memcpy(state->stream.next_out, trailer + tocopy, 8-tocopy);
- state->stream.next_out += 8-tocopy;
- state->stream.avail_out -= 8-tocopy;
- }
- /* Optionally, pad the final compressed block. */
- block_length = state->stream.next_out - state->compressed;
-
-
- /* Tricky calculation to determine size of last block. */
- target_block_length = block_length;
- if (a->bytes_in_last_block <= 0)
- /* Default or Zero: pad to full block */
- target_block_length = a->bytes_per_block;
- else
- /* Round length to next multiple of bytes_in_last_block. */
- target_block_length = a->bytes_in_last_block *
- ( (block_length + a->bytes_in_last_block - 1) /
- a->bytes_in_last_block);
- if (target_block_length > a->bytes_per_block)
- target_block_length = a->bytes_per_block;
- if (block_length < target_block_length) {
- memset(state->stream.next_out, 0,
- target_block_length - block_length);
- block_length = target_block_length;
- }
-
- /* Write the last block */
- bytes_written = (a->client_writer)(&a->archive, a->client_data,
- state->compressed, block_length);
- if (bytes_written <= 0) {
- ret = ARCHIVE_FATAL;
- goto cleanup;
- }
- a->archive.raw_position += bytes_written;
-
- /* Cleanup: shut down compressor, release memory, etc. */
-cleanup:
- switch (deflateEnd(&(state->stream))) {
- case Z_OK:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Failed to clean up compressor");
- ret = ARCHIVE_FATAL;
+ /* Cleanup: shut down compressor, release memory, etc. */
+ cleanup:
+ switch (deflateEnd(&(state->stream))) {
+ case Z_OK:
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Failed to clean up compressor");
+ ret = ARCHIVE_FATAL;
+ }
+ free(state->compressed);
+ free(state);
}
- free(state->compressed);
- free(state);
+ /* Clean up config area even if we never initialized. */
+ free(a->compressor.config);
+ a->compressor.config = NULL;
return (ret);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
index bdecb240d9f..e0216d9e122 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_none.c,v 1.16 2007/12/30 04:58:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_none.c 201080 2009-12-28 02:03:54Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -208,11 +208,10 @@ archive_compressor_none_finish(struct archive_write *a)
ssize_t target_block_length;
ssize_t bytes_written;
int ret;
- int ret2;
struct archive_none *state;
state = (struct archive_none *)a->compressor.data;
- ret = ret2 = ARCHIVE_OK;
+ ret = ARCHIVE_OK;
if (a->client_writer == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"No write callback is registered? "
@@ -225,7 +224,6 @@ archive_compressor_none_finish(struct archive_write *a)
block_length = state->buffer_size - state->avail;
/* Tricky calculation to determine size of last block */
- target_block_length = block_length;
if (a->bytes_in_last_block <= 0)
/* Default or Zero: pad to full block */
target_block_length = a->bytes_per_block;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
index 69c5d428633..475ba354032 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
@@ -25,11 +25,11 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_program.c,v 1.3 2008/06/15 10:45:57 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_program.c 201104 2009-12-28 03:14:30Z kientzle $");
/* This capability is only available on POSIX systems. */
-#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
- !(defined(HAVE_FORK) || defined(HAVE_VFORK))
+#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+ !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__))
#include "archive.h"
/*
@@ -230,11 +230,9 @@ static int
archive_compressor_program_write(struct archive_write *a, const void *buff,
size_t length)
{
- struct private_data *state;
ssize_t ret;
const char *buf;
- state = (struct private_data *)a->compressor.data;
if (a->client_writer == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"No write callback is registered? "
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_xz.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_xz.c
new file mode 100644
index 00000000000..f82f6db62e2
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_xz.c
@@ -0,0 +1,438 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_xz.c 201108 2009-12-28 03:28:21Z kientzle $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#include <time.h>
+#ifdef HAVE_LZMA_H
+#include <lzma.h>
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_write_private.h"
+
+#ifndef HAVE_LZMA_H
+int
+archive_write_set_compression_xz(struct archive *a)
+{
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "xz compression not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+
+int
+archive_write_set_compression_lzma(struct archive *a)
+{
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "lzma compression not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have liblzma. */
+
+struct private_data {
+ lzma_stream stream;
+ lzma_filter lzmafilters[2];
+ lzma_options_lzma lzma_opt;
+ int64_t total_in;
+ unsigned char *compressed;
+ size_t compressed_buffer_size;
+};
+
+struct private_config {
+ int compression_level;
+};
+
+static int archive_compressor_xz_init(struct archive_write *);
+static int archive_compressor_xz_options(struct archive_write *,
+ const char *, const char *);
+static int archive_compressor_xz_finish(struct archive_write *);
+static int archive_compressor_xz_write(struct archive_write *,
+ const void *, size_t);
+static int drive_compressor(struct archive_write *, struct private_data *,
+ int finishing);
+
+
+/*
+ * Allocate, initialize and return a archive object.
+ */
+int
+archive_write_set_compression_xz(struct archive *_a)
+{
+ struct private_config *config;
+ struct archive_write *a = (struct archive_write *)_a;
+ __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ ARCHIVE_STATE_NEW, "archive_write_set_compression_xz");
+ config = calloc(1, sizeof(*config));
+ if (config == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Out of memory");
+ return (ARCHIVE_FATAL);
+ }
+ a->compressor.config = config;
+ a->compressor.finish = archive_compressor_xz_finish;
+ config->compression_level = LZMA_PRESET_DEFAULT;
+ a->compressor.init = &archive_compressor_xz_init;
+ a->compressor.options = &archive_compressor_xz_options;
+ a->archive.compression_code = ARCHIVE_COMPRESSION_XZ;
+ a->archive.compression_name = "xz";
+ return (ARCHIVE_OK);
+}
+
+/* LZMA is handled identically, we just need a different compression
+ * code set. (The liblzma setup looks at the code to determine
+ * the one place that XZ and LZMA require different handling.) */
+int
+archive_write_set_compression_lzma(struct archive *_a)
+{
+ struct archive_write *a = (struct archive_write *)_a;
+ int r = archive_write_set_compression_xz(_a);
+ if (r != ARCHIVE_OK)
+ return (r);
+ a->archive.compression_code = ARCHIVE_COMPRESSION_LZMA;
+ a->archive.compression_name = "lzma";
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_compressor_xz_init_stream(struct archive_write *a,
+ struct private_data *state)
+{
+ int ret;
+
+ state->stream = (lzma_stream)LZMA_STREAM_INIT;
+ state->stream.next_out = state->compressed;
+ state->stream.avail_out = state->compressed_buffer_size;
+ if (a->archive.compression_code == ARCHIVE_COMPRESSION_XZ)
+ ret = lzma_stream_encoder(&(state->stream),
+ state->lzmafilters, LZMA_CHECK_CRC64);
+ else
+ ret = lzma_alone_encoder(&(state->stream), &state->lzma_opt);
+ if (ret == LZMA_OK)
+ return (ARCHIVE_OK);
+
+ switch (ret) {
+ case LZMA_MEM_ERROR:
+ archive_set_error(&a->archive, ENOMEM,
+ "Internal error initializing compression library: "
+ "Cannot allocate memory");
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Internal error initializing compression library: "
+ "It's a bug in liblzma");
+ break;
+ }
+ return (ARCHIVE_FATAL);
+}
+
+/*
+ * Setup callback.
+ */
+static int
+archive_compressor_xz_init(struct archive_write *a)
+{
+ int ret;
+ struct private_data *state;
+ struct private_config *config;
+
+ if (a->client_opener != NULL) {
+ ret = (a->client_opener)(&a->archive, a->client_data);
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ }
+
+ state = (struct private_data *)malloc(sizeof(*state));
+ if (state == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate data for compression");
+ return (ARCHIVE_FATAL);
+ }
+ memset(state, 0, sizeof(*state));
+ config = a->compressor.config;
+
+ /*
+ * See comment above. We should set compressed_buffer_size to
+ * max(bytes_per_block, 65536), but the code can't handle that yet.
+ */
+ state->compressed_buffer_size = a->bytes_per_block;
+ state->compressed = (unsigned char *)malloc(state->compressed_buffer_size);
+ if (state->compressed == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate data for compression buffer");
+ free(state);
+ return (ARCHIVE_FATAL);
+ }
+ a->compressor.write = archive_compressor_xz_write;
+
+ /* Initialize compression library. */
+ if (lzma_lzma_preset(&state->lzma_opt, config->compression_level)) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Internal error initializing compression library");
+ free(state->compressed);
+ free(state);
+ }
+ state->lzmafilters[0].id = LZMA_FILTER_LZMA2;
+ state->lzmafilters[0].options = &state->lzma_opt;
+ state->lzmafilters[1].id = LZMA_VLI_UNKNOWN;/* Terminate */
+ ret = archive_compressor_xz_init_stream(a, state);
+ if (ret == LZMA_OK) {
+ a->compressor.data = state;
+ return (0);
+ }
+ /* Library setup failed: clean up. */
+ free(state->compressed);
+ free(state);
+
+ return (ARCHIVE_FATAL);
+}
+
+/*
+ * Set write options.
+ */
+static int
+archive_compressor_xz_options(struct archive_write *a, const char *key,
+ const char *value)
+{
+ struct private_config *config;
+
+ config = (struct private_config *)a->compressor.config;
+ if (strcmp(key, "compression-level") == 0) {
+ if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+ value[1] != '\0')
+ return (ARCHIVE_WARN);
+ config->compression_level = value[0] - '0';
+ if (config->compression_level > 6)
+ config->compression_level = 6;
+ return (ARCHIVE_OK);
+ }
+
+ return (ARCHIVE_WARN);
+}
+
+/*
+ * Write data to the compressed stream.
+ */
+static int
+archive_compressor_xz_write(struct archive_write *a, const void *buff,
+ size_t length)
+{
+ struct private_data *state;
+ int ret;
+
+ state = (struct private_data *)a->compressor.data;
+ if (a->client_writer == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
+ "No write callback is registered? "
+ "This is probably an internal programming error.");
+ return (ARCHIVE_FATAL);
+ }
+
+ /* Update statistics */
+ state->total_in += length;
+
+ /* Compress input data to output buffer */
+ state->stream.next_in = buff;
+ state->stream.avail_in = length;
+ if ((ret = drive_compressor(a, state, 0)) != ARCHIVE_OK)
+ return (ret);
+
+ a->archive.file_position += length;
+ return (ARCHIVE_OK);
+}
+
+
+/*
+ * Finish the compression...
+ */
+static int
+archive_compressor_xz_finish(struct archive_write *a)
+{
+ ssize_t block_length, target_block_length, bytes_written;
+ int ret;
+ struct private_data *state;
+ unsigned tocopy;
+
+ ret = ARCHIVE_OK;
+ state = (struct private_data *)a->compressor.data;
+ if (state != NULL) {
+ if (a->client_writer == NULL) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_PROGRAMMER,
+ "No write callback is registered? "
+ "This is probably an internal programming error.");
+ ret = ARCHIVE_FATAL;
+ goto cleanup;
+ }
+
+ /* By default, always pad the uncompressed data. */
+ if (a->pad_uncompressed) {
+ tocopy = a->bytes_per_block -
+ (state->total_in % a->bytes_per_block);
+ while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+ state->stream.next_in = a->nulls;
+ state->stream.avail_in = tocopy < a->null_length ?
+ tocopy : a->null_length;
+ state->total_in += state->stream.avail_in;
+ tocopy -= state->stream.avail_in;
+ ret = drive_compressor(a, state, 0);
+ if (ret != ARCHIVE_OK)
+ goto cleanup;
+ }
+ }
+
+ /* Finish compression cycle */
+ if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
+ goto cleanup;
+
+ /* Optionally, pad the final compressed block. */
+ block_length = state->stream.next_out - state->compressed;
+
+ /* Tricky calculation to determine size of last block. */
+ if (a->bytes_in_last_block <= 0)
+ /* Default or Zero: pad to full block */
+ target_block_length = a->bytes_per_block;
+ else
+ /* Round length to next multiple of bytes_in_last_block. */
+ target_block_length = a->bytes_in_last_block *
+ ( (block_length + a->bytes_in_last_block - 1) /
+ a->bytes_in_last_block);
+ if (target_block_length > a->bytes_per_block)
+ target_block_length = a->bytes_per_block;
+ if (block_length < target_block_length) {
+ memset(state->stream.next_out, 0,
+ target_block_length - block_length);
+ block_length = target_block_length;
+ }
+
+ /* Write the last block */
+ bytes_written = (a->client_writer)(&a->archive, a->client_data,
+ state->compressed, block_length);
+ if (bytes_written <= 0) {
+ ret = ARCHIVE_FATAL;
+ goto cleanup;
+ }
+ a->archive.raw_position += bytes_written;
+
+ /* Cleanup: shut down compressor, release memory, etc. */
+ cleanup:
+ lzma_end(&(state->stream));
+ free(state->compressed);
+ free(state);
+ }
+ free(a->compressor.config);
+ a->compressor.config = NULL;
+ return (ret);
+}
+
+/*
+ * Utility function to push input data through compressor,
+ * writing full output blocks as necessary.
+ *
+ * Note that this handles both the regular write case (finishing ==
+ * false) and the end-of-archive case (finishing == true).
+ */
+static int
+drive_compressor(struct archive_write *a, struct private_data *state, int finishing)
+{
+ ssize_t bytes_written;
+ int ret;
+
+ for (;;) {
+ if (state->stream.avail_out == 0) {
+ bytes_written = (a->client_writer)(&a->archive,
+ a->client_data, state->compressed,
+ state->compressed_buffer_size);
+ if (bytes_written <= 0) {
+ /* TODO: Handle this write failure */
+ return (ARCHIVE_FATAL);
+ } else if ((size_t)bytes_written < state->compressed_buffer_size) {
+ /* Short write: Move remaining to
+ * front of block and keep filling */
+ memmove(state->compressed,
+ state->compressed + bytes_written,
+ state->compressed_buffer_size - bytes_written);
+ }
+ a->archive.raw_position += bytes_written;
+ state->stream.next_out
+ = state->compressed +
+ state->compressed_buffer_size - bytes_written;
+ state->stream.avail_out = bytes_written;
+ }
+
+ /* If there's nothing to do, we're done. */
+ if (!finishing && state->stream.avail_in == 0)
+ return (ARCHIVE_OK);
+
+ ret = lzma_code(&(state->stream),
+ finishing ? LZMA_FINISH : LZMA_RUN );
+
+ switch (ret) {
+ case LZMA_OK:
+ /* In non-finishing case, check if compressor
+ * consumed everything */
+ if (!finishing && state->stream.avail_in == 0)
+ return (ARCHIVE_OK);
+ /* In finishing case, this return always means
+ * there's more work */
+ break;
+ case LZMA_STREAM_END:
+ /* This return can only occur in finishing case. */
+ if (finishing)
+ return (ARCHIVE_OK);
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "lzma compression data error");
+ return (ARCHIVE_FATAL);
+ case LZMA_MEMLIMIT_ERROR:
+ archive_set_error(&a->archive, ENOMEM,
+ "lzma compression error: "
+ "%ju MiB would have been needed",
+ (lzma_memusage(&(state->stream)) + 1024 * 1024 -1)
+ / (1024 * 1024));
+ return (ARCHIVE_FATAL);
+ default:
+ /* Any other return value indicates an error. */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "lzma compression failed:"
+ " lzma_code() call returned status %d",
+ ret);
+ return (ARCHIVE_FATAL);
+ }
+ }
+}
+
+#endif /* HAVE_LZMA_H */
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format.c b/archivers/libarchive/files/libarchive/archive_write_set_format.c
index e5f89211a2c..b1593fbe6d8 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format.c,v 1.5 2007/06/22 05:47:00 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -44,6 +44,7 @@ struct { int code; int (*setter)(struct archive *); } codes[] =
{ ARCHIVE_FORMAT_CPIO, archive_write_set_format_cpio },
{ ARCHIVE_FORMAT_CPIO_SVR4_NOCRC, archive_write_set_format_cpio_newc },
{ ARCHIVE_FORMAT_CPIO_POSIX, archive_write_set_format_cpio },
+ { ARCHIVE_FORMAT_MTREE, archive_write_set_format_mtree },
{ ARCHIVE_FORMAT_SHAR, archive_write_set_format_shar },
{ ARCHIVE_FORMAT_SHAR_BASE, archive_write_set_format_shar },
{ ARCHIVE_FORMAT_SHAR_DUMP, archive_write_set_format_shar_dump },
@@ -52,6 +53,7 @@ struct { int code; int (*setter)(struct archive *); } codes[] =
{ ARCHIVE_FORMAT_TAR_PAX_RESTRICTED,
archive_write_set_format_pax_restricted },
{ ARCHIVE_FORMAT_TAR_USTAR, archive_write_set_format_ustar },
+ { ARCHIVE_FORMAT_ZIP, archive_write_set_format_zip },
{ 0, NULL }
};
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
index 7176e6e2f40..b492ceaa56b 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
@@ -26,7 +26,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ar.c,v 1.7 2008/05/26 17:00:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_ar.c 201108 2009-12-28 03:28:21Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -125,6 +125,7 @@ archive_write_set_format_ar(struct archive_write *a)
memset(ar, 0, sizeof(*ar));
a->format_data = ar;
+ a->format_name = "ar";
a->format_write_header = archive_write_ar_header;
a->format_write_data = archive_write_ar_data;
a->format_finish = archive_write_ar_finish;
@@ -144,7 +145,6 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry)
const char *filename;
int64_t size;
- ret = 0;
append_fn = 0;
ar = (struct ar_w *)a->format_data;
ar->is_strtab = 0;
@@ -389,6 +389,9 @@ archive_write_ar_destroy(struct archive_write *a)
ar = (struct ar_w *)a->format_data;
+ if (ar == NULL)
+ return (ARCHIVE_OK);
+
if (ar->has_strtab > 0) {
free(ar->strtab);
ar->strtab = NULL;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_by_name.c b/archivers/libarchive/files/libarchive/archive_write_set_format_by_name.c
index 0d7cae4867d..a0921199c22 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_by_name.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_by_name.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_by_name.c,v 1.7 2007/06/22 05:47:00 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_by_name.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -44,11 +44,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_by_name.c,v 1.7
static
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
- { "arbsd", archive_write_set_format_ar_bsd },
{ "ar", archive_write_set_format_ar_bsd },
+ { "arbsd", archive_write_set_format_ar_bsd },
{ "argnu", archive_write_set_format_ar_svr4 },
{ "arsvr4", archive_write_set_format_ar_svr4 },
{ "cpio", archive_write_set_format_cpio },
+ { "mtree", archive_write_set_format_mtree },
{ "newc", archive_write_set_format_cpio_newc },
{ "odc", archive_write_set_format_cpio },
{ "pax", archive_write_set_format_pax },
@@ -56,6 +57,7 @@ struct { const char *name; int (*setter)(struct archive *); } names[] =
{ "shar", archive_write_set_format_shar },
{ "shardump", archive_write_set_format_shar_dump },
{ "ustar", archive_write_set_format_ustar },
+ { "zip", archive_write_set_format_zip },
{ NULL, NULL }
};
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
index 61042999efa..4e8e1e0bdca 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio.c,v 1.14 2008/03/15 11:04:45 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_cpio.c 201170 2009-12-29 06:34:23Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -54,6 +54,12 @@ static int64_t format_octal_recursive(int64_t, char *, int);
struct cpio {
uint64_t entry_bytes_remaining;
+
+ int64_t ino_next;
+
+ struct { int64_t old; int new;} *ino_list;
+ size_t ino_list_size;
+ size_t ino_list_next;
};
struct cpio_header {
@@ -92,6 +98,7 @@ archive_write_set_format_cpio(struct archive *_a)
a->format_data = cpio;
a->pad_uncompressed = 1;
+ a->format_name = "cpio";
a->format_write_header = archive_write_cpio_header;
a->format_write_data = archive_write_cpio_data;
a->format_finish_entry = archive_write_cpio_finish_entry;
@@ -102,34 +109,102 @@ archive_write_set_format_cpio(struct archive *_a)
return (ARCHIVE_OK);
}
+/*
+ * Ino values are as long as 64 bits on some systems; cpio format
+ * only allows 18 bits and relies on the ino values to identify hardlinked
+ * files. So, we can't merely "hash" the ino numbers since collisions
+ * would corrupt the archive. Instead, we generate synthetic ino values
+ * to store in the archive and maintain a map of original ino values to
+ * synthetic ones so we can preserve hardlink information.
+ *
+ * TODO: Make this more efficient. It's not as bad as it looks (most
+ * files don't have any hardlinks and we don't do any work here for those),
+ * but it wouldn't be hard to do better.
+ *
+ * TODO: Work with dev/ino pairs here instead of just ino values.
+ */
+static int
+synthesize_ino_value(struct cpio *cpio, struct archive_entry *entry)
+{
+ int64_t ino = archive_entry_ino64(entry);
+ int ino_new;
+ size_t i;
+
+ /*
+ * If no index number was given, don't assign one. In
+ * particular, this handles the end-of-archive marker
+ * correctly by giving it a zero index value. (This is also
+ * why we start our synthetic index numbers with one below.)
+ */
+ if (ino == 0)
+ return (0);
+
+ /* Don't store a mapping if we don't need to. */
+ if (archive_entry_nlink(entry) < 2) {
+ return ++cpio->ino_next;
+ }
+
+ /* Look up old ino; if we have it, this is a hardlink
+ * and we reuse the same value. */
+ for (i = 0; i < cpio->ino_list_next; ++i) {
+ if (cpio->ino_list[i].old == ino)
+ return (cpio->ino_list[i].new);
+ }
+
+ /* Assign a new index number. */
+ ino_new = ++cpio->ino_next;
+
+ /* Ensure space for the new mapping. */
+ if (cpio->ino_list_size <= cpio->ino_list_next) {
+ size_t newsize = cpio->ino_list_size < 512
+ ? 512 : cpio->ino_list_size * 2;
+ void *newlist = realloc(cpio->ino_list,
+ sizeof(cpio->ino_list[0]) * newsize);
+ if (newlist == NULL)
+ return (-1);
+
+ cpio->ino_list_size = newsize;
+ cpio->ino_list = newlist;
+ }
+
+ /* Record and return the new value. */
+ cpio->ino_list[cpio->ino_list_next].old = ino;
+ cpio->ino_list[cpio->ino_list_next].new = ino_new;
+ ++cpio->ino_list_next;
+ return (ino_new);
+}
+
static int
archive_write_cpio_header(struct archive_write *a, struct archive_entry *entry)
{
struct cpio *cpio;
const char *p, *path;
- int pathlength, ret;
+ int pathlength, ret, ret2;
+ int64_t ino;
struct cpio_header h;
cpio = (struct cpio *)a->format_data;
- ret = 0;
+ ret2 = ARCHIVE_OK;
path = archive_entry_pathname(entry);
- pathlength = strlen(path) + 1; /* Include trailing null. */
+ pathlength = (int)strlen(path) + 1; /* Include trailing null. */
memset(&h, 0, sizeof(h));
format_octal(070707, &h.c_magic, sizeof(h.c_magic));
format_octal(archive_entry_dev(entry), &h.c_dev, sizeof(h.c_dev));
- /*
- * TODO: Generate artificial inode numbers rather than just
- * re-using the ones off the disk. That way, the 18-bit c_ino
- * field only limits the number of files in the archive.
- */
- if (archive_entry_ino(entry) > 0777777) {
- archive_set_error(&a->archive, ERANGE, "large inode number truncated");
- ret = ARCHIVE_WARN;
+
+ ino = synthesize_ino_value(cpio, entry);
+ if (ino < 0) {
+ archive_set_error(&a->archive, ENOMEM,
+ "No memory for ino translation table");
+ return (ARCHIVE_FATAL);
+ } else if (ino > 0777777) {
+ archive_set_error(&a->archive, ERANGE,
+ "Too many files for this cpio format");
+ return (ARCHIVE_FATAL);
}
+ format_octal(ino & 0777777, &h.c_ino, sizeof(h.c_ino));
- format_octal(archive_entry_ino(entry) & 0777777, &h.c_ino, sizeof(h.c_ino));
format_octal(archive_entry_mode(entry), &h.c_mode, sizeof(h.c_mode));
format_octal(archive_entry_uid(entry), &h.c_uid, sizeof(h.c_uid));
format_octal(archive_entry_gid(entry), &h.c_gid, sizeof(h.c_gid));
@@ -168,6 +243,8 @@ archive_write_cpio_header(struct archive_write *a, struct archive_entry *entry)
if (p != NULL && *p != '\0')
ret = (a->compressor.write)(a, p, strlen(p));
+ if (ret == ARCHIVE_OK)
+ ret = ret2;
return (ret);
}
@@ -216,17 +293,15 @@ format_octal_recursive(int64_t v, char *p, int s)
return (v);
v = format_octal_recursive(v, p+1, s-1);
*p = '0' + (v & 7);
- return (v >>= 3);
+ return (v >> 3);
}
static int
archive_write_cpio_finish(struct archive_write *a)
{
- struct cpio *cpio;
int er;
struct archive_entry *trailer;
- cpio = (struct cpio *)a->format_data;
trailer = archive_entry_new();
/* nlink = 1 here for GNU cpio compat. */
archive_entry_set_nlink(trailer, 1);
@@ -242,6 +317,7 @@ archive_write_cpio_destroy(struct archive_write *a)
struct cpio *cpio;
cpio = (struct cpio *)a->format_data;
+ free(cpio->ino_list);
free(cpio);
a->format_data = NULL;
return (ARCHIVE_OK);
@@ -251,7 +327,8 @@ static int
archive_write_cpio_finish_entry(struct archive_write *a)
{
struct cpio *cpio;
- int to_write, ret;
+ size_t to_write;
+ int ret;
cpio = (struct cpio *)a->format_data;
ret = ARCHIVE_OK;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
index b5a2a028419..0af0890952e 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio_newc.c,v 1.4 2008/03/15 11:04:45 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_cpio_newc.c 201160 2009-12-29 05:41:57Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -75,6 +75,9 @@ struct cpio_header_newc {
char c_checksum[8];
};
+/* Logic trick: difference between 'n' and next multiple of 4 */
+#define PAD4(n) (3 & (1 + ~(n)))
+
/*
* Set output format to 'cpio' format.
*/
@@ -97,6 +100,7 @@ archive_write_set_format_cpio_newc(struct archive *_a)
a->format_data = cpio;
a->pad_uncompressed = 1;
+ a->format_name = "cpio";
a->format_write_header = archive_write_newc_header;
a->format_write_data = archive_write_newc_data;
a->format_finish_entry = archive_write_newc_finish_entry;
@@ -110,28 +114,34 @@ archive_write_set_format_cpio_newc(struct archive *_a)
static int
archive_write_newc_header(struct archive_write *a, struct archive_entry *entry)
{
+ int64_t ino;
struct cpio *cpio;
const char *p, *path;
- int pathlength, ret;
+ int pathlength, ret, ret2;
struct cpio_header_newc h;
int pad;
cpio = (struct cpio *)a->format_data;
- ret = 0;
+ ret2 = ARCHIVE_OK;
path = archive_entry_pathname(entry);
- pathlength = strlen(path) + 1; /* Include trailing null. */
+ pathlength = (int)strlen(path) + 1; /* Include trailing null. */
memset(&h, 0, sizeof(h));
format_hex(0x070701, &h.c_magic, sizeof(h.c_magic));
- format_hex(archive_entry_devmajor(entry), &h.c_devmajor, sizeof(h.c_devmajor));
- format_hex(archive_entry_devminor(entry), &h.c_devminor, sizeof(h.c_devminor));
- if (archive_entry_ino(entry) > 0xffffffff) {
- archive_set_error(&a->archive, ERANGE, "large inode number truncated");
- ret = ARCHIVE_WARN;
+ format_hex(archive_entry_devmajor(entry), &h.c_devmajor,
+ sizeof(h.c_devmajor));
+ format_hex(archive_entry_devminor(entry), &h.c_devminor,
+ sizeof(h.c_devminor));
+
+ ino = archive_entry_ino64(entry);
+ if (ino > 0xffffffff) {
+ archive_set_error(&a->archive, ERANGE,
+ "large inode number truncated");
+ ret2 = ARCHIVE_WARN;
}
- format_hex(archive_entry_ino(entry) & 0xffffffff, &h.c_ino, sizeof(h.c_ino));
+ format_hex(ino & 0xffffffff, &h.c_ino, sizeof(h.c_ino));
format_hex(archive_entry_mode(entry), &h.c_mode, sizeof(h.c_mode));
format_hex(archive_entry_uid(entry), &h.c_uid, sizeof(h.c_uid));
format_hex(archive_entry_gid(entry), &h.c_gid, sizeof(h.c_gid));
@@ -168,24 +178,26 @@ archive_write_newc_header(struct archive_write *a, struct archive_entry *entry)
ret = (a->compressor.write)(a, path, pathlength);
if (ret != ARCHIVE_OK)
return (ARCHIVE_FATAL);
- pad = 0x3 & - (pathlength + sizeof(struct cpio_header_newc));
+ pad = PAD4(pathlength + sizeof(struct cpio_header_newc));
if (pad)
ret = (a->compressor.write)(a, "\0\0\0", pad);
if (ret != ARCHIVE_OK)
return (ARCHIVE_FATAL);
cpio->entry_bytes_remaining = archive_entry_size(entry);
- cpio->padding = 3 & (-cpio->entry_bytes_remaining);
+ cpio->padding = PAD4(cpio->entry_bytes_remaining);
/* Write the symlink now. */
if (p != NULL && *p != '\0') {
ret = (a->compressor.write)(a, p, strlen(p));
if (ret != ARCHIVE_OK)
return (ARCHIVE_FATAL);
- pad = 0x3 & -strlen(p);
+ pad = PAD4(strlen(p));
ret = (a->compressor.write)(a, "\0\0\0", pad);
}
+ if (ret == ARCHIVE_OK)
+ ret = ret2;
return (ret);
}
@@ -234,17 +246,15 @@ format_hex_recursive(int64_t v, char *p, int s)
return (v);
v = format_hex_recursive(v, p+1, s-1);
*p = "0123456789abcdef"[v & 0xf];
- return (v >>= 4);
+ return (v >> 4);
}
static int
archive_write_newc_finish(struct archive_write *a)
{
- struct cpio *cpio;
int er;
struct archive_entry *trailer;
- cpio = (struct cpio *)a->format_data;
trailer = archive_entry_new();
archive_entry_set_nlink(trailer, 1);
archive_entry_set_pathname(trailer, "TRAILER!!!");
@@ -268,10 +278,10 @@ static int
archive_write_newc_finish_entry(struct archive_write *a)
{
struct cpio *cpio;
- int to_write, ret;
+ size_t to_write;
+ int ret;
cpio = (struct cpio *)a->format_data;
- ret = ARCHIVE_OK;
while (cpio->entry_bytes_remaining > 0) {
to_write = cpio->entry_bytes_remaining < a->null_length ?
cpio->entry_bytes_remaining : a->null_length;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_mtree.c b/archivers/libarchive/files/libarchive/archive_write_set_format_mtree.c
new file mode 100644
index 00000000000..7feeca92e62
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_mtree.c
@@ -0,0 +1,1050 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2008 Joerg Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_mtree.c 201171 2009-12-29 06:39:07Z kientzle $");
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "archive.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_write_private.h"
+
+#include "archive_hash.h"
+
+#define INDENTNAMELEN 15
+#define MAXLINELEN 80
+
+struct mtree_writer {
+ struct archive_entry *entry;
+ struct archive_string ebuf;
+ struct archive_string buf;
+ int first;
+ uint64_t entry_bytes_remaining;
+ struct {
+ int output;
+ int processed;
+ struct archive_string parent;
+ mode_t type;
+ int keys;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
+ unsigned long fflags_set;
+ unsigned long fflags_clear;
+ } set;
+ /* chekc sum */
+ int compute_sum;
+ uint32_t crc;
+ uint64_t crc_len;
+#ifdef ARCHIVE_HAS_MD5
+ archive_md5_ctx md5ctx;
+#endif
+#ifdef ARCHIVE_HAS_RMD160
+ archive_rmd160_ctx rmd160ctx;
+#endif
+#ifdef ARCHIVE_HAS_SHA1
+ archive_sha1_ctx sha1ctx;
+#endif
+#ifdef ARCHIVE_HAS_SHA256
+ archive_sha256_ctx sha256ctx;
+#endif
+#ifdef ARCHIVE_HAS_SHA384
+ archive_sha384_ctx sha384ctx;
+#endif
+#ifdef ARCHIVE_HAS_SHA512
+ archive_sha512_ctx sha512ctx;
+#endif
+ /* Keyword options */
+ int keys;
+#define F_CKSUM 0x00000001 /* check sum */
+#define F_DEV 0x00000002 /* device type */
+#define F_DONE 0x00000004 /* directory done */
+#define F_FLAGS 0x00000008 /* file flags */
+#define F_GID 0x00000010 /* gid */
+#define F_GNAME 0x00000020 /* group name */
+#define F_IGN 0x00000040 /* ignore */
+#define F_MAGIC 0x00000080 /* name has magic chars */
+#define F_MD5 0x00000100 /* MD5 digest */
+#define F_MODE 0x00000200 /* mode */
+#define F_NLINK 0x00000400 /* number of links */
+#define F_NOCHANGE 0x00000800 /* If owner/mode "wrong", do
+ * not change */
+#define F_OPT 0x00001000 /* existence optional */
+#define F_RMD160 0x00002000 /* RIPEMD160 digest */
+#define F_SHA1 0x00004000 /* SHA-1 digest */
+#define F_SIZE 0x00008000 /* size */
+#define F_SLINK 0x00010000 /* symbolic link */
+#define F_TAGS 0x00020000 /* tags */
+#define F_TIME 0x00040000 /* modification time */
+#define F_TYPE 0x00080000 /* file type */
+#define F_UID 0x00100000 /* uid */
+#define F_UNAME 0x00200000 /* user name */
+#define F_VISIT 0x00400000 /* file visited */
+#define F_SHA256 0x00800000 /* SHA-256 digest */
+#define F_SHA384 0x01000000 /* SHA-384 digest */
+#define F_SHA512 0x02000000 /* SHA-512 digest */
+
+ /* Options */
+ int dironly; /* if the dironly is 1, ignore everything except
+ * directory type files. like mtree(8) -d option.
+ */
+ int indent; /* if the indent is 1, indent writing data. */
+};
+
+#define DEFAULT_KEYS (F_DEV | F_FLAGS | F_GID | F_GNAME | F_SLINK | F_MODE\
+ | F_NLINK | F_SIZE | F_TIME | F_TYPE | F_UID\
+ | F_UNAME)
+
+#define COMPUTE_CRC(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]
+static const uint32_t crctab[] = {
+ 0x0,
+ 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
+ 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
+ 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+ 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac,
+ 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f,
+ 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a,
+ 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+ 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58,
+ 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033,
+ 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe,
+ 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+ 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4,
+ 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0,
+ 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5,
+ 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+ 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07,
+ 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c,
+ 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1,
+ 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+ 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b,
+ 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698,
+ 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d,
+ 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+ 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f,
+ 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34,
+ 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80,
+ 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+ 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a,
+ 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629,
+ 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c,
+ 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+ 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e,
+ 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65,
+ 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8,
+ 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+ 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2,
+ 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71,
+ 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74,
+ 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+ 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21,
+ 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a,
+ 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087,
+ 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+ 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d,
+ 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce,
+ 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb,
+ 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+ 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09,
+ 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662,
+ 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf,
+ 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+};
+
+static int
+mtree_safe_char(char c)
+{
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+ return 1;
+ if (c >= '0' && c <= '9')
+ return 1;
+ if (c == 35 || c == 61 || c == 92)
+ return 0; /* #, = and \ are always quoted */
+
+ if (c >= 33 && c <= 47) /* !"$%&'()*+,-./ */
+ return 1;
+ if (c >= 58 && c <= 64) /* :;<>?@ */
+ return 1;
+ if (c >= 91 && c <= 96) /* []^_` */
+ return 1;
+ if (c >= 123 && c <= 126) /* {|}~ */
+ return 1;
+ return 0;
+}
+
+static void
+mtree_quote(struct archive_string *s, const char *str)
+{
+ const char *start;
+ char buf[4];
+ unsigned char c;
+
+ for (start = str; *str != '\0'; ++str) {
+ if (mtree_safe_char(*str))
+ continue;
+ if (start != str)
+ archive_strncat(s, start, str - start);
+ c = (unsigned char)*str;
+ buf[0] = '\\';
+ buf[1] = (c / 64) + '0';
+ buf[2] = (c / 8 % 8) + '0';
+ buf[3] = (c % 8) + '0';
+ archive_strncat(s, buf, 4);
+ start = str + 1;
+ }
+
+ if (start != str)
+ archive_strncat(s, start, str - start);
+}
+
+static void
+mtree_indent(struct mtree_writer *mtree)
+{
+ int i, fn;
+ const char *r, *s, *x;
+
+ fn = 1;
+ s = r = mtree->ebuf.s;
+ x = NULL;
+ while (*r == ' ')
+ r++;
+ while ((r = strchr(r, ' ')) != NULL) {
+ if (fn) {
+ fn = 0;
+ archive_strncat(&mtree->buf, s, r - s);
+ if (r -s > INDENTNAMELEN) {
+ archive_strncat(&mtree->buf, " \\\n", 3);
+ for (i = 0; i < (INDENTNAMELEN + 1); i++)
+ archive_strappend_char(&mtree->buf, ' ');
+ } else {
+ for (i = r -s; i < (INDENTNAMELEN + 1); i++)
+ archive_strappend_char(&mtree->buf, ' ');
+ }
+ s = ++r;
+ x = NULL;
+ continue;
+ }
+ if (r - s <= MAXLINELEN - 3 - INDENTNAMELEN)
+ x = r++;
+ else {
+ if (x == NULL)
+ x = r;
+ archive_strncat(&mtree->buf, s, x - s);
+ archive_strncat(&mtree->buf, " \\\n", 3);
+ for (i = 0; i < (INDENTNAMELEN + 1); i++)
+ archive_strappend_char(&mtree->buf, ' ');
+ s = r = ++x;
+ x = NULL;
+ }
+ }
+ if (x != NULL && strlen(s) > MAXLINELEN - 3 - INDENTNAMELEN) {
+ /* Last keyword is longer. */
+ archive_strncat(&mtree->buf, s, x - s);
+ archive_strncat(&mtree->buf, " \\\n", 3);
+ for (i = 0; i < (INDENTNAMELEN + 1); i++)
+ archive_strappend_char(&mtree->buf, ' ');
+ s = ++x;
+ }
+ archive_strcat(&mtree->buf, s);
+ archive_string_empty(&mtree->ebuf);
+}
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+static size_t
+dir_len(struct archive_entry *entry)
+{
+ const char *path, *r;
+
+ path = archive_entry_pathname(entry);
+ r = strrchr(path, '/');
+ if (r == NULL)
+ return (0);
+ /* Include a separator size */
+ return (r - path + 1);
+}
+
+#else /* _WIN32 && !__CYGWIN__ */
+/*
+ * Note: We should use wide-character for findng '\' character,
+ * a directory separator on Windows, because some character-set have
+ * been using the '\' character for a part of its multibyte character
+ * code.
+ */
+static size_t
+dir_len(struct archive_entry *entry)
+{
+ wchar_t wc;
+ const char *path;
+ const char *p, *rp;
+ size_t al, l, size;
+
+ path = archive_entry_pathname(entry);
+ al = l = -1;
+ for (p = path; *p != '\0'; ++p) {
+ if (*p == '\\')
+ al = l = p - path;
+ else if (*p == '/')
+ al = p - path;
+ }
+ if (l == -1)
+ goto alen;
+ size = p - path;
+ rp = p = path;
+ while (*p != '\0') {
+ l = mbtowc(&wc, p, size);
+ if (l == -1)
+ goto alen;
+ if (l == 1 && (wc == L'/' || wc == L'\\'))
+ rp = p;
+ p += l;
+ size -= l;
+ }
+ return (rp - path + 1);
+alen:
+ if (al == -1)
+ return (0);
+ return (al + 1);
+}
+#endif /* _WIN32 && !__CYGWIN__ */
+
+static int
+parent_dir_changed(struct archive_string *dir, struct archive_entry *entry)
+{
+ const char *path;
+ size_t l;
+
+ l = dir_len(entry);
+ path = archive_entry_pathname(entry);
+ if (archive_strlen(dir) > 0) {
+ if (l == 0) {
+ archive_string_empty(dir);
+ return (1);
+ }
+ if (strncmp(dir->s, path, l) == 0)
+ return (0); /* The parent directory is the same. */
+ } else if (l == 0)
+ return (0); /* The parent directory is the same. */
+ archive_strncpy(dir, path, l);
+ return (1);
+}
+
+/*
+ * Write /set keyword. It means set global datas.
+ * [directory-only mode]
+ * - It is only once to write /set keyword. It is using values of the
+ * first entry.
+ * [normal mode]
+ * - Write /set keyword. It is using values of the first entry whose
+ * filetype is a regular file.
+ * - When a parent directory of the entry whose filetype is the regular
+ * file is changed, check the global datas and write it again if its
+ * values are different from the entry's.
+ */
+static void
+set_global(struct mtree_writer *mtree, struct archive_entry *entry)
+{
+ struct archive_string setstr;
+ struct archive_string unsetstr;
+ const char *name;
+ int keys, oldkeys, effkeys;
+ mode_t set_type = 0;
+
+ switch (archive_entry_filetype(entry)) {
+ case AE_IFLNK: case AE_IFSOCK: case AE_IFCHR:
+ case AE_IFBLK: case AE_IFIFO:
+ break;
+ case AE_IFDIR:
+ if (mtree->dironly)
+ set_type = AE_IFDIR;
+ break;
+ case AE_IFREG:
+ default: /* Handle unknown file types as regular files. */
+ if (!mtree->dironly)
+ set_type = AE_IFREG;
+ break;
+ }
+ if (set_type == 0)
+ return;
+ if (mtree->set.processed &&
+ !parent_dir_changed(&mtree->set.parent, entry))
+ return;
+ /* At first, save a parent directory of the entry for following
+ * entries. */
+ if (!mtree->set.processed && set_type == AE_IFREG)
+ parent_dir_changed(&mtree->set.parent, entry);
+
+ archive_string_init(&setstr);
+ archive_string_init(&unsetstr);
+ keys = mtree->keys & (F_FLAGS | F_GID | F_GNAME | F_NLINK | F_MODE
+ | F_TYPE | F_UID | F_UNAME);
+ oldkeys = mtree->set.keys;
+ effkeys = keys;
+ if (mtree->set.processed) {
+ /*
+ * Check the global datas for whether it needs updating.
+ */
+ effkeys &= ~F_TYPE;
+ if ((oldkeys & (F_UNAME | F_UID)) != 0 &&
+ mtree->set.uid == archive_entry_uid(entry))
+ effkeys &= ~(F_UNAME | F_UID);
+ if ((oldkeys & (F_GNAME | F_GID)) != 0 &&
+ mtree->set.gid == archive_entry_gid(entry))
+ effkeys &= ~(F_GNAME | F_GID);
+ if ((oldkeys & F_MODE) != 0 &&
+ mtree->set.mode == (archive_entry_mode(entry) & 07777))
+ effkeys &= ~F_MODE;
+ if ((oldkeys & F_FLAGS) != 0) {
+ unsigned long fflags_set;
+ unsigned long fflags_clear;
+
+ archive_entry_fflags(entry, &fflags_set, &fflags_clear);
+ if (fflags_set == mtree->set.fflags_set &&
+ fflags_clear == mtree->set.fflags_clear)
+ effkeys &= ~F_FLAGS;
+ }
+ }
+ if ((keys & effkeys & F_TYPE) != 0) {
+ mtree->set.type = set_type;
+ if (set_type == AE_IFDIR)
+ archive_strcat(&setstr, " type=dir");
+ else
+ archive_strcat(&setstr, " type=file");
+ }
+ if ((keys & effkeys & F_UNAME) != 0) {
+ if ((name = archive_entry_uname(entry)) != NULL) {
+ archive_strcat(&setstr, " uname=");
+ mtree_quote(&setstr, name);
+ } else if ((oldkeys & F_UNAME) != 0)
+ archive_strcat(&unsetstr, " uname");
+ else
+ keys &= ~F_UNAME;
+ }
+ if ((keys & effkeys & F_UID) != 0) {
+ mtree->set.uid = archive_entry_uid(entry);
+ archive_string_sprintf(&setstr, " uid=%jd",
+ (intmax_t)mtree->set.uid);
+ }
+ if ((keys & effkeys & F_GNAME) != 0) {
+ if ((name = archive_entry_gname(entry)) != NULL) {
+ archive_strcat(&setstr, " gname=");
+ mtree_quote(&setstr, name);
+ } else if ((oldkeys & F_GNAME) != 0)
+ archive_strcat(&unsetstr, " gname");
+ else
+ keys &= ~F_GNAME;
+ }
+ if ((keys & effkeys & F_GID) != 0) {
+ mtree->set.gid = archive_entry_gid(entry);
+ archive_string_sprintf(&setstr, " gid=%jd",
+ (intmax_t)mtree->set.gid);
+ }
+ if ((keys & effkeys & F_MODE) != 0) {
+ mtree->set.mode = archive_entry_mode(entry) & 07777;
+ archive_string_sprintf(&setstr, " mode=%o", mtree->set.mode);
+ }
+ if ((keys & effkeys & F_FLAGS) != 0) {
+ if ((name = archive_entry_fflags_text(entry)) != NULL) {
+ archive_strcat(&setstr, " flags=");
+ mtree_quote(&setstr, name);
+ archive_entry_fflags(entry, &mtree->set.fflags_set,
+ &mtree->set.fflags_clear);
+ } else if ((oldkeys & F_FLAGS) != 0)
+ archive_strcat(&unsetstr, " flags");
+ else
+ keys &= ~F_FLAGS;
+ }
+ if (unsetstr.length > 0)
+ archive_string_sprintf(&mtree->buf, "/unset%s\n", unsetstr.s);
+ archive_string_free(&unsetstr);
+ if (setstr.length > 0)
+ archive_string_sprintf(&mtree->buf, "/set%s\n", setstr.s);
+ archive_string_free(&setstr);
+ mtree->set.keys = keys;
+ mtree->set.processed = 1;
+ /* On directory-only mode, it is only once to write /set keyword. */
+ if (mtree->dironly)
+ mtree->set.output = 0;
+}
+
+static int
+get_keys(struct mtree_writer *mtree, struct archive_entry *entry)
+{
+ int keys;
+
+ keys = mtree->keys;
+ if (mtree->set.keys == 0)
+ return (keys);
+ if ((mtree->set.keys & (F_GNAME | F_GID)) != 0 &&
+ mtree->set.gid == archive_entry_gid(entry))
+ keys &= ~(F_GNAME | F_GID);
+ if ((mtree->set.keys & (F_UNAME | F_UID)) != 0 &&
+ mtree->set.uid == archive_entry_uid(entry))
+ keys &= ~(F_UNAME | F_UID);
+ if (mtree->set.keys & F_FLAGS) {
+ unsigned long set, clear;
+
+ archive_entry_fflags(entry, &set, &clear);
+ if (mtree->set.fflags_set == set &&
+ mtree->set.fflags_clear == clear)
+ keys &= ~F_FLAGS;
+ }
+ if ((mtree->set.keys & F_MODE) != 0 &&
+ mtree->set.mode == (archive_entry_mode(entry) & 07777))
+ keys &= ~F_MODE;
+
+ switch (archive_entry_filetype(entry)) {
+ case AE_IFLNK: case AE_IFSOCK: case AE_IFCHR:
+ case AE_IFBLK: case AE_IFIFO:
+ break;
+ case AE_IFDIR:
+ if ((mtree->set.keys & F_TYPE) != 0 &&
+ mtree->set.type == AE_IFDIR)
+ keys &= ~F_TYPE;
+ break;
+ case AE_IFREG:
+ default: /* Handle unknown file types as regular files. */
+ if ((mtree->set.keys & F_TYPE) != 0 &&
+ mtree->set.type == AE_IFREG)
+ keys &= ~F_TYPE;
+ break;
+ }
+
+ return (keys);
+}
+
+static int
+archive_write_mtree_header(struct archive_write *a,
+ struct archive_entry *entry)
+{
+ struct mtree_writer *mtree= a->format_data;
+ struct archive_string *str;
+ const char *path;
+
+ mtree->entry = archive_entry_clone(entry);
+ path = archive_entry_pathname(mtree->entry);
+
+ if (mtree->first) {
+ mtree->first = 0;
+ archive_strcat(&mtree->buf, "#mtree\n");
+ }
+ if (mtree->set.output)
+ set_global(mtree, entry);
+
+ archive_string_empty(&mtree->ebuf);
+ str = (mtree->indent)? &mtree->ebuf : &mtree->buf;
+ if (!mtree->dironly || archive_entry_filetype(entry) == AE_IFDIR)
+ mtree_quote(str, path);
+
+ mtree->entry_bytes_remaining = archive_entry_size(entry);
+ if ((mtree->keys & F_CKSUM) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_CKSUM;
+ mtree->crc = 0;
+ mtree->crc_len = 0;
+ } else
+ mtree->compute_sum &= ~F_CKSUM;
+#ifdef ARCHIVE_HAS_MD5
+ if ((mtree->keys & F_MD5) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_MD5;
+ archive_md5_init(&mtree->md5ctx);
+ } else
+ mtree->compute_sum &= ~F_MD5;
+#endif
+#ifdef ARCHIVE_HAS_RMD160
+ if ((mtree->keys & F_RMD160) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_RMD160;
+ archive_rmd160_init(&mtree->rmd160ctx);
+ } else
+ mtree->compute_sum &= ~F_RMD160;
+#endif
+#ifdef ARCHIVE_HAS_SHA1
+ if ((mtree->keys & F_SHA1) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_SHA1;
+ archive_sha1_init(&mtree->sha1ctx);
+ } else
+ mtree->compute_sum &= ~F_SHA1;
+#endif
+#ifdef ARCHIVE_HAS_SHA256
+ if ((mtree->keys & F_SHA256) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_SHA256;
+ archive_sha256_init(&mtree->sha256ctx);
+ } else
+ mtree->compute_sum &= ~F_SHA256;
+#endif
+#ifdef ARCHIVE_HAS_SHA384
+ if ((mtree->keys & F_SHA384) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_SHA384;
+ archive_sha384_init(&mtree->sha384ctx);
+ } else
+ mtree->compute_sum &= ~F_SHA384;
+#endif
+#ifdef ARCHIVE_HAS_SHA512
+ if ((mtree->keys & F_SHA512) != 0 &&
+ archive_entry_filetype(entry) == AE_IFREG) {
+ mtree->compute_sum |= F_SHA512;
+ archive_sha512_init(&mtree->sha512ctx);
+ } else
+ mtree->compute_sum &= ~F_SHA512;
+#endif
+
+ return (ARCHIVE_OK);
+}
+
+#if defined(ARCHIVE_HAS_MD5) || defined(ARCHIVE_HAS_RMD160) || \
+ defined(ARCHIVE_HAS_SHA1) || defined(ARCHIVE_HAS_SHA256) || \
+ defined(ARCHIVE_HAS_SHA384) || defined(ARCHIVE_HAS_SHA512)
+static void
+strappend_bin(struct archive_string *s, const unsigned char *bin, int n)
+{
+ static const char hex[] = "0123456789abcdef";
+ int i;
+
+ for (i = 0; i < n; i++) {
+ archive_strappend_char(s, hex[bin[i] >> 4]);
+ archive_strappend_char(s, hex[bin[i] & 0x0f]);
+ }
+}
+#endif
+
+static int
+archive_write_mtree_finish_entry(struct archive_write *a)
+{
+ struct mtree_writer *mtree = a->format_data;
+ struct archive_entry *entry;
+ struct archive_string *str;
+ const char *name;
+ int keys, ret;
+
+ entry = mtree->entry;
+ if (entry == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
+ "Finished entry without being open first.");
+ return (ARCHIVE_FATAL);
+ }
+ mtree->entry = NULL;
+
+ if (mtree->dironly && archive_entry_filetype(entry) != AE_IFDIR) {
+ archive_entry_free(entry);
+ return (ARCHIVE_OK);
+ }
+
+ str = (mtree->indent)? &mtree->ebuf : &mtree->buf;
+ keys = get_keys(mtree, entry);
+ if ((keys & F_NLINK) != 0 &&
+ archive_entry_nlink(entry) != 1 &&
+ archive_entry_filetype(entry) != AE_IFDIR)
+ archive_string_sprintf(str,
+ " nlink=%u", archive_entry_nlink(entry));
+
+ if ((keys & F_GNAME) != 0 &&
+ (name = archive_entry_gname(entry)) != NULL) {
+ archive_strcat(str, " gname=");
+ mtree_quote(str, name);
+ }
+ if ((keys & F_UNAME) != 0 &&
+ (name = archive_entry_uname(entry)) != NULL) {
+ archive_strcat(str, " uname=");
+ mtree_quote(str, name);
+ }
+ if ((keys & F_FLAGS) != 0 &&
+ (name = archive_entry_fflags_text(entry)) != NULL) {
+ archive_strcat(str, " flags=");
+ mtree_quote(str, name);
+ }
+ if ((keys & F_TIME) != 0)
+ archive_string_sprintf(str, " time=%jd.%jd",
+ (intmax_t)archive_entry_mtime(entry),
+ (intmax_t)archive_entry_mtime_nsec(entry));
+ if ((keys & F_MODE) != 0)
+ archive_string_sprintf(str, " mode=%o",
+ archive_entry_mode(entry) & 07777);
+ if ((keys & F_GID) != 0)
+ archive_string_sprintf(str, " gid=%jd",
+ (intmax_t)archive_entry_gid(entry));
+ if ((keys & F_UID) != 0)
+ archive_string_sprintf(str, " uid=%jd",
+ (intmax_t)archive_entry_uid(entry));
+
+ switch (archive_entry_filetype(entry)) {
+ case AE_IFLNK:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=link");
+ if ((keys & F_SLINK) != 0) {
+ archive_strcat(str, " link=");
+ mtree_quote(str, archive_entry_symlink(entry));
+ }
+ break;
+ case AE_IFSOCK:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=socket");
+ break;
+ case AE_IFCHR:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=char");
+ if ((keys & F_DEV) != 0) {
+ archive_string_sprintf(str,
+ " device=native,%d,%d",
+ archive_entry_rdevmajor(entry),
+ archive_entry_rdevminor(entry));
+ }
+ break;
+ case AE_IFBLK:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=block");
+ if ((keys & F_DEV) != 0) {
+ archive_string_sprintf(str,
+ " device=native,%d,%d",
+ archive_entry_rdevmajor(entry),
+ archive_entry_rdevminor(entry));
+ }
+ break;
+ case AE_IFDIR:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=dir");
+ break;
+ case AE_IFIFO:
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=fifo");
+ break;
+ case AE_IFREG:
+ default: /* Handle unknown file types as regular files. */
+ if ((keys & F_TYPE) != 0)
+ archive_strcat(str, " type=file");
+ if ((keys & F_SIZE) != 0)
+ archive_string_sprintf(str, " size=%jd",
+ (intmax_t)archive_entry_size(entry));
+ break;
+ }
+
+ if (mtree->compute_sum & F_CKSUM) {
+ uint64_t len;
+ /* Include the length of the file. */
+ for (len = mtree->crc_len; len != 0; len >>= 8)
+ COMPUTE_CRC(mtree->crc, len & 0xff);
+ mtree->crc = ~mtree->crc;
+ archive_string_sprintf(str, " cksum=%ju",
+ (uintmax_t)mtree->crc);
+ }
+#ifdef ARCHIVE_HAS_MD5
+ if (mtree->compute_sum & F_MD5) {
+ unsigned char buf[16];
+
+ archive_md5_final(&mtree->md5ctx, buf);
+ archive_strcat(str, " md5digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+#ifdef ARCHIVE_HAS_RMD160
+ if (mtree->compute_sum & F_RMD160) {
+ unsigned char buf[20];
+
+ archive_rmd160_final(&mtree->rmd160ctx, buf);
+ archive_strcat(str, " rmd160digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+#ifdef ARCHIVE_HAS_SHA1
+ if (mtree->compute_sum & F_SHA1) {
+ unsigned char buf[20];
+
+ archive_sha1_final(&mtree->sha1ctx, buf);
+ archive_strcat(str, " sha1digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+#ifdef ARCHIVE_HAS_SHA256
+ if (mtree->compute_sum & F_SHA256) {
+ unsigned char buf[32];
+
+ archive_sha256_final(&mtree->sha256ctx, buf);
+ archive_strcat(str, " sha256digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+#ifdef ARCHIVE_HAS_SHA384
+ if (mtree->compute_sum & F_SHA384) {
+ unsigned char buf[48];
+
+ archive_sha384_final(&mtree->sha384ctx, buf);
+ archive_strcat(str, " sha384digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+#ifdef ARCHIVE_HAS_SHA512
+ if (mtree->compute_sum & F_SHA512) {
+ unsigned char buf[64];
+
+ archive_sha512_final(&mtree->sha512ctx, buf);
+ archive_strcat(str, " sha512digest=");
+ strappend_bin(str, buf, sizeof(buf));
+ }
+#endif
+ archive_strcat(str, "\n");
+ if (mtree->indent)
+ mtree_indent(mtree);
+
+ archive_entry_free(entry);
+
+ if (mtree->buf.length > 32768) {
+ ret = (a->compressor.write)(a, mtree->buf.s, mtree->buf.length);
+ archive_string_empty(&mtree->buf);
+ } else
+ ret = ARCHIVE_OK;
+
+ return (ret == ARCHIVE_OK ? ret : ARCHIVE_FATAL);
+}
+
+static int
+archive_write_mtree_finish(struct archive_write *a)
+{
+ struct mtree_writer *mtree= a->format_data;
+
+ archive_write_set_bytes_in_last_block(&a->archive, 1);
+
+ return (a->compressor.write)(a, mtree->buf.s, mtree->buf.length);
+}
+
+static ssize_t
+archive_write_mtree_data(struct archive_write *a, const void *buff, size_t n)
+{
+ struct mtree_writer *mtree= a->format_data;
+
+ if (n > mtree->entry_bytes_remaining)
+ n = mtree->entry_bytes_remaining;
+ if (mtree->dironly)
+ /* We don't need compute a regular file sum */
+ return (n);
+ if (mtree->compute_sum & F_CKSUM) {
+ /*
+ * Compute a POSIX 1003.2 checksum
+ */
+ const unsigned char *p;
+ size_t nn;
+
+ for (nn = n, p = buff; nn--; ++p)
+ COMPUTE_CRC(mtree->crc, *p);
+ mtree->crc_len += n;
+ }
+#ifdef ARCHIVE_HAS_MD5
+ if (mtree->compute_sum & F_MD5)
+ archive_md5_update(&mtree->md5ctx, buff, n);
+#endif
+#ifdef ARCHIVE_HAS_RMD160
+ if (mtree->compute_sum & F_RMD160)
+ archive_rmd160_update(&mtree->rmd160ctx, buff, n);
+#endif
+#ifdef ARCHIVE_HAS_SHA1
+ if (mtree->compute_sum & F_SHA1)
+ archive_sha1_update(&mtree->sha1ctx, buff, n);
+#endif
+#ifdef ARCHIVE_HAS_SHA256
+ if (mtree->compute_sum & F_SHA256)
+ archive_sha256_update(&mtree->sha256ctx, buff, n);
+#endif
+#ifdef ARCHIVE_HAS_SHA384
+ if (mtree->compute_sum & F_SHA384)
+ archive_sha384_update(&mtree->sha384ctx, buff, n);
+#endif
+#ifdef ARCHIVE_HAS_SHA512
+ if (mtree->compute_sum & F_SHA512)
+ archive_sha512_update(&mtree->sha512ctx, buff, n);
+#endif
+ return (n);
+}
+
+static int
+archive_write_mtree_destroy(struct archive_write *a)
+{
+ struct mtree_writer *mtree= a->format_data;
+
+ if (mtree == NULL)
+ return (ARCHIVE_OK);
+
+ archive_entry_free(mtree->entry);
+ archive_string_free(&mtree->ebuf);
+ archive_string_free(&mtree->buf);
+ archive_string_free(&mtree->set.parent);
+ free(mtree);
+ a->format_data = NULL;
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_write_mtree_options(struct archive_write *a, const char *key,
+ const char *value)
+{
+ struct mtree_writer *mtree= a->format_data;
+ int keybit = 0;
+
+ switch (key[0]) {
+ case 'a':
+ if (strcmp(key, "all") == 0)
+ keybit = ~0;
+ break;
+ case 'c':
+ if (strcmp(key, "cksum") == 0)
+ keybit = F_CKSUM;
+ break;
+ case 'd':
+ if (strcmp(key, "device") == 0)
+ keybit = F_DEV;
+ else if (strcmp(key, "dironly") == 0) {
+ mtree->dironly = (value != NULL)? 1: 0;
+ return (ARCHIVE_OK);
+ }
+ break;
+ case 'f':
+ if (strcmp(key, "flags") == 0)
+ keybit = F_FLAGS;
+ break;
+ case 'g':
+ if (strcmp(key, "gid") == 0)
+ keybit = F_GID;
+ else if (strcmp(key, "gname") == 0)
+ keybit = F_GNAME;
+ break;
+ case 'i':
+ if (strcmp(key, "indent") == 0) {
+ mtree->indent = (value != NULL)? 1: 0;
+ return (ARCHIVE_OK);
+ }
+ break;
+ case 'l':
+ if (strcmp(key, "link") == 0)
+ keybit = F_SLINK;
+ break;
+ case 'm':
+ if (strcmp(key, "md5") == 0 ||
+ strcmp(key, "md5digest") == 0)
+ keybit = F_MD5;
+ if (strcmp(key, "mode") == 0)
+ keybit = F_MODE;
+ break;
+ case 'n':
+ if (strcmp(key, "nlink") == 0)
+ keybit = F_NLINK;
+ break;
+ case 'r':
+ if (strcmp(key, "ripemd160digest") == 0 ||
+ strcmp(key, "rmd160") == 0 ||
+ strcmp(key, "rmd160digest") == 0)
+ keybit = F_RMD160;
+ break;
+ case 's':
+ if (strcmp(key, "sha1") == 0 ||
+ strcmp(key, "sha1digest") == 0)
+ keybit = F_SHA1;
+ if (strcmp(key, "sha256") == 0 ||
+ strcmp(key, "sha256digest") == 0)
+ keybit = F_SHA256;
+ if (strcmp(key, "sha384") == 0 ||
+ strcmp(key, "sha384digest") == 0)
+ keybit = F_SHA384;
+ if (strcmp(key, "sha512") == 0 ||
+ strcmp(key, "sha512digest") == 0)
+ keybit = F_SHA512;
+ if (strcmp(key, "size") == 0)
+ keybit = F_SIZE;
+ break;
+ case 't':
+ if (strcmp(key, "time") == 0)
+ keybit = F_TIME;
+ else if (strcmp(key, "type") == 0)
+ keybit = F_TYPE;
+ break;
+ case 'u':
+ if (strcmp(key, "uid") == 0)
+ keybit = F_UID;
+ else if (strcmp(key, "uname") == 0)
+ keybit = F_UNAME;
+ else if (strcmp(key, "use-set") == 0) {
+ mtree->set.output = (value != NULL)? 1: 0;
+ return (ARCHIVE_OK);
+ }
+ break;
+ }
+ if (keybit != 0) {
+ if (value != NULL)
+ mtree->keys |= keybit;
+ else
+ mtree->keys &= ~keybit;
+ return (ARCHIVE_OK);
+ }
+
+ return (ARCHIVE_WARN);
+}
+
+int
+archive_write_set_format_mtree(struct archive *_a)
+{
+ struct archive_write *a = (struct archive_write *)_a;
+ struct mtree_writer *mtree;
+
+ if (a->format_destroy != NULL)
+ (a->format_destroy)(a);
+
+ if ((mtree = malloc(sizeof(*mtree))) == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate mtree data");
+ return (ARCHIVE_FATAL);
+ }
+
+ mtree->entry = NULL;
+ mtree->first = 1;
+ memset(&(mtree->set), 0, sizeof(mtree->set));
+ archive_string_init(&mtree->set.parent);
+ mtree->keys = DEFAULT_KEYS;
+ mtree->dironly = 0;
+ mtree->indent = 0;
+ archive_string_init(&mtree->ebuf);
+ archive_string_init(&mtree->buf);
+ a->format_data = mtree;
+ a->format_destroy = archive_write_mtree_destroy;
+
+ a->pad_uncompressed = 0;
+ a->format_name = "mtree";
+ a->format_options = archive_write_mtree_options;
+ a->format_write_header = archive_write_mtree_header;
+ a->format_finish = archive_write_mtree_finish;
+ a->format_write_data = archive_write_mtree_data;
+ a->format_finish_entry = archive_write_mtree_finish_entry;
+ a->archive.archive_format = ARCHIVE_FORMAT_MTREE;
+ a->archive.archive_format_name = "mtree";
+
+ return (ARCHIVE_OK);
+}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c b/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
index 3e294cdf0a8..00c3f3f08cc 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_pax.c,v 1.47 2008/05/26 17:00:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_pax.c 201162 2009-12-29 05:47:46Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -111,6 +111,7 @@ archive_write_set_format_pax(struct archive *_a)
a->format_data = pax;
a->pad_uncompressed = 1;
+ a->format_name = "pax";
a->format_write_header = archive_write_pax_header;
a->format_write_data = archive_write_pax_data;
a->format_finish = archive_write_pax_finish;
@@ -203,6 +204,16 @@ utf8_encode(const wchar_t *wval)
utf8len = 0;
for (wp = wval; *wp != L'\0'; ) {
wc = *wp++;
+
+ if (wc >= 0xd800 && wc <= 0xdbff
+ && *wp >= 0xdc00 && *wp <= 0xdfff) {
+ /* This is a surrogate pair. Combine into a
+ * full Unicode value before encoding into
+ * UTF-8. */
+ wc = (wc - 0xd800) << 10; /* High 10 bits */
+ wc += (*wp++ - 0xdc00); /* Low 10 bits */
+ wc += 0x10000; /* Skip BMP */
+ }
if (wc <= 0x7f)
utf8len++;
else if (wc <= 0x7ff)
@@ -226,6 +237,12 @@ utf8_encode(const wchar_t *wval)
for (wp = wval, p = utf8_value; *wp != L'\0'; ) {
wc = *wp++;
+ if (wc >= 0xd800 && wc <= 0xdbff
+ && *wp >= 0xdc00 && *wp <= 0xdfff) {
+ /* Combine surrogate pair. */
+ wc = (wc - 0xd800) << 10;
+ wc += *wp++ - 0xdc00 + 0x10000;
+ }
if (wc <= 0x7f) {
*p++ = (char)wc;
} else if (wc <= 0x7ff) {
@@ -290,7 +307,7 @@ add_pax_attr(struct archive_string *as, const char *key, const char *value)
* PAX attributes have the following layout:
* <len> <space> <key> <=> <value> <nl>
*/
- len = 1 + strlen(key) + 1 + strlen(value) + 1;
+ len = 1 + (int)strlen(key) + 1 + (int)strlen(value) + 1;
/*
* The <len> field includes the length of the <len> field, so
@@ -345,7 +362,7 @@ archive_write_pax_header_xattrs(struct pax *pax, struct archive_entry *entry)
url_encoded_name = url_encode(name);
if (url_encoded_name != NULL) {
/* Convert narrow-character to wide-character. */
- int wcs_length = strlen(url_encoded_name);
+ size_t wcs_length = strlen(url_encoded_name);
wcs_name = (wchar_t *)malloc((wcs_length + 1) * sizeof(wchar_t));
if (wcs_name == NULL)
__archive_errx(1, "No memory for xattr conversion");
@@ -435,8 +452,14 @@ archive_write_pax_header(struct archive_write *a,
free(t);
}
break;
+ case AE_IFSOCK:
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "tar format cannot archive socket");
+ return (ARCHIVE_WARN);
default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive this (type=0%lo)",
(unsigned long)archive_entry_filetype(entry_original));
return (ARCHIVE_WARN);
@@ -456,7 +479,7 @@ archive_write_pax_header(struct archive_write *a,
path = archive_entry_pathname(entry_main);
path_w = archive_entry_pathname_w(entry_main);
if (path != NULL && path_w == NULL) {
- archive_set_error(&a->archive, EILSEQ,
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Can't translate pathname '%s' to UTF-8", path);
ret = ARCHIVE_WARN;
hdrcharset = "BINARY";
@@ -464,7 +487,7 @@ archive_write_pax_header(struct archive_write *a,
uname = archive_entry_uname(entry_main);
uname_w = archive_entry_uname_w(entry_main);
if (uname != NULL && uname_w == NULL) {
- archive_set_error(&a->archive, EILSEQ,
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Can't translate uname '%s' to UTF-8", uname);
ret = ARCHIVE_WARN;
hdrcharset = "BINARY";
@@ -472,7 +495,7 @@ archive_write_pax_header(struct archive_write *a,
gname = archive_entry_gname(entry_main);
gname_w = archive_entry_gname_w(entry_main);
if (gname != NULL && gname_w == NULL) {
- archive_set_error(&a->archive, EILSEQ,
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Can't translate gname '%s' to UTF-8", gname);
ret = ARCHIVE_WARN;
hdrcharset = "BINARY";
@@ -486,7 +509,7 @@ archive_write_pax_header(struct archive_write *a,
linkpath_w = archive_entry_symlink_w(entry_main);
}
if (linkpath != NULL && linkpath_w == NULL) {
- archive_set_error(&a->archive, EILSEQ,
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Can't translate linkpath '%s' to UTF-8", linkpath);
ret = ARCHIVE_WARN;
hdrcharset = "BINARY";
@@ -602,7 +625,7 @@ archive_write_pax_header(struct archive_write *a,
}
/* If numeric GID is too large, add 'gid' to pax extended attrs. */
- if (archive_entry_gid(entry_main) >= (1 << 18)) {
+ if ((unsigned int)archive_entry_gid(entry_main) >= (1 << 18)) {
add_pax_attr_int(&(pax->pax_header), "gid",
archive_entry_gid(entry_main));
need_extension = 1;
@@ -627,7 +650,7 @@ archive_write_pax_header(struct archive_write *a,
}
/* If numeric UID is too large, add 'uid' to pax extended attrs. */
- if (archive_entry_uid(entry_main) >= (1 << 18)) {
+ if ((unsigned int)archive_entry_uid(entry_main) >= (1 << 18)) {
add_pax_attr_int(&(pax->pax_header), "uid",
archive_entry_uid(entry_main));
need_extension = 1;
@@ -762,6 +785,15 @@ archive_write_pax_header(struct archive_write *a,
archive_entry_atime(entry_main),
archive_entry_atime_nsec(entry_main));
+ /* Store birth/creationtime only if it's earlier than mtime */
+ if (archive_entry_birthtime_is_set(entry_main) &&
+ archive_entry_birthtime(entry_main)
+ < archive_entry_mtime(entry_main))
+ add_pax_attr_time(&(pax->pax_header),
+ "LIBARCHIVE.creationtime",
+ archive_entry_birthtime(entry_main),
+ archive_entry_birthtime_nsec(entry_main));
+
/* I use a star-compatible file flag attribute. */
p = archive_entry_fflags_text(entry_main);
if (p != NULL && *p != '\0')
@@ -787,7 +819,7 @@ archive_write_pax_header(struct archive_write *a,
add_pax_attr_int(&(pax->pax_header), "SCHILY.dev",
archive_entry_dev(entry_main));
add_pax_attr_int(&(pax->pax_header), "SCHILY.ino",
- archive_entry_ino(entry_main));
+ archive_entry_ino64(entry_main));
add_pax_attr_int(&(pax->pax_header), "SCHILY.nlink",
archive_entry_nlink(entry_main));
@@ -855,7 +887,6 @@ archive_write_pax_header(struct archive_write *a,
uid_t uid;
gid_t gid;
mode_t mode;
- long ns;
pax_attr_entry = archive_entry_new();
p = archive_entry_pathname(entry_main);
@@ -865,12 +896,12 @@ archive_write_pax_header(struct archive_write *a,
archive_strlen(&(pax->pax_header)));
/* Copy uid/gid (but clip to ustar limits). */
uid = archive_entry_uid(entry_main);
- if (uid >= 1 << 18)
- uid = (1 << 18) - 1;
+ if ((unsigned int)uid >= 1 << 18)
+ uid = (uid_t)(1 << 18) - 1;
archive_entry_set_uid(pax_attr_entry, uid);
gid = archive_entry_gid(entry_main);
- if (gid >= 1 << 18)
- gid = (1 << 18) - 1;
+ if ((unsigned int)gid >= 1 << 18)
+ gid = (gid_t)(1 << 18) - 1;
archive_entry_set_gid(pax_attr_entry, gid);
/* Copy mode over (but not setuid/setgid bits) */
mode = archive_entry_mode(entry_main);
@@ -893,17 +924,12 @@ archive_write_pax_header(struct archive_write *a,
/* Copy mtime, but clip to ustar limits. */
s = archive_entry_mtime(entry_main);
- ns = archive_entry_mtime_nsec(entry_main);
- if (s < 0) { s = 0; ns = 0; }
- if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; }
- archive_entry_set_mtime(pax_attr_entry, s, ns);
-
- /* Ditto for atime. */
- s = archive_entry_atime(entry_main);
- ns = archive_entry_atime_nsec(entry_main);
- if (s < 0) { s = 0; ns = 0; }
- if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; }
- archive_entry_set_atime(pax_attr_entry, s, ns);
+ if (s < 0) { s = 0; }
+ if (s >= 0x7fffffff) { s = 0x7fffffff; }
+ archive_entry_set_mtime(pax_attr_entry, s, 0);
+
+ /* Standard ustar doesn't support atime. */
+ archive_entry_set_atime(pax_attr_entry, 0, 0);
/* Standard ustar doesn't support ctime. */
archive_entry_set_ctime(pax_attr_entry, 0, 0);
@@ -917,7 +943,8 @@ archive_write_pax_header(struct archive_write *a,
if (r != 0) {
const char *msg = "archive_write_pax_header: "
"'x' header failed?! This can't happen.\n";
- write(2, msg, strlen(msg));
+ size_t u = write(2, msg, strlen(msg));
+ (void)u; /* UNUSED */
exit(1);
}
r = (a->compressor.write)(a, paxbuff, 512);
@@ -998,7 +1025,7 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
char *p;
int need_slash = 0; /* Was there a trailing slash? */
size_t suffix_length = 99;
- int insert_length;
+ size_t insert_length;
/* Length of additional dir element to be added. */
if (insert == NULL)
@@ -1092,7 +1119,7 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
p += filename_end - filename;
if (need_slash)
*p++ = '/';
- *p++ = '\0';
+ *p = '\0';
return (dest);
}
@@ -1183,13 +1210,11 @@ build_pax_attribute_name(char *dest, const char *src)
static int
archive_write_pax_finish(struct archive_write *a)
{
- struct pax *pax;
int r;
if (a->compressor.write == NULL)
return (ARCHIVE_OK);
- pax = (struct pax *)a->format_data;
r = write_nulls(a, 512 * 2);
return (r);
}
@@ -1200,6 +1225,9 @@ archive_write_pax_destroy(struct archive_write *a)
struct pax *pax;
pax = (struct pax *)a->format_data;
+ if (pax == NULL)
+ return (ARCHIVE_OK);
+
archive_string_free(&pax->pax_header);
free(pax);
a->format_data = NULL;
@@ -1221,7 +1249,8 @@ archive_write_pax_finish_entry(struct archive_write *a)
static int
write_nulls(struct archive_write *a, size_t padding)
{
- int ret, to_write;
+ int ret;
+ size_t to_write;
while (padding > 0) {
to_write = padding < a->null_length ? padding : a->null_length;
@@ -1352,6 +1381,6 @@ base64_encode(const char *s, size_t len)
break;
}
/* Add trailing NUL character so output is a valid C string. */
- *d++ = '\0';
+ *d = '\0';
return (out);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_shar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_shar.c
index b5d16e09d13..62a875b98d3 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_shar.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_shar.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2008 Joerg Sonnenberger
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,12 +25,11 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_shar.c,v 1.19 2008/03/15 11:04:45 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_shar.c 189438 2009-03-06 05:58:56Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -49,13 +49,14 @@ struct shar {
struct archive_entry *entry;
int has_data;
char *last_dir;
- char outbuff[1024];
- size_t outbytes;
+
+ /* Line buffer for uuencoded dump format */
+ char outbuff[45];
size_t outpos;
- int uuavail;
- char uubuffer[3];
+
int wrote_header;
struct archive_string work;
+ struct archive_string quoted_name;
};
static int archive_write_shar_finish(struct archive_write *);
@@ -67,23 +68,33 @@ static ssize_t archive_write_shar_data_sed(struct archive_write *,
static ssize_t archive_write_shar_data_uuencode(struct archive_write *,
const void * buff, size_t);
static int archive_write_shar_finish_entry(struct archive_write *);
-static int shar_printf(struct archive_write *, const char *fmt, ...);
-static void uuencode_group(struct shar *);
-static int
-shar_printf(struct archive_write *a, const char *fmt, ...)
+/*
+ * Copy the given string to the buffer, quoting all shell meta characters
+ * found.
+ */
+static void
+shar_quote(struct archive_string *buf, const char *str, int in_shell)
{
- struct shar *shar;
- va_list ap;
- int ret;
-
- shar = (struct shar *)a->format_data;
- va_start(ap, fmt);
- archive_string_empty(&(shar->work));
- archive_string_vsprintf(&(shar->work), fmt, ap);
- ret = ((a->compressor.write)(a, shar->work.s, strlen(shar->work.s)));
- va_end(ap);
- return (ret);
+ static const char meta[] = "\n \t'`\";&<>()|*?{}[]\\$!#^~";
+ size_t len;
+
+ while (*str != '\0') {
+ if ((len = strcspn(str, meta)) != 0) {
+ archive_strncat(buf, str, len);
+ str += len;
+ } else if (*str == '\n') {
+ if (in_shell)
+ archive_strcat(buf, "\"\n\"");
+ else
+ archive_strcat(buf, "\\n");
+ ++str;
+ } else {
+ archive_strappend_char(buf, '\\');
+ archive_strappend_char(buf, *str);
+ ++str;
+ }
+ }
}
/*
@@ -105,9 +116,12 @@ archive_write_set_format_shar(struct archive *_a)
return (ARCHIVE_FATAL);
}
memset(shar, 0, sizeof(*shar));
+ archive_string_init(&shar->work);
+ archive_string_init(&shar->quoted_name);
a->format_data = shar;
a->pad_uncompressed = 0;
+ a->format_name = "shar";
a->format_write_header = archive_write_shar_header;
a->format_finish = archive_write_shar_finish;
a->format_destroy = archive_write_shar_destroy;
@@ -146,16 +160,11 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
const char *name;
char *p, *pp;
struct shar *shar;
- int ret;
shar = (struct shar *)a->format_data;
if (!shar->wrote_header) {
- ret = shar_printf(a, "#!/bin/sh\n");
- if (ret != ARCHIVE_OK)
- return (ret);
- ret = shar_printf(a, "# This is a shell archive\n");
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_strcat(&shar->work, "#!/bin/sh\n");
+ archive_strcat(&shar->work, "# This is a shell archive\n");
shar->wrote_header = 1;
}
@@ -192,10 +201,11 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
}
}
+ archive_string_empty(&shar->quoted_name);
+ shar_quote(&shar->quoted_name, name, 1);
+
/* Stock preparation for all file types. */
- ret = shar_printf(a, "echo x %s\n", name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work, "echo x %s\n", shar->quoted_name.s);
if (archive_entry_filetype(entry) != AE_IFDIR) {
/* Try to create the dir. */
@@ -210,12 +220,10 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
/* Don't try to "mkdir ." */
free(p);
} else if (shar->last_dir == NULL) {
- ret = shar_printf(a,
- "mkdir -p %s > /dev/null 2>&1\n", p);
- if (ret != ARCHIVE_OK) {
- free(p);
- return (ret);
- }
+ archive_strcat(&shar->work, "mkdir -p ");
+ shar_quote(&shar->work, p, 1);
+ archive_strcat(&shar->work,
+ " > /dev/null 2>&1\n");
shar->last_dir = p;
} else if (strcmp(p, shar->last_dir) == 0) {
/* We've already created this exact dir. */
@@ -225,13 +233,10 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
/* We've already created a subdir. */
free(p);
} else {
- ret = shar_printf(a,
- "mkdir -p %s > /dev/null 2>&1\n", p);
- if (ret != ARCHIVE_OK) {
- free(p);
- return (ret);
- }
- free(shar->last_dir);
+ archive_strcat(&shar->work, "mkdir -p ");
+ shar_quote(&shar->work, p, 1);
+ archive_strcat(&shar->work,
+ " > /dev/null 2>&1\n");
shar->last_dir = p;
}
} else {
@@ -242,51 +247,47 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
/* Handle file-type specific issues. */
shar->has_data = 0;
if ((linkname = archive_entry_hardlink(entry)) != NULL) {
- ret = shar_printf(a, "ln -f %s %s\n", linkname, name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_strcat(&shar->work, "ln -f ");
+ shar_quote(&shar->work, linkname, 1);
+ archive_string_sprintf(&shar->work, " %s\n",
+ shar->quoted_name.s);
} else if ((linkname = archive_entry_symlink(entry)) != NULL) {
- ret = shar_printf(a, "ln -fs %s %s\n", linkname, name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_strcat(&shar->work, "ln -fs ");
+ shar_quote(&shar->work, linkname, 1);
+ archive_string_sprintf(&shar->work, " %s\n",
+ shar->quoted_name.s);
} else {
switch(archive_entry_filetype(entry)) {
case AE_IFREG:
if (archive_entry_size(entry) == 0) {
/* More portable than "touch." */
- ret = shar_printf(a, "test -e \"%s\" || :> \"%s\"\n", name, name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work,
+ "test -e \"%s\" || :> \"%s\"\n",
+ shar->quoted_name.s, shar->quoted_name.s);
} else {
if (shar->dump) {
- ret = shar_printf(a,
- "uudecode -o %s << 'SHAR_END'\n",
- name);
- if (ret != ARCHIVE_OK)
- return (ret);
- ret = shar_printf(a, "begin %o %s\n",
- archive_entry_mode(entry) & 0777,
- name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work,
+ "uudecode -p > %s << 'SHAR_END'\n",
+ shar->quoted_name.s);
+ archive_string_sprintf(&shar->work,
+ "begin %o ",
+ archive_entry_mode(entry) & 0777);
+ shar_quote(&shar->work, name, 0);
+ archive_strcat(&shar->work, "\n");
} else {
- ret = shar_printf(a,
+ archive_string_sprintf(&shar->work,
"sed 's/^X//' > %s << 'SHAR_END'\n",
- name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ shar->quoted_name.s);
}
shar->has_data = 1;
shar->end_of_line = 1;
shar->outpos = 0;
- shar->outbytes = 0;
}
break;
case AE_IFDIR:
- ret = shar_printf(a, "mkdir -p %s > /dev/null 2>&1\n",
- name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work,
+ "mkdir -p %s > /dev/null 2>&1\n",
+ shar->quoted_name.s);
/* Record that we just created this directory. */
if (shar->last_dir != NULL)
free(shar->last_dir);
@@ -302,23 +303,20 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
*/
break;
case AE_IFIFO:
- ret = shar_printf(a, "mkfifo %s\n", name);
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work,
+ "mkfifo %s\n", shar->quoted_name.s);
break;
case AE_IFCHR:
- ret = shar_printf(a, "mknod %s c %d %d\n", name,
+ archive_string_sprintf(&shar->work,
+ "mknod %s c %d %d\n", shar->quoted_name.s,
archive_entry_rdevmajor(entry),
archive_entry_rdevminor(entry));
- if (ret != ARCHIVE_OK)
- return (ret);
break;
case AE_IFBLK:
- ret = shar_printf(a, "mknod %s b %d %d\n", name,
+ archive_string_sprintf(&shar->work,
+ "mknod %s b %d %d\n", shar->quoted_name.s,
archive_entry_rdevmajor(entry),
archive_entry_rdevminor(entry));
- if (ret != ARCHIVE_OK)
- return (ret);
break;
default:
return (ARCHIVE_WARN);
@@ -328,69 +326,119 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
return (ARCHIVE_OK);
}
-/* XXX TODO: This could be more efficient XXX */
static ssize_t
archive_write_shar_data_sed(struct archive_write *a, const void *buff, size_t n)
{
+ static const size_t ensured = 65533;
struct shar *shar;
const char *src;
+ char *buf, *buf_end;
int ret;
size_t written = n;
shar = (struct shar *)a->format_data;
- if (!shar->has_data)
+ if (!shar->has_data || n == 0)
return (0);
src = (const char *)buff;
- ret = ARCHIVE_OK;
- shar->outpos = 0;
- while (n-- > 0) {
- if (shar->end_of_line) {
- shar->outbuff[shar->outpos++] = 'X';
- shar->end_of_line = 0;
+
+ /*
+ * ensure is the number of bytes in buffer before expanding the
+ * current character. Each operation writes the current character
+ * and optionally the start-of-new-line marker. This can happen
+ * twice before entering the loop, so make sure three additional
+ * bytes can be written.
+ */
+ if (archive_string_ensure(&shar->work, ensured + 3) == NULL)
+ __archive_errx(1, "Out of memory");
+
+ if (shar->work.length > ensured) {
+ ret = (*a->compressor.write)(a, shar->work.s,
+ shar->work.length);
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ archive_string_empty(&shar->work);
+ }
+ buf = shar->work.s + shar->work.length;
+ buf_end = shar->work.s + ensured;
+
+ if (shar->end_of_line) {
+ *buf++ = 'X';
+ shar->end_of_line = 0;
+ }
+
+ while (n-- != 0) {
+ if ((*buf++ = *src++) == '\n') {
+ if (n == 0)
+ shar->end_of_line = 1;
+ else
+ *buf++ = 'X';
}
- if (*src == '\n')
- shar->end_of_line = 1;
- shar->outbuff[shar->outpos++] = *src++;
- if (shar->outpos > sizeof(shar->outbuff) - 2) {
- ret = (a->compressor.write)(a, shar->outbuff,
- shar->outpos);
+ if (buf >= buf_end) {
+ shar->work.length = buf - shar->work.s;
+ ret = (*a->compressor.write)(a, shar->work.s,
+ shar->work.length);
if (ret != ARCHIVE_OK)
- return (ret);
- shar->outpos = 0;
+ return (ARCHIVE_FATAL);
+ archive_string_empty(&shar->work);
+ buf = shar->work.s;
}
}
- if (shar->outpos > 0)
- ret = (a->compressor.write)(a, shar->outbuff, shar->outpos);
- if (ret != ARCHIVE_OK)
- return (ret);
+ shar->work.length = buf - shar->work.s;
+
return (written);
}
#define UUENC(c) (((c)!=0) ? ((c) & 077) + ' ': '`')
-/* XXX This could be a lot more efficient. XXX */
static void
-uuencode_group(struct shar *shar)
+uuencode_group(const char _in[3], char out[4])
+{
+ const unsigned char *in = (const unsigned char *)_in;
+ int t;
+
+ t = (in[0] << 16) | (in[1] << 8) | in[2];
+ out[0] = UUENC( 0x3f & (t >> 18) );
+ out[1] = UUENC( 0x3f & (t >> 12) );
+ out[2] = UUENC( 0x3f & (t >> 6) );
+ out[3] = UUENC( 0x3f & t );
+}
+
+static void
+uuencode_line(struct shar *shar, const char *inbuf, size_t len)
{
- int t;
-
- t = 0;
- if (shar->uuavail > 0)
- t = 0xff0000 & (shar->uubuffer[0] << 16);
- if (shar->uuavail > 1)
- t |= 0x00ff00 & (shar->uubuffer[1] << 8);
- if (shar->uuavail > 2)
- t |= 0x0000ff & (shar->uubuffer[2]);
- shar->outbuff[shar->outpos++] = UUENC( 0x3f & (t>>18) );
- shar->outbuff[shar->outpos++] = UUENC( 0x3f & (t>>12) );
- shar->outbuff[shar->outpos++] = UUENC( 0x3f & (t>>6) );
- shar->outbuff[shar->outpos++] = UUENC( 0x3f & (t) );
- shar->uuavail = 0;
- shar->outbytes += shar->uuavail;
- shar->outbuff[shar->outpos] = 0;
+ char tmp_buf[3], *buf;
+ size_t alloc_len;
+
+ /* len <= 45 -> expanded to 60 + len byte + new line */
+ alloc_len = shar->work.length + 62;
+ if (archive_string_ensure(&shar->work, alloc_len) == NULL)
+ __archive_errx(1, "Out of memory");
+
+ buf = shar->work.s + shar->work.length;
+ *buf++ = UUENC(len);
+ while (len >= 3) {
+ uuencode_group(inbuf, buf);
+ len -= 3;
+ inbuf += 3;
+ buf += 4;
+ }
+ if (len != 0) {
+ tmp_buf[0] = inbuf[0];
+ if (len == 1)
+ tmp_buf[1] = '\0';
+ else
+ tmp_buf[1] = inbuf[1];
+ tmp_buf[2] = '\0';
+ uuencode_group(inbuf, buf);
+ buf += 4;
+ }
+ *buf++ = '\n';
+ if ((buf - shar->work.s) > (ptrdiff_t)(shar->work.length + 62))
+ __archive_errx(1, "Buffer overflow");
+ shar->work.length = buf - shar->work.s;
}
static ssize_t
@@ -406,21 +454,39 @@ archive_write_shar_data_uuencode(struct archive_write *a, const void *buff,
if (!shar->has_data)
return (ARCHIVE_OK);
src = (const char *)buff;
- n = length;
- while (n-- > 0) {
- if (shar->uuavail == 3)
- uuencode_group(shar);
- if (shar->outpos >= 60) {
- ret = shar_printf(a, "%c%s\n", UUENC(shar->outbytes),
- shar->outbuff);
- if (ret != ARCHIVE_OK)
- return (ret);
- shar->outpos = 0;
- shar->outbytes = 0;
+
+ if (shar->outpos != 0) {
+ n = 45 - shar->outpos;
+ if (n > length)
+ n = length;
+ memcpy(shar->outbuff + shar->outpos, src, n);
+ if (shar->outpos + n < 45) {
+ shar->outpos += n;
+ return length;
}
+ uuencode_line(shar, shar->outbuff, 45);
+ src += n;
+ n = length - n;
+ } else {
+ n = length;
+ }
- shar->uubuffer[shar->uuavail++] = *src++;
- shar->outbytes++;
+ while (n >= 45) {
+ uuencode_line(shar, src, 45);
+ src += 45;
+ n -= 45;
+
+ if (shar->work.length < 65536)
+ continue;
+ ret = (*a->compressor.write)(a, shar->work.s,
+ shar->work.length);
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ archive_string_empty(&shar->work);
+ }
+ if (n != 0) {
+ memcpy(shar->outbuff, src, n);
+ shar->outpos = n;
}
return (length);
}
@@ -439,54 +505,43 @@ archive_write_shar_finish_entry(struct archive_write *a)
if (shar->dump) {
/* Finish uuencoded data. */
if (shar->has_data) {
- if (shar->uuavail > 0)
- uuencode_group(shar);
- if (shar->outpos > 0) {
- ret = shar_printf(a, "%c%s\n",
- UUENC(shar->outbytes), shar->outbuff);
- if (ret != ARCHIVE_OK)
- return (ret);
- shar->outpos = 0;
- shar->uuavail = 0;
- shar->outbytes = 0;
- }
- ret = shar_printf(a, "%c\n", UUENC(0));
- if (ret != ARCHIVE_OK)
- return (ret);
- ret = shar_printf(a, "end\n", UUENC(0));
- if (ret != ARCHIVE_OK)
- return (ret);
- ret = shar_printf(a, "SHAR_END\n");
- if (ret != ARCHIVE_OK)
- return (ret);
+ if (shar->outpos > 0)
+ uuencode_line(shar, shar->outbuff,
+ shar->outpos);
+ archive_strcat(&shar->work, "`\nend\n");
+ archive_strcat(&shar->work, "SHAR_END\n");
}
/* Restore file mode, owner, flags. */
/*
* TODO: Don't immediately restore mode for
* directories; defer that to end of script.
*/
- ret = shar_printf(a, "chmod %o %s\n",
- archive_entry_mode(shar->entry) & 07777,
- archive_entry_pathname(shar->entry));
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work, "chmod %o ",
+ archive_entry_mode(shar->entry) & 07777);
+ shar_quote(&shar->work, archive_entry_pathname(shar->entry), 1);
+ archive_strcat(&shar->work, "\n");
u = archive_entry_uname(shar->entry);
g = archive_entry_gname(shar->entry);
if (u != NULL || g != NULL) {
- ret = shar_printf(a, "chown %s%s%s %s\n",
- (u != NULL) ? u : "",
- (g != NULL) ? ":" : "", (g != NULL) ? g : "",
- archive_entry_pathname(shar->entry));
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_strcat(&shar->work, "chown ");
+ if (u != NULL)
+ shar_quote(&shar->work, u, 1);
+ if (g != NULL) {
+ archive_strcat(&shar->work, ":");
+ shar_quote(&shar->work, g, 1);
+ }
+ shar_quote(&shar->work,
+ archive_entry_pathname(shar->entry), 1);
+ archive_strcat(&shar->work, "\n");
}
if ((p = archive_entry_fflags_text(shar->entry)) != NULL) {
- ret = shar_printf(a, "chflags %s %s\n", p,
- archive_entry_pathname(shar->entry));
- if (ret != ARCHIVE_OK)
- return (ret);
+ archive_string_sprintf(&shar->work, "chflags %s ",
+ p, archive_entry_pathname(shar->entry));
+ shar_quote(&shar->work,
+ archive_entry_pathname(shar->entry), 1);
+ archive_strcat(&shar->work, "\n");
}
/* TODO: restore ACLs */
@@ -494,20 +549,24 @@ archive_write_shar_finish_entry(struct archive_write *a)
} else {
if (shar->has_data) {
/* Finish sed-encoded data: ensure last line ends. */
- if (!shar->end_of_line) {
- ret = shar_printf(a, "\n");
- if (ret != ARCHIVE_OK)
- return (ret);
- }
- ret = shar_printf(a, "SHAR_END\n");
- if (ret != ARCHIVE_OK)
- return (ret);
+ if (!shar->end_of_line)
+ archive_strappend_char(&shar->work, '\n');
+ archive_strcat(&shar->work, "SHAR_END\n");
}
}
archive_entry_free(shar->entry);
shar->entry = NULL;
- return (0);
+
+ if (shar->work.length < 65536)
+ return (ARCHIVE_OK);
+
+ ret = (*a->compressor.write)(a, shar->work.s, shar->work.length);
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ archive_string_empty(&shar->work);
+
+ return (ARCHIVE_OK);
}
static int
@@ -529,17 +588,22 @@ archive_write_shar_finish(struct archive_write *a)
* shar format, then sets another format (which would invoke
* shar_finish to free the format-specific data).
*/
- if (shar->wrote_header) {
- ret = shar_printf(a, "exit\n");
- if (ret != ARCHIVE_OK)
- return (ret);
- /* Shar output is never padded. */
- archive_write_set_bytes_in_last_block(&a->archive, 1);
- /*
- * TODO: shar should also suppress padding of
- * uncompressed data within gzip/bzip2 streams.
- */
- }
+ if (shar->wrote_header == 0)
+ return (ARCHIVE_OK);
+
+ archive_strcat(&shar->work, "exit\n");
+
+ ret = (*a->compressor.write)(a, shar->work.s, shar->work.length);
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+
+ /* Shar output is never padded. */
+ archive_write_set_bytes_in_last_block(&a->archive, 1);
+ /*
+ * TODO: shar should also suppress padding of
+ * uncompressed data within gzip/bzip2 streams.
+ */
+
return (ARCHIVE_OK);
}
@@ -549,11 +613,13 @@ archive_write_shar_destroy(struct archive_write *a)
struct shar *shar;
shar = (struct shar *)a->format_data;
- if (shar->entry != NULL)
- archive_entry_free(shar->entry);
- if (shar->last_dir != NULL)
- free(shar->last_dir);
+ if (shar == NULL)
+ return (ARCHIVE_OK);
+
+ archive_entry_free(shar->entry);
+ free(shar->last_dir);
archive_string_free(&(shar->work));
+ archive_string_free(&(shar->quoted_name));
free(shar);
a->format_data = NULL;
return (ARCHIVE_OK);
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
index 8aed25d1f99..1de273fc2df 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ustar.c,v 1.27 2008/05/26 17:00:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_ustar.c 191579 2009-04-27 18:35:03Z kientzle $");
#ifdef HAVE_ERRNO_H
@@ -181,6 +181,7 @@ archive_write_set_format_ustar(struct archive *_a)
a->format_data = ustar;
a->pad_uncompressed = 1; /* Mimic gtar in this respect. */
+ a->format_name = "ustar";
a->format_write_header = archive_write_ustar_header;
a->format_write_data = archive_write_ustar_data;
a->format_finish = archive_write_ustar_finish;
@@ -413,8 +414,14 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
case AE_IFBLK: h[USTAR_typeflag_offset] = '4' ; break;
case AE_IFDIR: h[USTAR_typeflag_offset] = '5' ; break;
case AE_IFIFO: h[USTAR_typeflag_offset] = '6' ; break;
+ case AE_IFSOCK:
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "tar format cannot archive socket");
+ return (ARCHIVE_FAILED);
default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive this (mode=0%lo)",
(unsigned long)archive_entry_mode(entry));
ret = ARCHIVE_FAILED;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_zip.c b/archivers/libarchive/files/libarchive/archive_write_set_format_zip.c
new file mode 100644
index 00000000000..14cc6697df0
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_zip.c
@@ -0,0 +1,667 @@
+/*-
+ * Copyright (c) 2008 Anselm Strauss
+ * Copyright (c) 2009 Joerg Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Development supported by Google Summer of Code 2008.
+ */
+
+/*
+ * The current implementation is very limited:
+ *
+ * - No encryption support.
+ * - No ZIP64 support.
+ * - No support for splitting and spanning.
+ * - Only supports regular file and folder entries.
+ *
+ * Note that generally data in ZIP files is little-endian encoded,
+ * with some exceptions.
+ *
+ * TODO: Since Libarchive is generally 64bit oriented, but this implementation
+ * does not yet support sizes exceeding 32bit, it is highly fragile for
+ * big archives. This should change when ZIP64 is finally implemented, otherwise
+ * some serious checking has to be done.
+ *
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_zip.c 201168 2009-12-29 06:15:32Z kientzle $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#include "archive.h"
+#include "archive_endian.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_write_private.h"
+
+#ifndef HAVE_ZLIB_H
+#include "archive_crc32.h"
+#endif
+
+#define ZIP_SIGNATURE_LOCAL_FILE_HEADER 0x04034b50
+#define ZIP_SIGNATURE_DATA_DESCRIPTOR 0x08074b50
+#define ZIP_SIGNATURE_FILE_HEADER 0x02014b50
+#define ZIP_SIGNATURE_CENTRAL_DIRECTORY_END 0x06054b50
+#define ZIP_SIGNATURE_EXTRA_TIMESTAMP 0x5455
+#define ZIP_SIGNATURE_EXTRA_UNIX 0x7855
+#define ZIP_VERSION_EXTRACT 0x0014 /* ZIP version 2.0 is needed. */
+#define ZIP_VERSION_BY 0x0314 /* Made by UNIX, using ZIP version 2.0. */
+#define ZIP_FLAGS 0x08 /* Flagging bit 3 (count from 0) for using data descriptor. */
+
+enum compression {
+ COMPRESSION_STORE = 0
+#ifdef HAVE_ZLIB_H
+ ,
+ COMPRESSION_DEFLATE = 8
+#endif
+};
+
+static ssize_t archive_write_zip_data(struct archive_write *, const void *buff, size_t s);
+static int archive_write_zip_finish(struct archive_write *);
+static int archive_write_zip_destroy(struct archive_write *);
+static int archive_write_zip_finish_entry(struct archive_write *);
+static int archive_write_zip_header(struct archive_write *, struct archive_entry *);
+static unsigned int dos_time(const time_t);
+static size_t path_length(struct archive_entry *);
+static int write_path(struct archive_entry *, struct archive_write *);
+
+struct zip_local_file_header {
+ char signature[4];
+ char version[2];
+ char flags[2];
+ char compression[2];
+ char timedate[4];
+ char crc32[4];
+ char compressed_size[4];
+ char uncompressed_size[4];
+ char filename_length[2];
+ char extra_length[2];
+};
+
+struct zip_file_header {
+ char signature[4];
+ char version_by[2];
+ char version_extract[2];
+ char flags[2];
+ char compression[2];
+ char timedate[4];
+ char crc32[4];
+ char compressed_size[4];
+ char uncompressed_size[4];
+ char filename_length[2];
+ char extra_length[2];
+ char comment_length[2];
+ char disk_number[2];
+ char attributes_internal[2];
+ char attributes_external[4];
+ char offset[4];
+};
+
+struct zip_data_descriptor {
+ char signature[4]; /* Not mandatory, but recommended by specification. */
+ char crc32[4];
+ char compressed_size[4];
+ char uncompressed_size[4];
+};
+
+struct zip_extra_data_local {
+ char time_id[2];
+ char time_size[2];
+ char time_flag[1];
+ char mtime[4];
+ char atime[4];
+ char ctime[4];
+ char unix_id[2];
+ char unix_size[2];
+ char unix_uid[2];
+ char unix_gid[2];
+};
+
+struct zip_extra_data_central {
+ char time_id[2];
+ char time_size[2];
+ char time_flag[1];
+ char mtime[4];
+ char unix_id[2];
+ char unix_size[2];
+};
+
+struct zip_file_header_link {
+ struct zip_file_header_link *next;
+ struct archive_entry *entry;
+ off_t offset;
+ unsigned long crc32;
+ off_t compressed_size;
+ enum compression compression;
+};
+
+struct zip {
+ struct zip_data_descriptor data_descriptor;
+ struct zip_file_header_link *central_directory;
+ struct zip_file_header_link *central_directory_end;
+ int64_t offset;
+ int64_t written_bytes;
+ int64_t remaining_data_bytes;
+ enum compression compression;
+
+#ifdef HAVE_ZLIB_H
+ z_stream stream;
+ size_t len_buf;
+ unsigned char *buf;
+#endif
+};
+
+struct zip_central_directory_end {
+ char signature[4];
+ char disk[2];
+ char start_disk[2];
+ char entries_disk[2];
+ char entries[2];
+ char size[4];
+ char offset[4];
+ char comment_length[2];
+};
+
+static int
+archive_write_zip_options(struct archive_write *a, const char *key,
+ const char *value)
+{
+ struct zip *zip = a->format_data;
+
+ if (strcmp(key, "compression") == 0) {
+ if (strcmp(value, "deflate") == 0) {
+#ifdef HAVE_ZLIB_H
+ zip->compression = COMPRESSION_DEFLATE;
+#else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "deflate compression not supported");
+ return ARCHIVE_WARN;
+#endif
+ } else if (strcmp(value, "store") == 0)
+ zip->compression = COMPRESSION_STORE;
+ else
+ return (ARCHIVE_WARN);
+ return (ARCHIVE_OK);
+ }
+ return (ARCHIVE_WARN);
+}
+
+int
+archive_write_set_format_zip(struct archive *_a)
+{
+ struct archive_write *a = (struct archive_write *)_a;
+ struct zip *zip;
+
+ /* If another format was already registered, unregister it. */
+ if (a->format_destroy != NULL)
+ (a->format_destroy)(a);
+
+ zip = (struct zip *) calloc(1, sizeof(*zip));
+ if (zip == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Can't allocate zip data");
+ return (ARCHIVE_FATAL);
+ }
+ zip->central_directory = NULL;
+ zip->central_directory_end = NULL;
+ zip->offset = 0;
+ zip->written_bytes = 0;
+ zip->remaining_data_bytes = 0;
+
+#ifdef HAVE_ZLIB_H
+ zip->compression = COMPRESSION_DEFLATE;
+ zip->len_buf = 65536;
+ zip->buf = malloc(zip->len_buf);
+ if (zip->buf == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Can't allocate compression buffer");
+ return (ARCHIVE_FATAL);
+ }
+#else
+ zip->compression = COMPRESSION_STORE;
+#endif
+
+ a->format_data = zip;
+
+ a->pad_uncompressed = 0; /* Actually not needed for now, since no compression support yet. */
+ a->format_name = "zip";
+ a->format_options = archive_write_zip_options;
+ a->format_write_header = archive_write_zip_header;
+ a->format_write_data = archive_write_zip_data;
+ a->format_finish_entry = archive_write_zip_finish_entry;
+ a->format_finish = archive_write_zip_finish;
+ a->format_destroy = archive_write_zip_destroy;
+ a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
+ a->archive.archive_format_name = "ZIP";
+
+ archive_le32enc(&zip->data_descriptor.signature,
+ ZIP_SIGNATURE_DATA_DESCRIPTOR);
+
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
+{
+ struct zip *zip;
+ struct zip_local_file_header h;
+ struct zip_extra_data_local e;
+ struct zip_data_descriptor *d;
+ struct zip_file_header_link *l;
+ int ret;
+ int64_t size;
+ mode_t type;
+
+ /* Entries other than a regular file or a folder are skipped. */
+ type = archive_entry_filetype(entry);
+ if ((type != AE_IFREG) & (type != AE_IFDIR)) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Filetype not supported");
+ return ARCHIVE_FAILED;
+ };
+
+ /* Directory entries should have a size of 0. */
+ if (type == AE_IFDIR)
+ archive_entry_set_size(entry, 0);
+
+ zip = a->format_data;
+ d = &zip->data_descriptor;
+ size = archive_entry_size(entry);
+ zip->remaining_data_bytes = size;
+
+ /* Append archive entry to the central directory data. */
+ l = (struct zip_file_header_link *) malloc(sizeof(*l));
+ if (l == NULL) {
+ archive_set_error(&a->archive, ENOMEM, "Can't allocate zip header data");
+ return (ARCHIVE_FATAL);
+ }
+ l->entry = archive_entry_clone(entry);
+ /* Initialize the CRC variable and potentially the local crc32(). */
+ l->crc32 = crc32(0, NULL, 0);
+ l->compression = zip->compression;
+ l->compressed_size = 0;
+ l->next = NULL;
+ if (zip->central_directory == NULL) {
+ zip->central_directory = l;
+ } else {
+ zip->central_directory_end->next = l;
+ }
+ zip->central_directory_end = l;
+
+ /* Store the offset of this header for later use in central directory. */
+ l->offset = zip->written_bytes;
+
+ memset(&h, 0, sizeof(h));
+ archive_le32enc(&h.signature, ZIP_SIGNATURE_LOCAL_FILE_HEADER);
+ archive_le16enc(&h.version, ZIP_VERSION_EXTRACT);
+ archive_le16enc(&h.flags, ZIP_FLAGS);
+ archive_le16enc(&h.compression, zip->compression);
+ archive_le32enc(&h.timedate, dos_time(archive_entry_mtime(entry)));
+ archive_le16enc(&h.filename_length, (uint16_t)path_length(entry));
+
+ switch (zip->compression) {
+ case COMPRESSION_STORE:
+ /* Setting compressed and uncompressed sizes even when specification says
+ * to set to zero when using data descriptors. Otherwise the end of the
+ * data for an entry is rather difficult to find. */
+ archive_le32enc(&h.compressed_size, size);
+ archive_le32enc(&h.uncompressed_size, size);
+ break;
+#ifdef HAVE_ZLIB_H
+ case COMPRESSION_DEFLATE:
+ archive_le32enc(&h.uncompressed_size, size);
+
+ zip->stream.zalloc = Z_NULL;
+ zip->stream.zfree = Z_NULL;
+ zip->stream.opaque = Z_NULL;
+ zip->stream.next_out = zip->buf;
+ zip->stream.avail_out = zip->len_buf;
+ if (deflateInit2(&zip->stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
+ -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) {
+ archive_set_error(&a->archive, ENOMEM, "Can't init deflate compressor");
+ return (ARCHIVE_FATAL);
+ }
+ break;
+#endif
+ }
+
+ /* Formatting extra data. */
+ archive_le16enc(&h.extra_length, sizeof(e));
+ archive_le16enc(&e.time_id, ZIP_SIGNATURE_EXTRA_TIMESTAMP);
+ archive_le16enc(&e.time_size, sizeof(e.time_flag) +
+ sizeof(e.mtime) + sizeof(e.atime) + sizeof(e.ctime));
+ e.time_flag[0] = 0x07;
+ archive_le32enc(&e.mtime, archive_entry_mtime(entry));
+ archive_le32enc(&e.atime, archive_entry_atime(entry));
+ archive_le32enc(&e.ctime, archive_entry_ctime(entry));
+
+ archive_le16enc(&e.unix_id, ZIP_SIGNATURE_EXTRA_UNIX);
+ archive_le16enc(&e.unix_size, sizeof(e.unix_uid) + sizeof(e.unix_gid));
+ archive_le16enc(&e.unix_uid, archive_entry_uid(entry));
+ archive_le16enc(&e.unix_gid, archive_entry_gid(entry));
+
+ archive_le32enc(&d->uncompressed_size, size);
+
+ ret = (a->compressor.write)(a, &h, sizeof(h));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(h);
+
+ ret = write_path(entry, a);
+ if (ret <= ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += ret;
+
+ ret = (a->compressor.write)(a, &e, sizeof(e));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(e);
+
+ return (ARCHIVE_OK);
+}
+
+static ssize_t
+archive_write_zip_data(struct archive_write *a, const void *buff, size_t s)
+{
+ int ret;
+ struct zip *zip = a->format_data;
+ struct zip_file_header_link *l = zip->central_directory_end;
+
+ if ((int64_t)s > zip->remaining_data_bytes)
+ s = (size_t)zip->remaining_data_bytes;
+
+ if (s == 0) return 0;
+
+ switch (zip->compression) {
+ case COMPRESSION_STORE:
+ ret = (a->compressor.write)(a, buff, s);
+ if (ret != ARCHIVE_OK) return (ret);
+ zip->written_bytes += s;
+ zip->remaining_data_bytes -= s;
+ l->compressed_size += s;
+ l->crc32 = crc32(l->crc32, buff, s);
+ return (s);
+#if HAVE_ZLIB_H
+ case COMPRESSION_DEFLATE:
+ zip->stream.next_in = (unsigned char*)(uintptr_t)buff;
+ zip->stream.avail_in = s;
+ do {
+ ret = deflate(&zip->stream, Z_NO_FLUSH);
+ if (ret == Z_STREAM_ERROR)
+ return (ARCHIVE_FATAL);
+ if (zip->stream.avail_out == 0) {
+ ret = (a->compressor.write)(a, zip->buf, zip->len_buf);
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ l->compressed_size += zip->len_buf;
+ zip->written_bytes += zip->len_buf;
+ zip->stream.next_out = zip->buf;
+ zip->stream.avail_out = zip->len_buf;
+ }
+ } while (zip->stream.avail_in != 0);
+ zip->remaining_data_bytes -= s;
+ /* If we have it, use zlib's fast crc32() */
+ l->crc32 = crc32(l->crc32, buff, s);
+ return (s);
+#endif
+
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid ZIP compression type");
+ return ARCHIVE_FATAL;
+ }
+}
+
+static int
+archive_write_zip_finish_entry(struct archive_write *a)
+{
+ /* Write the data descripter after file data has been written. */
+ int ret;
+ struct zip *zip = a->format_data;
+ struct zip_data_descriptor *d = &zip->data_descriptor;
+ struct zip_file_header_link *l = zip->central_directory_end;
+#if HAVE_ZLIB_H
+ size_t reminder;
+#endif
+
+ switch(zip->compression) {
+ case COMPRESSION_STORE:
+ break;
+#if HAVE_ZLIB_H
+ case COMPRESSION_DEFLATE:
+ for (;;) {
+ ret = deflate(&zip->stream, Z_FINISH);
+ if (ret == Z_STREAM_ERROR)
+ return (ARCHIVE_FATAL);
+ reminder = zip->len_buf - zip->stream.avail_out;
+ ret = (a->compressor.write)(a, zip->buf, reminder);
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ l->compressed_size += reminder;
+ zip->written_bytes += reminder;
+ zip->stream.next_out = zip->buf;
+ if (zip->stream.avail_out != 0)
+ break;
+ zip->stream.avail_out = zip->len_buf;
+ }
+ deflateEnd(&zip->stream);
+ break;
+#endif
+ }
+
+ archive_le32enc(&d->crc32, l->crc32);
+ archive_le32enc(&d->compressed_size, l->compressed_size);
+ ret = (a->compressor.write)(a, d, sizeof(*d));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(*d);
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_write_zip_finish(struct archive_write *a)
+{
+ struct zip *zip;
+ struct zip_file_header_link *l;
+ struct zip_file_header h;
+ struct zip_central_directory_end end;
+ struct zip_extra_data_central e;
+ off_t offset_start, offset_end;
+ int entries;
+ int ret;
+
+ zip = a->format_data;
+ l = zip->central_directory;
+
+ /*
+ * Formatting central directory file header fields that are fixed for all entries.
+ * Fields not used (and therefor 0) are:
+ *
+ * - comment_length
+ * - disk_number
+ * - attributes_internal
+ */
+ memset(&h, 0, sizeof(h));
+ archive_le32enc(&h.signature, ZIP_SIGNATURE_FILE_HEADER);
+ archive_le16enc(&h.version_by, ZIP_VERSION_BY);
+ archive_le16enc(&h.version_extract, ZIP_VERSION_EXTRACT);
+ archive_le16enc(&h.flags, ZIP_FLAGS);
+
+ entries = 0;
+ offset_start = zip->written_bytes;
+
+ /* Formatting individual header fields per entry and
+ * writing each entry. */
+ while (l != NULL) {
+ archive_le16enc(&h.compression, l->compression);
+ archive_le32enc(&h.timedate, dos_time(archive_entry_mtime(l->entry)));
+ archive_le32enc(&h.crc32, l->crc32);
+ archive_le32enc(&h.compressed_size, l->compressed_size);
+ archive_le32enc(&h.uncompressed_size, archive_entry_size(l->entry));
+ archive_le16enc(&h.filename_length, (uint16_t)path_length(l->entry));
+ archive_le16enc(&h.extra_length, sizeof(e));
+ archive_le16enc(&h.attributes_external[2], archive_entry_mode(l->entry));
+ archive_le32enc(&h.offset, l->offset);
+
+ /* Formatting extra data. */
+ archive_le16enc(&e.time_id, ZIP_SIGNATURE_EXTRA_TIMESTAMP);
+ archive_le16enc(&e.time_size, sizeof(e.mtime) + sizeof(e.time_flag));
+ e.time_flag[0] = 0x07;
+ archive_le32enc(&e.mtime, archive_entry_mtime(l->entry));
+ archive_le16enc(&e.unix_id, ZIP_SIGNATURE_EXTRA_UNIX);
+ archive_le16enc(&e.unix_size, 0x0000);
+
+ ret = (a->compressor.write)(a, &h, sizeof(h));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(h);
+
+ ret = write_path(l->entry, a);
+ if (ret <= ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += ret;
+
+ ret = (a->compressor.write)(a, &e, sizeof(e));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(e);
+
+ l = l->next;
+ entries++;
+ }
+ offset_end = zip->written_bytes;
+
+ /* Formatting end of central directory. */
+ memset(&end, 0, sizeof(end));
+ archive_le32enc(&end.signature, ZIP_SIGNATURE_CENTRAL_DIRECTORY_END);
+ archive_le16enc(&end.entries_disk, entries);
+ archive_le16enc(&end.entries, entries);
+ archive_le32enc(&end.size, offset_end - offset_start);
+ archive_le32enc(&end.offset, offset_start);
+
+ /* Writing end of central directory. */
+ ret = (a->compressor.write)(a, &end, sizeof(end));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ zip->written_bytes += sizeof(end);
+ return (ARCHIVE_OK);
+}
+
+static int
+archive_write_zip_destroy(struct archive_write *a)
+{
+ struct zip *zip;
+ struct zip_file_header_link *l;
+
+ zip = a->format_data;
+ while (zip->central_directory != NULL) {
+ l = zip->central_directory;
+ zip->central_directory = l->next;
+ archive_entry_free(l->entry);
+ free(l);
+ }
+#ifdef HAVE_ZLIB_H
+ free(zip->buf);
+#endif
+ free(zip);
+ a->format_data = NULL;
+ return (ARCHIVE_OK);
+}
+
+/* Convert into MSDOS-style date/time. */
+static unsigned int
+dos_time(const time_t unix_time)
+{
+ struct tm *t;
+ unsigned int dt;
+
+ /* This will not preserve time when creating/extracting the archive
+ * on two systems with different time zones. */
+ t = localtime(&unix_time);
+
+ dt = 0;
+ dt += ((t->tm_year - 80) & 0x7f) << 9;
+ dt += ((t->tm_mon + 1) & 0x0f) << 5;
+ dt += (t->tm_mday & 0x1f);
+ dt <<= 16;
+ dt += (t->tm_hour & 0x1f) << 11;
+ dt += (t->tm_min & 0x3f) << 5;
+ dt += (t->tm_sec & 0x3e) >> 1; /* Only counting every 2 seconds. */
+ return dt;
+}
+
+static size_t
+path_length(struct archive_entry *entry)
+{
+ mode_t type;
+ const char *path;
+
+ type = archive_entry_filetype(entry);
+ path = archive_entry_pathname(entry);
+
+ if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) {
+ return strlen(path) + 1;
+ } else {
+ return strlen(path);
+ }
+}
+
+static int
+write_path(struct archive_entry *entry, struct archive_write *archive)
+{
+ int ret;
+ const char *path;
+ mode_t type;
+ size_t written_bytes;
+
+ path = archive_entry_pathname(entry);
+ type = archive_entry_filetype(entry);
+ written_bytes = 0;
+
+ ret = (archive->compressor.write)(archive, path, strlen(path));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ written_bytes += strlen(path);
+
+ /* Folders are recognized by a traling slash. */
+ if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) {
+ ret = (archive->compressor.write)(archive, "/", 1);
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ written_bytes += 1;
+ }
+
+ return ((int)written_bytes);
+}
diff --git a/archivers/libarchive/files/libarchive/config_freebsd.h b/archivers/libarchive/files/libarchive/config_freebsd.h
index 4182b71df47..fad40871415 100644
--- a/archivers/libarchive/files/libarchive/config_freebsd.h
+++ b/archivers/libarchive/files/libarchive/config_freebsd.h
@@ -22,28 +22,47 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/config_freebsd.h,v 1.10 2008/06/15 05:12:47 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/config_freebsd.h 201079 2009-12-28 02:01:42Z kientzle $
*/
-/* FreeBSD 5.0 and later have ACL support. */
+/* FreeBSD 5.0 and later have ACL and extattr support. */
#if __FreeBSD__ > 4
#define HAVE_ACL_CREATE_ENTRY 1
+#define HAVE_ACL_GET_LINK_NP 1
+#define HAVE_ACL_GET_PERM_NP 1
#define HAVE_ACL_INIT 1
#define HAVE_ACL_SET_FD 1
#define HAVE_ACL_SET_FD_NP 1
#define HAVE_ACL_SET_FILE 1
#define HAVE_ACL_USER 1
+#define HAVE_EXTATTR_GET_FILE 1
+#define HAVE_EXTATTR_LIST_FILE 1
+#define HAVE_EXTATTR_SET_FD 1
+#define HAVE_EXTATTR_SET_FILE 1
+#define HAVE_SYS_ACL_H 1
+#define HAVE_SYS_EXTATTR_H 1
+#endif
+
+#ifdef WITH_OPENSSL
+#define HAVE_OPENSSL_MD5_H 1
+#define HAVE_OPENSSL_RIPEMD_H 1
+#define HAVE_OPENSSL_SHA_H 1
+#define HAVE_SHA384 1
+#define HAVE_SHA512 1
#endif
+#define HAVE_BSDXML_H 1
#define HAVE_BZLIB_H 1
#define HAVE_CHFLAGS 1
#define HAVE_CHOWN 1
#define HAVE_DECL_INT64_MAX 1
#define HAVE_DECL_INT64_MIN 1
#define HAVE_DECL_SIZE_MAX 1
+#define HAVE_DECL_SSIZE_MAX 1
#define HAVE_DECL_STRERROR_R 1
#define HAVE_DECL_UINT32_MAX 1
#define HAVE_DECL_UINT64_MAX 1
+#define HAVE_DIRENT_H 1
#define HAVE_EFTYPE 1
#define HAVE_EILSEQ 1
#define HAVE_ERRNO_H 1
@@ -55,6 +74,7 @@
#define HAVE_FCNTL_H 1
#define HAVE_FSEEKO 1
#define HAVE_FSTAT 1
+#define HAVE_FTRUNCATE 1
#define HAVE_FUTIMES 1
#define HAVE_GETEUID 1
#define HAVE_GETPID 1
@@ -64,10 +84,13 @@
#define HAVE_LCHMOD 1
#define HAVE_LCHOWN 1
#define HAVE_LIMITS_H 1
+#define HAVE_LINK 1
+#define HAVE_LSTAT 1
#define HAVE_LUTIMES 1
#define HAVE_MALLOC 1
+#define HAVE_MD5 1
+#define HAVE_MD5_H 1
#define HAVE_MEMMOVE 1
-#define HAVE_MEMSET 1
#define HAVE_MKDIR 1
#define HAVE_MKFIFO 1
#define HAVE_MKNOD 1
@@ -75,8 +98,15 @@
#define HAVE_POLL 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
+#define HAVE_READLINK 1
+#define HAVE_RMD160 1
#define HAVE_SELECT 1
#define HAVE_SETENV 1
+#define HAVE_SHA_H 1
+#define HAVE_SHA1 1
+#define HAVE_SHA256 1
+#define HAVE_SHA256_H 1
+#define HAVE_SIGNAL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRCHR 1
@@ -86,8 +116,13 @@
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STRRCHR 1
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
-#define HAVE_SYS_ACL_H 1
+#define HAVE_SYMLINK 1
+#define HAVE_SYS_CDEFS_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_STAT_H 1
@@ -110,7 +145,6 @@
#define HAVE_WMEMCMP 1
#define HAVE_WMEMCPY 1
#define HAVE_ZLIB_H 1
-#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
diff --git a/archivers/libarchive/files/libarchive/filter_fork.c b/archivers/libarchive/files/libarchive/filter_fork.c
index c746a186f52..604ad633f55 100644
--- a/archivers/libarchive/files/libarchive/filter_fork.c
+++ b/archivers/libarchive/files/libarchive/filter_fork.c
@@ -29,7 +29,7 @@
#if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \
(defined(HAVE_FORK) || defined(HAVE_VFORK))
-__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.4 2008/06/15 10:45:57 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/filter_fork.c 182958 2008-09-12 05:33:00Z kientzle $");
#if defined(HAVE_POLL)
# if defined(HAVE_POLL_H)
@@ -61,7 +61,7 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
if (pipe(stdin_pipe) == -1)
goto state_allocated;
- if (stdin_pipe[0] == STDOUT_FILENO) {
+ if (stdin_pipe[0] == 1 /* stdout */) {
if ((tmp = dup(stdin_pipe[0])) == -1)
goto stdin_opened;
close(stdin_pipe[0]);
@@ -69,7 +69,7 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
}
if (pipe(stdout_pipe) == -1)
goto stdin_opened;
- if (stdout_pipe[1] == STDIN_FILENO) {
+ if (stdout_pipe[1] == 0 /* stdin */) {
if ((tmp = dup(stdout_pipe[1])) == -1)
goto stdout_opened;
close(stdout_pipe[1]);
@@ -86,16 +86,16 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
case 0:
close(stdin_pipe[1]);
close(stdout_pipe[0]);
- if (dup2(stdin_pipe[0], STDIN_FILENO) == -1)
+ if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
_exit(254);
- if (stdin_pipe[0] != STDIN_FILENO)
+ if (stdin_pipe[0] != 0 /* stdin */)
close(stdin_pipe[0]);
- if (dup2(stdout_pipe[1], STDOUT_FILENO) == -1)
+ if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
_exit(254);
- if (stdout_pipe[1] != STDOUT_FILENO)
+ if (stdout_pipe[1] != 1 /* stdout */)
close(stdout_pipe[1]);
execlp(path, path, (char *)NULL);
- _exit(254);
+ _exit(254);
default:
close(stdin_pipe[0]);
close(stdout_pipe[1]);
diff --git a/archivers/libarchive/files/libarchive/filter_fork.h b/archivers/libarchive/files/libarchive/filter_fork.h
index 685efda09fc..453d032d1c8 100644
--- a/archivers/libarchive/files/libarchive/filter_fork.h
+++ b/archivers/libarchive/files/libarchive/filter_fork.h
@@ -22,9 +22,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/filter_fork.h,v 1.1 2007/05/29 01:00:20 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/filter_fork.h 201087 2009-12-28 02:18:26Z kientzle $
*/
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
#ifndef FILTER_FORK_H
#define FILTER_FORK_H
diff --git a/archivers/libarchive/files/libarchive/filter_fork_windows.c b/archivers/libarchive/files/libarchive/filter_fork_windows.c
new file mode 100644
index 00000000000..38b7097ee99
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/filter_fork_windows.c
@@ -0,0 +1,113 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#include "filter_fork.h"
+
+pid_t
+__archive_create_child(const char *path, int *child_stdin, int *child_stdout)
+{
+ HANDLE childStdout[2], childStdin[2], childStdinWr, childStdoutRd;
+ SECURITY_ATTRIBUTES secAtts;
+ STARTUPINFO staInfo;
+ PROCESS_INFORMATION childInfo;
+ char cmd[MAX_PATH];
+ DWORD mode;
+
+ secAtts.nLength = sizeof(SECURITY_ATTRIBUTES);
+ secAtts.bInheritHandle = TRUE;
+ secAtts.lpSecurityDescriptor = NULL;
+ if (CreatePipe(&childStdout[0], &childStdout[1], &secAtts, 0) == 0)
+ goto fail;
+ if (DuplicateHandle(GetCurrentProcess(), childStdout[0],
+ GetCurrentProcess(), &childStdoutRd, 0, FALSE,
+ DUPLICATE_SAME_ACCESS) == 0) {
+ CloseHandle(childStdout[0]);
+ CloseHandle(childStdout[1]);
+ goto fail;
+ }
+ CloseHandle(childStdout[0]);
+
+ if (CreatePipe(&childStdin[0], &childStdin[1], &secAtts, 0) == 0) {
+ CloseHandle(childStdoutRd);
+ CloseHandle(childStdout[1]);
+ goto fail;
+ }
+
+ if (DuplicateHandle(GetCurrentProcess(), childStdin[1],
+ GetCurrentProcess(), &childStdinWr, 0, FALSE,
+ DUPLICATE_SAME_ACCESS) == 0) {
+ CloseHandle(childStdoutRd);
+ CloseHandle(childStdout[1]);
+ CloseHandle(childStdin[0]);
+ CloseHandle(childStdin[1]);
+ goto fail;
+ }
+ CloseHandle(childStdin[1]);
+
+ memset(&staInfo, 0, sizeof(staInfo));
+ staInfo.cb = sizeof(staInfo);
+ staInfo.hStdOutput = childStdout[1];
+ staInfo.hStdInput = childStdin[0];
+ staInfo.wShowWindow = SW_HIDE;
+ staInfo.dwFlags = STARTF_USEFILLATTRIBUTE | STARTF_USECOUNTCHARS |
+ STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ strncpy(cmd, path, sizeof(cmd)-1);
+ cmd[sizeof(cmd)-1] = '\0';
+ if (CreateProcessA(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL,
+ &staInfo, &childInfo) == 0) {
+ CloseHandle(childStdoutRd);
+ CloseHandle(childStdout[1]);
+ CloseHandle(childStdin[0]);
+ CloseHandle(childStdinWr);
+ goto fail;
+ }
+ WaitForInputIdle(childInfo.hProcess, INFINITE);
+ CloseHandle(childInfo.hProcess);
+ CloseHandle(childInfo.hThread);
+
+ mode = PIPE_NOWAIT;
+ SetNamedPipeHandleState(childStdoutRd, &mode, NULL, NULL);
+ *child_stdout = _open_osfhandle((intptr_t)childStdoutRd, _O_RDONLY);
+ *child_stdin = _open_osfhandle((intptr_t)childStdinWr, _O_WRONLY);
+
+ return (childInfo.dwProcessId);
+
+fail:
+ return (-1);
+}
+
+void
+__archive_check_child(int in, int out)
+{
+ (void)in; /* UNSED */
+ (void)out; /* UNSED */
+ Sleep(100);
+}
+
+#endif /* _WIN32 && !__CYGWIN__ */
diff --git a/archivers/libarchive/files/libarchive/libarchive-formats.5 b/archivers/libarchive/files/libarchive/libarchive-formats.5
index dd054a93916..0acdb50c2bd 100644
--- a/archivers/libarchive/files/libarchive/libarchive-formats.5
+++ b/archivers/libarchive/files/libarchive/libarchive-formats.5
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2003-2007 Tim Kientzle
+.\" Copyright (c) 2003-2009 Tim Kientzle
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,10 +22,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.16 2008/05/26 17:00:23 kientzle Exp $
+.\" $FreeBSD: head/lib/libarchive/libarchive-formats.5 201077 2009-12-28 01:50:23Z kientzle $
.\"
-.Dd April 27, 2004
-.Dt libarchive-formats 3
+.Dd December 27, 2009
+.Dt libarchive-formats 5
.Os
.Sh NAME
.Nm libarchive-formats
@@ -45,7 +45,8 @@ limitations of the current library support.
Note that just because a format is supported by libarchive does not
imply that a program that uses libarchive will support that format.
Applications that use libarchive specify which formats they wish
-to support.
+to support, though many programs do use libarchive convenience
+functions to enable all supported formats.
.Ss Tar Formats
The
.Xr libarchive 3
@@ -83,8 +84,8 @@ library can read and write POSIX-compliant pax interchange format
archives.
Pax interchange format archives are an extension of the older ustar
format that adds a separate entry with additional attributes stored
-as key/value pairs.
-The presence of this additional entry is the only difference between
+as key/value pairs immediately before each regular entry.
+The presence of these additional entries is the only difference between
pax interchange format and the older ustar format.
The extended attributes are of unlimited length and are stored
as UTF-8 Unicode strings.
@@ -93,8 +94,9 @@ to define custom keys by preceding them with the vendor name in all uppercase.
When writing pax archives, libarchive uses many of the SCHILY keys
defined by Joerg Schilling's
.Dq star
-archiver.
-The libarchive library can read most of the SCHILY keys.
+archiver and a few LIBARCHIVE keys.
+The libarchive library can read most of the SCHILY keys
+and most of the GNU keys introduced by GNU tar.
It silently ignores any keywords that it does not understand.
.It Cm restricted pax
The libarchive library can also write pax archives in which it
@@ -130,16 +132,30 @@ This name is limited to 100 bytes.
Extended attributes, file flags, and other extended
security information cannot be stored.
.It
-Archive entries are limited to 2 gigabytes in size.
+Archive entries are limited to 8 gigabytes in size.
.El
Note that the pax interchange format has none of these restrictions.
.El
.Pp
-The libarchive library can also read a variety of commonly-used extensions to
+The libarchive library also reads a variety of commonly-used extensions to
the basic tar format.
-In particular, it supports base-256 values in certain numeric fields.
-This essentially removes the limitations on file size, modification time,
+These extensions are recognized automatically whenever they appear.
+.Bl -tag -width indent
+.It Numeric extensions.
+The POSIX standards require fixed-length numeric fields to be written with
+some character position reserved for terminators.
+Libarchive allows these fields to be written without terminator characters.
+This extends the allowable range; in particular, ustar archives with this
+extension can support entries up to 64 gigabytes in size.
+Libarchive also recognizes base-256 values in most numeric fields.
+This essentially removes all limitations on file size, modification time,
and device numbers.
+.It Solaris extensions
+Libarchive recognizes ACL and extended attribute records written
+by Solaris tar.
+Currently, libarchive only has support for old-style ACLs; the
+newer NFSv4 ACLs are recognized but discarded.
+.El
.Pp
The first tar program appeared in Seventh Edition Unix in 1979.
The first official standard for the tar file format was the
@@ -156,20 +172,26 @@ and
format archives.
A cpio archive stores each entry as a fixed-size header followed
by a variable-length filename and variable-length data.
-Unlike tar, cpio does only minimal padding of the header or file data.
-There are a variety of cpio formats, which differ primarily in
+Unlike the tar format, the cpio format does only minimal padding
+of the header or file data.
+There are several cpio variants, which differ primarily in
how they store the initial header: some store the values as
octal or hexadecimal numbers in ASCII, others as binary values of
varying byte order and length.
.Bl -tag -width indent
.It Cm binary
-The libarchive library can read both big-endian and little-endian
+The libarchive library transparently reads both big-endian and little-endian
variants of the original binary cpio format.
This format used 32-bit binary values for file size and mtime,
and 16-bit binary values for the other fields.
.It Cm odc
The libarchive library can both read and write this
-POSIX-standard format.
+POSIX-standard format, which is officially known as the
+.Dq cpio interchange format
+or the
+.Dq octet-oriented cpio archive format
+and sometimes unofficially referred to as the
+.Dq old character format .
This format stores the header contents as octal values in ASCII.
It is standard, portable, and immune from byte-order confusion.
File sizes and mtime are limited to 33 bits (8GB file size),
@@ -236,17 +258,29 @@ shardump archives less portable than plain shar archives.
.Ss ISO9660 format
Libarchive can read and extract from files containing ISO9660-compliant
CDROM images.
-It also has partial support for Rockridge extensions.
-In many cases, this can remove the need to burn a physical CDROM.
+In many cases, this can remove the need to burn a physical CDROM
+just in order to read the files contained in an ISO9660 image.
It also avoids security and complexity issues that come with
virtual mounts and loopback devices.
+Libarchive supports the most common Rockridge extensions and has partial
+support for Joliet extensions.
+If both extensions are present, the Joliet extensions will be
+used and the Rockridge extensions will be ignored.
+In particular, this can create problems with hardlinks and symlinks,
+which are supported by Rockridge but not by Joliet.
.Ss Zip format
-Libarchive can extract from most zip format archives.
-It currently only supports uncompressed entries and entries
-compressed with the
+Libarchive can read and write zip format archives that have
+uncompressed entries and entries compressed with the
.Dq deflate
algorithm.
Older zip compression algorithms are not supported.
+It can extract jar archives, archives that use Zip64 extensions and many
+self-extracting zip archives.
+Libarchive reads Zip archives as they are being streamed,
+which allows it to read archives of arbitrary size.
+It currently does not use the central directory; this
+limits libarchive's ability to support some self-extracting
+archives and ones that have been modified in certain ways.
.Ss Archive (library) file format
The Unix archive format (commonly created by the
.Xr ar 1
@@ -258,15 +292,56 @@ The ar format has never been standardised.
There are two common variants:
the GNU format derived from SVR4,
and the BSD format, which first appeared in 4.4BSD.
-Libarchive provides read and write support for both variants.
+The two differ primarily in their handling of filenames
+longer than 15 characters:
+the GNU/SVR4 variant writes a filename table at the beginning of the archive;
+the BSD format stores each long filename in an extension
+area adjacent to the entry.
+Libarchive can read both extensions,
+including archives that may include both types of long filenames.
+Programs using libarchive can write GNU/SVR4 format
+if they provide a filename table to be written into
+the archive before any of the entries.
+Any entries whose names are not in the filename table
+will be written using BSD-style long filenames.
+This can cause problems for programs such as
+GNU ld that do not support the BSD-style long filenames.
.Ss mtree
-Libarchive can read files in
-.Xr mtree 5
-format. This format is not a true archive format, but rather a description
-of a file hierarchy. When requested, libarchive obtains the contents of
-the files described by the
+Libarchive can read and write files in
.Xr mtree 5
-format from files on disk instead.
+format.
+This format is not a true archive format, but rather a textual description
+of a file hierarchy in which each line specifies the name of a file and
+provides specific metadata about that file.
+Libarchive can read all of the keywords supported by both
+the NetBSD and FreeBSD versions of
+.Xr mtree 1 ,
+although many of the keywords cannot currently be stored in an
+.Tn archive_entry
+object.
+When writing, libarchive supports use of the
+.Xr archive_write_set_options 3
+interface to specify which keywords should be included in the
+output.
+If libarchive was compiled with access to suitable
+cryptographic libraries (such as the OpenSSL libraries),
+it can compute hash entries such as
+.Cm sha512
+or
+.Cm md5
+from file data being written to the mtree writer.
+.Pp
+When reading an mtree file, libarchive will locate the corresponding
+files on disk using the
+.Cm contents
+keyword if present or the regular filename.
+If it can locate and open the file on disk, it will use that
+to fill in any metadata that is missing from the mtree file
+and will read the file contents and return those to the program
+using libarchive.
+If it cannot locate and open the file on disk, libarchive
+will return an error for any attempt to read the entry
+body.
.Sh SEE ALSO
.Xr ar 1 ,
.Xr cpio 1 ,
diff --git a/archivers/libarchive/files/libarchive/tar.5 b/archivers/libarchive/files/libarchive/tar.5
index 06873268097..aafd535a1a5 100644
--- a/archivers/libarchive/files/libarchive/tar.5
+++ b/archivers/libarchive/files/libarchive/tar.5
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2003-2007 Tim Kientzle
+.\" Copyright (c) 2003-2009 Tim Kientzle
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,10 +22,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/tar.5,v 1.18 2008/05/26 17:00:23 kientzle Exp $
+.\" $FreeBSD: head/lib/libarchive/tar.5 201077 2009-12-28 01:50:23Z kientzle $
.\"
-.Dd May 20, 2004
-.Dt TAR 5
+.Dd December 27, 2009
+.Dt tar 5
.Os
.Sh NAME
.Nm tar
@@ -55,8 +55,11 @@ number of records with each I/O operation.
These
.Dq blocks
are always a multiple of the record size.
-The most common block size\(emand the maximum supported by historic
-implementations\(emis 10240 bytes or 20 records.
+The maximum block size supported by early
+implementations was 10240 bytes or 20 records.
+This is still the default for most implementations
+although block sizes of 1MiB (2048 records) or larger are
+commonly used with modern high-speed tape drives.
(Note: the terms
.Dq block
and
@@ -71,7 +74,7 @@ necessary.
This section describes the variant implemented by the tar command
included in
.At v7 ,
-which is one of the earliest widely-used versions of the tar program.
+which seems to be the earliest widely-used version of the tar program.
.Pp
The header record for an old-style
.Nm
@@ -272,16 +275,19 @@ when they are set and the corresponding names exist on
the system.
.It Va devmajor , Va devminor
Major and minor numbers for character device or block device entry.
-.It Va prefix
-First part of pathname.
+.It Va name , Va prefix
If the pathname is too long to fit in the 100 bytes provided by the standard
format, it can be split at any
.Pa /
-character with the first portion going here.
+character with the first portion going into the prefix field.
If the prefix field is not empty, the reader will prepend
the prefix value and a
.Pa /
character to the regular name field to obtain the full pathname.
+The standard does not require a trailing
+.Pa /
+character on directory names, though most implementations still
+include this for compatibility reasons.
.El
.Pp
Note that all unused bytes must be set to
@@ -308,7 +314,7 @@ unless they fill the entire field.
happens to have a
.Pa /
as the 156th character.)
-POSIX requires numeric fields to be zero-padded in the front, and allows
+POSIX requires numeric fields to be zero-padded in the front, and requires
them to be terminated with either space or
.Dv NUL
characters.
@@ -390,6 +396,11 @@ user or group information available (such as when NIS/YP or LDAP services
are temporarily unavailable).
.It Cm SCHILY.devminor , Cm SCHILY.devmajor
The full minor and major numbers for device nodes.
+.It Cm SCHILY.fflags
+The file flags.
+.It Cm SCHILY.realsize
+The full size of the file on disk.
+XXX explain? XXX
.It Cm SCHILY.dev, Cm SCHILY.ino , Cm SCHILY.nlinks
The device number, inode number, and link count for the entry.
In particular, note that a pax interchange format archive using Joerg
@@ -560,9 +571,6 @@ plus
When extracting, GNU tar checks that the header file name is the one it is
expecting, that the header offset is in the correct sequence, and that
the sum of offset and size is equal to realsize.
-FreeBSD's version of GNU tar does not handle the corner case of an
-archive's being continued in the middle of a long name or other
-extension header.
.It "N"
Type "N" records are no longer generated by GNU tar.
They contained a
@@ -575,6 +583,8 @@ or
.Dq Symlink %s to %s\en ;
in either case, both
filenames are escaped using K&R C syntax.
+Due to security concerns, "N" records are now generally ignored
+when reading archives.
.It "S"
This is a
.Dq sparse
@@ -644,6 +654,66 @@ entry; the
.Va realsize
field will indicate the total size of the file.
.El
+.Ss GNU tar pax archives
+GNU tar 1.14 (XXX check this XXX) and later will write
+pax interchange format archives when you specify the
+.Fl -posix
+flag.
+This format uses custom keywords to store sparse file information.
+There have been three iterations of this support, referred to
+as
+.Dq 0.0 ,
+.Dq 0.1 ,
+and
+.Dq 1.0 .
+.Bl -tag -width indent
+.It Cm GNU.sparse.numblocks , Cm GNU.sparse.offset , Cm GNU.sparse.numbytes , Cm GNU.sparse.size
+The
+.Dq 0.0
+format used an initial
+.Cm GNU.sparse.numblocks
+attribute to indicate the number of blocks in the file, a pair of
+.Cm GNU.sparse.offset
+and
+.Cm GNU.sparse.numbytes
+to indicate the offset and size of each block,
+and a single
+.Cm GNU.sparse.size
+to indicate the full size of the file.
+This is not the same as the size in the tar header because the
+latter value does not include the size of any holes.
+This format required that the order of attributes be preserved and
+relied on readers accepting multiple appearances of the same attribute
+names, which is not officially permitted by the standards.
+.It Cm GNU.sparse.map
+The
+.Dq 0.1
+format used a single attribute that stored a comma-separated
+list of decimal numbers.
+Each pair of numbers indicated the offset and size, respectively,
+of a block of data.
+This does not work well if the archive is extracted by an archiver
+that does not recognize this extension, since many pax implementations
+simply discard unrecognized attributes.
+.It Cm GNU.sparse.major , Cm GNU.sparse.minor , Cm GNU.sparse.name , Cm GNU.sparse.realsize
+The
+.Dq 1.0
+format stores the sparse block map in one or more 512-byte blocks
+prepended to the file data in the entry body.
+The pax attributes indicate the existence of this map
+(via the
+.Cm GNU.sparse.major
+and
+.Cm GNU.sparse.minor
+fields)
+and the full size of the file.
+The
+.Cm GNU.sparse.name
+holds the true name of the file.
+To avoid confusion, the name stored in the regular tar header
+is a modified name so that extraction errors will be apparent
+to users.
+.El
.Ss Solaris Tar
XXX More Details Needed XXX
.Pp
@@ -667,16 +737,42 @@ An additional
.Cm A
entry is used to store an ACL for the following regular entry.
The body of this entry contains a seven-digit octal number
-(whose value is 01000000 plus the number of ACL entries)
followed by a zero byte, followed by the
textual ACL description.
+The octal value is the number of ACL entries
+plus a constant that indicates the ACL type: 01000000
+for POSIX.1e ACLs and 03000000 for NFSv4 ACLs.
.El
+.Ss AIX Tar
+XXX More details needed XXX
+.Ss Mac OS X Tar
+The tar distributed with Apple's Mac OS X stores most regular files
+as two separate entries in the tar archive.
+The two entries have the same name except that the first
+one has
+.Dq ._
+added to the beginning of the name.
+This first entry stores the
+.Dq resource fork
+with additional attributes for the file.
+The Mac OS X
+.Fn CopyFile
+API is used to separate a file on disk into separate
+resource and data streams and to reassemble those separate
+streams when the file is restored to disk.
.Ss Other Extensions
-One common extension, utilized by GNU tar, star, and other newer
+One obvious extension to increase the size of files is to
+eliminate the terminating characters from the various
+numeric fields.
+For example, the standard only allows the size field to contain
+11 octal digits, reserving the twelfth byte for a trailing
+NUL character.
+Allowing 12 octal digits allows file sizes up to 64 GB.
+.Pp
+Another extension, utilized by GNU tar, star, and other newer
.Nm
-implementations, permits binary numbers in the standard numeric
-fields.
-This is flagged by setting the high bit of the first character.
+implementations, permits binary numbers in the standard numeric fields.
+This is flagged by setting the high bit of the first byte.
This permits 95-bit values for the length and time fields
and 63-bit values for the uid, gid, and device numbers.
GNU tar supports this extension for the
@@ -686,12 +782,9 @@ all numeric fields.
Note that this extension is largely obsoleted by the extended attribute
record provided by the pax interchange format.
.Pp
-Another early GNU extension allowed base-64 values rather
-than octal.
-This extension was short-lived and such archives are almost never seen.
-However, there is still code in GNU tar to support them; this code is
-responsible for a very cryptic warning message that is sometimes seen when
-GNU tar encounters a damaged archive.
+Another early GNU extension allowed base-64 values rather than octal.
+This extension was short-lived and is no longer supported by any
+implementation.
.Sh SEE ALSO
.Xr ar 1 ,
.Xr pax 1 ,
@@ -722,9 +815,17 @@ John Gilmore's
.Nm pdtar
public-domain implementation (circa 1987) was highly influential
and formed the basis of
-.Nm GNU tar .
+.Nm GNU tar
+(circa 1988).
Joerg Shilling's
.Nm star
archiver is another open-source (GPL) archiver (originally developed
circa 1985) which features complete support for pax interchange
format.
+.Pp
+This documentation was written as part of the
+.Nm libarchive
+and
+.Nm bsdtar
+project by
+.An Tim Kientzle Aq kientzle@FreeBSD.org .
diff --git a/archivers/libarchive/files/libarchive/test/CMakeLists.txt b/archivers/libarchive/files/libarchive/test/CMakeLists.txt
new file mode 100644
index 00000000000..626340a4161
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/CMakeLists.txt
@@ -0,0 +1,158 @@
+############################################
+#
+# How to build libarchive_test
+#
+############################################
+IF(ENABLE_TEST)
+ FOREACH (_src ${libarchive_SOURCES})
+ LIST(APPEND parent_libarchive_SOURCES "../${_src}")
+ ENDFOREACH(_src)
+
+ SET(libarchive_test_SOURCES
+ ${parent_libarchive_SOURCES}
+ main.c
+ read_open_memory.c
+ test.h
+ test_acl_basic.c
+ test_acl_freebsd.c
+ test_acl_pax.c
+ test_archive_api_feature.c
+ test_bad_fd.c
+ test_compat_bzip2.c
+ test_compat_cpio.c
+ test_compat_gtar.c
+ test_compat_gzip.c
+ test_compat_lzma.c
+ test_compat_solaris_tar_acl.c
+ test_compat_tar_hardlink.c
+ test_compat_xz.c
+ test_compat_zip.c
+ test_empty_write.c
+ test_entry.c
+ test_entry_strmode.c
+ test_extattr_freebsd.c
+ test_fuzz.c
+ test_link_resolver.c
+ test_open_fd.c
+ test_open_file.c
+ test_open_filename.c
+ test_pax_filename_encoding.c
+ test_read_compress_program.c
+ test_read_data_large.c
+ test_read_disk.c
+ test_read_disk_entry_from_file.c
+ test_read_extract.c
+ test_read_file_nonexistent.c
+ test_read_format_ar.c
+ test_read_format_cpio_bin.c
+ test_read_format_cpio_bin_Z.c
+ test_read_format_cpio_bin_be.c
+ test_read_format_cpio_bin_bz2.c
+ test_read_format_cpio_bin_gz.c
+ test_read_format_cpio_bin_lzma.c
+ test_read_format_cpio_bin_xz.c
+ test_read_format_cpio_odc.c
+ test_read_format_cpio_svr4_bzip2_rpm.c
+ test_read_format_cpio_svr4_gzip.c
+ test_read_format_cpio_svr4_gzip_rpm.c
+ test_read_format_cpio_svr4c_Z.c
+ test_read_format_empty.c
+ test_read_format_gtar_gz.c
+ test_read_format_gtar_lzma.c
+ test_read_format_gtar_sparse.c
+ test_read_format_iso_gz.c
+ test_read_format_iso_multi_extent.c
+ test_read_format_isojoliet_bz2.c
+ test_read_format_isojoliet_long.c
+ test_read_format_isojoliet_rr.c
+ test_read_format_isorr_bz2.c
+ test_read_format_isorr_ce.c
+ test_read_format_isorr_new_bz2.c
+ test_read_format_isorr_rr_moved.c
+ test_read_format_isozisofs_bz2.c
+ test_read_format_mtree.c
+ test_read_format_pax_bz2.c
+ test_read_format_raw.c
+ test_read_format_tar.c
+ test_read_format_tar_empty_filename.c
+ test_read_format_tbz.c
+ test_read_format_tgz.c
+ test_read_format_tlz.c
+ test_read_format_txz.c
+ test_read_format_tz.c
+ test_read_format_xar.c
+ test_read_format_zip.c
+ test_read_large.c
+ test_read_pax_truncated.c
+ test_read_position.c
+ test_read_truncated.c
+ test_read_uu.c
+ test_tar_filenames.c
+ test_tar_large.c
+ test_ustar_filenames.c
+ test_write_compress.c
+ test_write_compress_bzip2.c
+ test_write_compress_gzip.c
+ test_write_compress_lzma.c
+ test_write_compress_program.c
+ test_write_compress_xz.c
+ test_write_disk.c
+ test_write_disk_failures.c
+ test_write_disk_hardlink.c
+ test_write_disk_perms.c
+ test_write_disk_secure.c
+ test_write_disk_sparse.c
+ test_write_disk_symlink.c
+ test_write_disk_times.c
+ test_write_format_ar.c
+ test_write_format_cpio.c
+ test_write_format_cpio_empty.c
+ test_write_format_cpio_odc.c
+ test_write_format_cpio_newc.c
+ test_write_format_mtree.c
+ test_write_format_pax.c
+ test_write_format_shar_empty.c
+ test_write_format_tar.c
+ test_write_format_tar_empty.c
+ test_write_format_tar_ustar.c
+ test_write_format_zip.c
+ test_write_format_zip_empty.c
+ test_write_format_zip_no_compression.c
+ test_write_open_memory.c
+ )
+
+ #
+ # Register target
+ #
+ ADD_EXECUTABLE(libarchive_test ${libarchive_test_SOURCES})
+ TARGET_LINK_LIBRARIES(libarchive_test ${ADDITIONAL_LIBS})
+ SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS
+ LIBARCHIVE_STATIC LIST_H)
+
+ #
+ # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
+ #
+ GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
+ ${CMAKE_CURRENT_LIST_FILE} ${libarchive_test_SOURCES})
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+ # list.h has a line DEFINE_TEST(testname) for every
+ # test. We can use that to define the tests for cmake by
+ # defining a DEFINE_TEST macro and reading list.h in.
+ MACRO (DEFINE_TEST _testname)
+ ADD_TEST_28(
+ NAME libarchive_${_testname}
+ COMMAND libarchive_test -vv
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
+ ENDMACRO (DEFINE_TEST _testname)
+
+ INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
+
+ # Experimental new test handling
+ ADD_CUSTOM_TARGET(run_libarchive_test
+ COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR})
+ ADD_DEPENDENCIES(run_all_tests run_libarchive_test)
+ENDIF(ENABLE_TEST)
+
diff --git a/archivers/libarchive/files/libarchive/test/README b/archivers/libarchive/files/libarchive/test/README
new file mode 100644
index 00000000000..235a70b0233
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/README
@@ -0,0 +1,63 @@
+$FreeBSD: src/lib/libarchive/test/README,v 1.3 2008/01/01 22:28:04 kientzle Exp $
+
+This is the test harness for libarchive.
+
+It compiles into a single program "libarchive_test" that is intended
+to exercise as much of the library as possible. It is, of course,
+very much a work in progress.
+
+Each test is a function named test_foo in a file named test_foo.c.
+Note that the file name is the same as the function name.
+Each file must start with this line:
+
+ #include "test.h"
+
+The test function must be declared with a line of this form
+
+ DEFINE_TEST(test_foo)
+
+Nothing else should appear on that line.
+
+When you add a test, please update the Makefile to add your
+file to the list of tests. The Makefile and main.c use various
+macro trickery to automatically collect a list of test functions
+to be invoked.
+
+Each test function can rely on the following:
+
+ * The current directory will be a freshly-created empty directory
+ suitable for that test. (The top-level main() creates a
+ directory for each separate test and chdir()s to that directory
+ before running the test.)
+
+ * The test function should use assert(), assertA() and similar macros
+ defined in test.h. If you need to add new macros of this form, feel
+ free to do so. The current macro set includes assertEqualInt() and
+ assertEqualString() that print out additional detail about their
+ arguments if the assertion does fail. 'A' versions also accept
+ a struct archive * and display any error message from there on
+ failure.
+
+ * You are encouraged to document each assertion with a failure() call
+ just before the assert. The failure() function is a printf-like
+ function whose text is displayed only if the assertion fails. It
+ can be used to display additional information relevant to the failure:
+
+ failure("The data read from file %s did not match the data written to that file.", filename);
+ assert(strcmp(buff1, buff2) == 0);
+
+ * Tests are encouraged to be economical with their memory and disk usage,
+ though this is not essential. The test is occasionally run under
+ a memory debugger to try to locate memory leaks in the library;
+ as a result, tests should be careful to release any memory they
+ allocate.
+
+ * Disable tests on specific platforms as necessary. Please don't
+ use config.h to adjust feature requirements, as I want the tests
+ to also serve as a check on the configure process. The following
+ form is appropriate:
+
+#if !defined(__PLATFORM) && !defined(__Platform2__)
+ assert(xxxx)
+#endif
+
diff --git a/archivers/libarchive/files/libarchive/test/list.h b/archivers/libarchive/files/libarchive/test/list.h
index 278821ad974..10efb873a64 100644
--- a/archivers/libarchive/files/libarchive/test/list.h
+++ b/archivers/libarchive/files/libarchive/test/list.h
@@ -1,61 +1,106 @@
DEFINE_TEST(test_acl_basic)
+DEFINE_TEST(test_acl_freebsd)
DEFINE_TEST(test_acl_pax)
DEFINE_TEST(test_archive_api_feature)
DEFINE_TEST(test_bad_fd)
+DEFINE_TEST(test_compat_bzip2)
+DEFINE_TEST(test_compat_cpio)
DEFINE_TEST(test_compat_gtar)
+DEFINE_TEST(test_compat_gzip)
+DEFINE_TEST(test_compat_lzma)
+DEFINE_TEST(test_compat_solaris_tar_acl)
DEFINE_TEST(test_compat_tar_hardlink)
+DEFINE_TEST(test_compat_xz)
DEFINE_TEST(test_compat_zip)
DEFINE_TEST(test_empty_write)
DEFINE_TEST(test_entry)
DEFINE_TEST(test_entry_strmode)
+DEFINE_TEST(test_extattr_freebsd)
+DEFINE_TEST(test_fuzz)
DEFINE_TEST(test_link_resolver)
-DEFINE_TEST(test_pax_filename_encoding_1)
-DEFINE_TEST(test_pax_filename_encoding_2)
-DEFINE_TEST(test_pax_filename_encoding_3)
+DEFINE_TEST(test_open_fd)
+DEFINE_TEST(test_open_file)
+DEFINE_TEST(test_open_filename)
+DEFINE_TEST(test_pax_filename_encoding)
DEFINE_TEST(test_read_compress_program)
DEFINE_TEST(test_read_data_large)
+DEFINE_TEST(test_read_disk)
+DEFINE_TEST(test_read_disk_entry_from_file)
DEFINE_TEST(test_read_extract)
+DEFINE_TEST(test_read_file_nonexistent)
DEFINE_TEST(test_read_format_ar)
DEFINE_TEST(test_read_format_cpio_bin)
DEFINE_TEST(test_read_format_cpio_bin_Z)
+DEFINE_TEST(test_read_format_cpio_bin_be)
DEFINE_TEST(test_read_format_cpio_bin_bz2)
DEFINE_TEST(test_read_format_cpio_bin_gz)
+DEFINE_TEST(test_read_format_cpio_bin_lzma)
+DEFINE_TEST(test_read_format_cpio_bin_xz)
DEFINE_TEST(test_read_format_cpio_odc)
+DEFINE_TEST(test_read_format_cpio_svr4_bzip2_rpm)
DEFINE_TEST(test_read_format_cpio_svr4_gzip)
+DEFINE_TEST(test_read_format_cpio_svr4_gzip_rpm)
DEFINE_TEST(test_read_format_cpio_svr4c_Z)
DEFINE_TEST(test_read_format_empty)
DEFINE_TEST(test_read_format_gtar_gz)
+DEFINE_TEST(test_read_format_gtar_lzma)
DEFINE_TEST(test_read_format_gtar_sparse)
DEFINE_TEST(test_read_format_iso_gz)
+DEFINE_TEST(test_read_format_iso_multi_extent)
+DEFINE_TEST(test_read_format_isojoliet_bz2)
+DEFINE_TEST(test_read_format_isojoliet_long)
+DEFINE_TEST(test_read_format_isojoliet_rr)
DEFINE_TEST(test_read_format_isorr_bz2)
+DEFINE_TEST(test_read_format_isorr_ce)
+DEFINE_TEST(test_read_format_isorr_new_bz2)
+DEFINE_TEST(test_read_format_isorr_rr_moved)
+DEFINE_TEST(test_read_format_isozisofs_bz2)
DEFINE_TEST(test_read_format_mtree)
DEFINE_TEST(test_read_format_pax_bz2)
+DEFINE_TEST(test_read_format_raw)
DEFINE_TEST(test_read_format_tar)
DEFINE_TEST(test_read_format_tar_empty_filename)
DEFINE_TEST(test_read_format_tbz)
DEFINE_TEST(test_read_format_tgz)
+DEFINE_TEST(test_read_format_tlz)
+DEFINE_TEST(test_read_format_txz)
DEFINE_TEST(test_read_format_tz)
+DEFINE_TEST(test_read_format_xar)
DEFINE_TEST(test_read_format_zip)
DEFINE_TEST(test_read_large)
DEFINE_TEST(test_read_pax_truncated)
DEFINE_TEST(test_read_position)
DEFINE_TEST(test_read_truncated)
+DEFINE_TEST(test_read_uu)
DEFINE_TEST(test_tar_filenames)
DEFINE_TEST(test_tar_large)
DEFINE_TEST(test_ustar_filenames)
DEFINE_TEST(test_write_compress)
+DEFINE_TEST(test_write_compress_bzip2)
+DEFINE_TEST(test_write_compress_gzip)
+DEFINE_TEST(test_write_compress_lzma)
DEFINE_TEST(test_write_compress_program)
+DEFINE_TEST(test_write_compress_xz)
DEFINE_TEST(test_write_disk)
+DEFINE_TEST(test_write_disk_failures)
DEFINE_TEST(test_write_disk_hardlink)
DEFINE_TEST(test_write_disk_perms)
DEFINE_TEST(test_write_disk_secure)
+DEFINE_TEST(test_write_disk_sparse)
+DEFINE_TEST(test_write_disk_symlink)
+DEFINE_TEST(test_write_disk_times)
DEFINE_TEST(test_write_format_ar)
DEFINE_TEST(test_write_format_cpio)
DEFINE_TEST(test_write_format_cpio_empty)
DEFINE_TEST(test_write_format_cpio_newc)
DEFINE_TEST(test_write_format_cpio_odc)
+DEFINE_TEST(test_write_format_mtree)
+DEFINE_TEST(test_write_format_pax)
DEFINE_TEST(test_write_format_shar_empty)
DEFINE_TEST(test_write_format_tar)
DEFINE_TEST(test_write_format_tar_empty)
DEFINE_TEST(test_write_format_tar_ustar)
+DEFINE_TEST(test_write_format_zip)
+DEFINE_TEST(test_write_format_zip_empty)
+DEFINE_TEST(test_write_format_zip_no_compression)
DEFINE_TEST(test_write_open_memory)
diff --git a/archivers/libarchive/files/libarchive/test/main.c b/archivers/libarchive/files/libarchive/test/main.c
index 83d3147d9f8..b143074d119 100644
--- a/archivers/libarchive/files/libarchive/test/main.c
+++ b/archivers/libarchive/files/libarchive/test/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Various utility routines useful for test programs.
- * Each test program is linked against this file.
- */
#include "test.h"
-
#include <errno.h>
#include <locale.h>
#include <stdarg.h>
@@ -38,354 +33,472 @@
* This same file is used pretty much verbatim for all test harnesses.
*
* The next few lines are the only differences.
+ * TODO: Move this into a separate configuration header, have all test
+ * suites share one copy of this file.
*/
-#undef PROGRAM /* Testing a library, not a program. */
+__FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z kientzle $");
+#define KNOWNREF "test_compat_gtar_1.tar.uu"
#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */
+#undef PROGRAM /* Testing a library, not a program. */
+#define LIBRARY "libarchive"
#define EXTRA_DUMP(x) archive_error_string((struct archive *)(x))
#define EXTRA_VERSION archive_version()
-__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.13 2008/06/15 10:35:22 kientzle Exp $");
/*
- * "list.h" is simply created by "grep DEFINE_TEST"; it has
- * a line like
- * DEFINE_TEST(test_function)
- * for each test.
- * Include it here with a suitable DEFINE_TEST to declare all of the
- * test functions.
+ *
+ * Windows support routines
+ *
+ * Note: Configuration is a tricky issue. Using HAVE_* feature macros
+ * in the test harness is dangerous because they cover up
+ * configuration errors. The classic example of this is omitting a
+ * configure check. If libarchive and libarchive_test both look for
+ * the same feature macro, such errors are hard to detect. Platform
+ * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
+ * easily lead to very messy code. It's best to limit yourself
+ * to only the most generic programming techniques in the test harness
+ * and thus avoid conditionals altogether. Where that's not possible,
+ * try to minimize conditionals by grouping platform-specific tests in
+ * one place (e.g., test_acl_freebsd) or by adding new assert()
+ * functions (e.g., assertMakeHardlink()) to cover up platform
+ * differences. Platform-specific coding in libarchive_test is often
+ * a symptom that some capability is missing from libarchive itself.
*/
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void);
-#include "list.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <io.h>
+#include <windows.h>
+#ifndef F_OK
+#define F_OK (0)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) ((m) & _S_IFDIR)
+#endif
+#ifndef S_ISREG
+#define S_ISREG(m) ((m) & _S_IFREG)
+#endif
+#if !defined(__BORLANDC__)
+#define access _access
+#define chdir _chdir
+#endif
+#ifndef fileno
+#define fileno _fileno
+#endif
+/*#define fstat _fstat64*/
+#if !defined(__BORLANDC__)
+#define getcwd _getcwd
+#endif
+#define lstat stat
+/*#define lstat _stat64*/
+/*#define stat _stat64*/
+#define rmdir _rmdir
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#define umask _umask
+#endif
+#define int64_t __int64
+#endif
+
+#if defined(HAVE__CrtSetReportMode)
+# include <crtdbg.h>
+#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+void *GetFunctionKernel32(const char *name)
+{
+ static HINSTANCE lib;
+ static int set;
+ if (!set) {
+ set = 1;
+ lib = LoadLibrary("kernel32.dll");
+ }
+ if (lib == NULL) {
+ fprintf(stderr, "Can't load kernel32.dll?!\n");
+ exit(1);
+ }
+ return (void *)GetProcAddress(lib, name);
+}
+
+static int
+my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateSymbolicLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, flags);
+}
+
+static int
+my_CreateHardLinkA(const char *linkname, const char *target)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateHardLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, NULL);
+}
+
+int
+my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
+{
+ HANDLE h;
+ int r;
+
+ memset(bhfi, 0, sizeof(*bhfi));
+ h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE)
+ return (0);
+ r = GetFileInformationByHandle(h, bhfi);
+ CloseHandle(h);
+ return (r);
+}
+#endif
-/* Interix doesn't define these in a standard header. */
-#if __INTERIX__
-extern char *optarg;
-extern int optind;
+#if defined(HAVE__CrtSetReportMode)
+static void
+invalid_parameter_handler(const wchar_t * expression,
+ const wchar_t * function, const wchar_t * file,
+ unsigned int line, uintptr_t pReserved)
+{
+ /* nop */
+}
#endif
+/*
+ *
+ * OPTIONS FLAGS
+ *
+ */
+
/* Enable core dump on failure. */
static int dump_on_failure = 0;
-/* Default is to remove temp dirs for successful tests. */
+/* Default is to remove temp dirs and log data for successful tests. */
static int keep_temp_files = 0;
-/* Default is to print some basic information about each test. */
-static int quiet_flag = 0;
-/* Default is to summarize repeated failures. */
-static int verbose = 0;
-/* Cumulative count of component failures. */
+/* Default is to just report pass/fail for each test. */
+static int verbosity = 0;
+#define VERBOSITY_SUMMARY_ONLY -1 /* -q */
+#define VERBOSITY_PASSFAIL 0 /* Default */
+#define VERBOSITY_LIGHT_REPORT 1 /* -v */
+#define VERBOSITY_FULL 2 /* -vv */
+/* A few places generate even more output for verbosity > VERBOSITY_FULL,
+ * mostly for debugging the test harness itself. */
+/* Cumulative count of assertion failures. */
static int failures = 0;
-/* Cumulative count of skipped component tests. */
+/* Cumulative count of reported skips. */
static int skips = 0;
-/* Cumulative count of assertions. */
+/* Cumulative count of assertions checked. */
static int assertions = 0;
/* Directory where uuencoded reference files can be found. */
-static char *refdir;
-
-/*
- * My own implementation of the standard assert() macro emits the
- * message in the same format as GCC (file:line: message).
- * It also includes some additional useful information.
- * This makes it a lot easier to skim through test failures in
- * Emacs. ;-)
- *
- * It also supports a few special features specifically to simplify
- * test harnesses:
- * failure(fmt, args) -- Stores a text string that gets
- * printed if the following assertion fails, good for
- * explaining subtle tests.
- */
-static char msg[4096];
-
-/*
- * For each test source file, we remember how many times each
- * failure was reported.
- */
-static const char *failed_filename = NULL;
-static struct line {
- int line;
- int count;
-} failed_lines[1000];
+static const char *refdir;
/*
- * Count this failure; return the number of previous failures.
+ * Report log information selectively to console and/or disk log.
*/
-static int
-previous_failures(const char *filename, int line)
+static int log_console = 0;
+static FILE *logfile;
+static void
+vlogprintf(const char *fmt, va_list ap)
{
- unsigned int i;
- int count;
+#ifdef va_copy
+ va_list lfap;
+ va_copy(lfap, ap);
+#endif
+ if (log_console)
+ vfprintf(stdout, fmt, ap);
+ if (logfile != NULL)
+#ifdef va_copy
+ vfprintf(logfile, fmt, lfap);
+ va_end(lfap);
+#else
+ vfprintf(logfile, fmt, ap);
+#endif
+}
- if (failed_filename == NULL || strcmp(failed_filename, filename) != 0)
- memset(failed_lines, 0, sizeof(failed_lines));
- failed_filename = filename;
+static void
+logprintf(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vlogprintf(fmt, ap);
+ va_end(ap);
+}
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == line) {
- count = failed_lines[i].count;
- failed_lines[i].count++;
- return (count);
- }
- if (failed_lines[i].line == 0) {
- failed_lines[i].line = line;
- failed_lines[i].count = 1;
- return (0);
- }
- }
- return (0);
+/* Set up a message to display only if next assertion fails. */
+static char msgbuff[4096];
+static const char *msg, *nextmsg;
+void
+failure(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vsprintf(msgbuff, fmt, ap);
+ va_end(ap);
+ nextmsg = msgbuff;
}
/*
* Copy arguments into file-local variables.
+ * This was added to permit vararg assert() functions without needing
+ * variadic wrapper macros. Turns out that the vararg capability is almost
+ * never used, so almost all of the vararg assertions can be simplified
+ * by removing the vararg capability and reworking the wrapper macro to
+ * pass __FILE__, __LINE__ directly into the function instead of using
+ * this hook. I suspect this machinery is used so rarely that we
+ * would be better off just removing it entirely. That would simplify
+ * the code here noticably.
*/
static const char *test_filename;
static int test_line;
static void *test_extra;
-void test_setup(const char *filename, int line)
+void assertion_setup(const char *filename, int line)
{
test_filename = filename;
test_line = line;
}
+/* Called at the beginning of each assert() function. */
+static void
+assertion_count(const char *file, int line)
+{
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ ++assertions;
+ /* Proper handling of "failure()" message. */
+ msg = nextmsg;
+ nextmsg = NULL;
+ /* Uncomment to print file:line after every assertion.
+ * Verbose, but occasionally useful in tracking down crashes. */
+ /* printf("Checked %s:%d\n", file, line); */
+}
+
/*
- * Inform user that we're skipping a test.
+ * For each test source file, we remember how many times each
+ * assertion was reported. Cleared before each new test,
+ * used by test_summarize().
*/
-void
-test_skipping(const char *fmt, ...)
+static struct line {
+ int count;
+ int skip;
+} failed_lines[10000];
+
+/* Count this failure, setup up log destination and handle initial report. */
+static void
+failure_start(const char *filename, int line, const char *fmt, ...)
{
va_list ap;
- if (previous_failures(test_filename, test_line))
- return;
+ /* Record another failure for this line. */
+ ++failures;
+ /* test_filename = filename; */
+ failed_lines[line].count++;
+
+ /* Determine whether to log header to console. */
+ switch (verbosity) {
+ case VERBOSITY_LIGHT_REPORT:
+ log_console = (failed_lines[line].count < 2);
+ break;
+ default:
+ log_console = (verbosity >= VERBOSITY_FULL);
+ }
+ /* Log file:line header for this failure */
va_start(ap, fmt);
- fprintf(stderr, " *** SKIPPING: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
+#if _MSC_VER
+ logprintf("%s(%d): ", filename, line);
+#else
+ logprintf("%s:%d: ", filename, line);
+#endif
+ vlogprintf(fmt, ap);
va_end(ap);
- ++skips;
+ logprintf("\n");
+
+ if (msg != NULL && msg[0] != '\0') {
+ logprintf(" Description: %s\n", msg);
+ msg = NULL;
+ }
+
+ /* Determine whether to log details to console. */
+ if (verbosity == VERBOSITY_LIGHT_REPORT)
+ log_console = 0;
}
-/* Common handling of failed tests. */
+/* Complete reporting of failed tests. */
+/*
+ * The 'extra' hook here is used by libarchive to include libarchive
+ * error messages with assertion failures. It could also be used
+ * to add strerror() output, for example. Just define the EXTRA_DUMP()
+ * macro appropriately.
+ */
static void
-report_failure(void *extra)
+failure_finish(void *extra)
{
- if (msg[0] != '\0') {
- fprintf(stderr, " Description: %s\n", msg);
- msg[0] = '\0';
- }
-
+ (void)extra; /* UNUSED (maybe) */
#ifdef EXTRA_DUMP
if (extra != NULL)
- fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra));
-#else
- (void)extra; /* UNUSED */
+ logprintf(" detail: %s\n", EXTRA_DUMP(extra));
#endif
if (dump_on_failure) {
fprintf(stderr,
" *** forcing core dump so failure can be debugged ***\n");
- *(char *)(NULL) = 0;
+ abort();
exit(1);
}
}
-/*
- * Summarize repeated failures in the just-completed test file.
- * The reports above suppress multiple failures from the same source
- * line; this reports on any tests that did fail multiple times.
- */
-static int
-summarize_comparator(const void *a0, const void *b0)
-{
- const struct line *a = a0, *b = b0;
- if (a->line == 0 && b->line == 0)
- return (0);
- if (a->line == 0)
- return (1);
- if (b->line == 0)
- return (-1);
- return (a->line - b->line);
-}
-
-static void
-summarize(void)
-{
- unsigned int i;
-
- qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]),
- sizeof(failed_lines[0]), summarize_comparator);
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == 0)
- break;
- if (failed_lines[i].count > 1)
- fprintf(stderr, "%s:%d: Failed %d times\n",
- failed_filename, failed_lines[i].line,
- failed_lines[i].count);
- }
- /* Clear the failure history for the next file. */
- memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/* Set up a message to display only after a test fails. */
+/* Inform user that we're skipping some checks. */
void
-failure(const char *fmt, ...)
+test_skipping(const char *fmt, ...)
{
+ char buff[1024];
va_list ap;
+
va_start(ap, fmt);
- vsprintf(msg, fmt, ap);
+ vsprintf(buff, fmt, ap);
va_end(ap);
+ /* failure_start() isn't quite right, but is awfully convenient. */
+ failure_start(test_filename, test_line, "SKIPPING: %s", buff);
+ --failures; /* Undo failures++ in failure_start() */
+ /* Don't failure_finish() here. */
+ /* Mark as skip, so doesn't count as failed test. */
+ failed_lines[test_line].skip = 1;
+ ++skips;
}
+/*
+ *
+ * ASSERTIONS
+ *
+ */
+
/* Generic assert() just displays the failed condition. */
int
-test_assert(const char *file, int line, int value, const char *condition, void *extra)
+assertion_assert(const char *file, int line, int value,
+ const char *condition, void *extra)
{
- ++assertions;
- if (value) {
- msg[0] = '\0';
- return (value);
+ assertion_count(file, line);
+ if (!value) {
+ failure_start(file, line, "Assertion failed: %s", condition);
+ failure_finish(extra);
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (value);
- fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
- fprintf(stderr, " Condition: %s\n", condition);
- report_failure(extra);
return (value);
}
-/* assertEqualInt() displays the values of the two integers. */
+/* chdir() and report any errors */
int
-test_assert_equal_int(const char *file, int line,
- int v1, const char *e1, int v2, const char *e2, void *extra)
+assertion_chdir(const char *file, int line, const char *pathname)
{
- ++assertions;
- if (v1 == v2) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (chdir(pathname) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
- file, line);
- fprintf(stderr, " %s=%d\n", e1, v1);
- fprintf(stderr, " %s=%d\n", e2, v2);
- report_failure(extra);
+ failure_start(file, line, "chdir(\"%s\")", pathname);
+ failure_finish(NULL);
+ return (0);
+
+}
+
+/* Verify two integers are equal. */
+int
+assertion_equal_int(const char *file, int line,
+ long long v1, const char *e1, long long v2, const char *e2, void *extra)
+{
+ assertion_count(file, line);
+ if (v1 == v2)
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
+ failure_finish(extra);
return (0);
}
-static void strdump(const char *p)
+static void strdump(const char *e, const char *p)
{
+ const char *q = p;
+
+ logprintf(" %s = ", e);
if (p == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("NULL");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*p != '\0') {
unsigned int c = 0xff & *p++;
switch (c) {
- case '\a': fprintf(stderr, "\a"); break;
- case '\b': fprintf(stderr, "\b"); break;
- case '\n': fprintf(stderr, "\n"); break;
- case '\r': fprintf(stderr, "\r"); break;
+ case '\a': printf("\a"); break;
+ case '\b': printf("\b"); break;
+ case '\n': printf("\n"); break;
+ case '\r': printf("\r"); break;
default:
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
}
}
- fprintf(stderr, "\"");
+ logprintf("\"");
+ logprintf(" (length %d)\n", q == NULL ? -1 : (int)strlen(q));
}
-/* assertEqualString() displays the values of the two strings. */
+/* Verify two strings are equal, dump them if not. */
int
-test_assert_equal_string(const char *file, int line,
+assertion_equal_string(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (strcmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- strdump(v1);
- fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1));
- fprintf(stderr, " %s = ", e2);
- strdump(v2);
- fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2));
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ strdump(e1, v1);
+ strdump(e2, v2);
+ failure_finish(extra);
return (0);
}
-static void wcsdump(const wchar_t *w)
+static void
+wcsdump(const char *e, const wchar_t *w)
{
+ logprintf(" %s = ", e);
if (w == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("(null)");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*w != L'\0') {
unsigned int c = *w++;
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else if (c < 256)
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
else if (c < 0x10000)
- fprintf(stderr, "\\u%04X", c);
+ logprintf("\\u%04X", c);
else
- fprintf(stderr, "\\U%08X", c);
+ logprintf("\\U%08X", c);
}
- fprintf(stderr, "\"");
+ logprintf("\"\n");
}
-/* assertEqualWString() displays the values of the two strings. */
+/* Verify that two wide strings are equal, dump them if not. */
int
-test_assert_equal_wstring(const char *file, int line,
+assertion_equal_wstring(const char *file, int line,
const wchar_t *v1, const char *e1,
const wchar_t *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL) {
- if (v2 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (v2 == NULL) {
- if (v1 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (wcscmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || wcscmp(v1, v2) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- wcsdump(v1);
- fprintf(stderr, "\n");
- fprintf(stderr, " %s = ", e2);
- wcsdump(v2);
- fprintf(stderr, "\n");
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ wcsdump(e1, v1);
+ wcsdump(e2, v2);
+ failure_finish(extra);
return (0);
}
@@ -400,226 +513,950 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset)
size_t i, j;
char sep;
+ if (p == NULL) {
+ logprintf("(null)\n");
+ return;
+ }
for(i=0; i < l; i+=16) {
- fprintf(stderr, "%04x", i + offset);
+ logprintf("%04x", (unsigned)(i + offset));
sep = ' ';
for (j = 0; j < 16 && i + j < l; j++) {
if (ref != NULL && p[i + j] != ref[i + j])
sep = '_';
- fprintf(stderr, "%c%02x", sep, 0xff & (int)p[i+j]);
+ logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
if (ref != NULL && p[i + j] == ref[i + j])
sep = ' ';
}
for (; j < 16; j++) {
- fprintf(stderr, "%c ", sep);
+ logprintf("%c ", sep);
sep = ' ';
}
- fprintf(stderr, "%c", sep);
+ logprintf("%c", sep);
for (j=0; j < 16 && i + j < l; j++) {
int c = p[i + j];
if (c >= ' ' && c <= 126)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, ".");
+ logprintf(".");
}
- fprintf(stderr, "\n");
+ logprintf("\n");
}
}
-/* assertEqualMem() displays the values of the two memory blocks. */
-/* TODO: For long blocks, hexdump the first bytes that actually differ. */
+/* Verify that two blocks of memory are the same, display the first
+ * block of differences if they're not. */
int
-test_assert_equal_mem(const char *file, int line,
- const char *v1, const char *e1,
- const char *v2, const char *e2,
+assertion_equal_mem(const char *file, int line,
+ const void *_v1, const char *e1,
+ const void *_v2, const char *e2,
size_t l, const char *ld, void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (memcmp(v1, v2, l) == 0) {
- msg[0] = '\0';
+ const char *v1 = (const char *)_v1;
+ const char *v2 = (const char *)_v2;
+ size_t offset;
+
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
return (1);
+
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" size %s = %d\n", ld, (int)l);
+ /* Dump 48 bytes (3 lines) so that the first difference is
+ * in the second line. */
+ offset = 0;
+ while (l > 64 && memcmp(v1, v2, 32) == 0) {
+ /* Two lines agree, so step forward one line. */
+ v1 += 16;
+ v2 += 16;
+ l -= 16;
+ offset += 16;
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
- file, line);
- fprintf(stderr, " size %s = %d\n", ld, (int)l);
- fprintf(stderr, " Dump of %s\n", e1);
- hexdump(v1, v2, l < 32 ? l : 32, 0);
- fprintf(stderr, " Dump of %s\n", e2);
- hexdump(v2, v1, l < 32 ? l : 32, 0);
- fprintf(stderr, "\n");
- report_failure(extra);
+ logprintf(" Dump of %s\n", e1);
+ hexdump(v1, v2, l < 64 ? l : 64, offset);
+ logprintf(" Dump of %s\n", e2);
+ hexdump(v2, v1, l < 64 ? l : 64, offset);
+ logprintf("\n");
+ failure_finish(extra);
return (0);
}
+/* Verify that the named file exists and is empty. */
int
-test_assert_empty_file(const char *f1fmt, ...)
+assertion_empty_file(const char *f1fmt, ...)
{
char buff[1024];
char f1[1024];
struct stat st;
va_list ap;
ssize_t s;
- int fd;
-
+ FILE *f;
+ assertion_count(test_filename, test_line);
va_start(ap, f1fmt);
vsprintf(f1, f1fmt, ap);
va_end(ap);
if (stat(f1, &st) != 0) {
- fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
- report_failure(NULL);
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
return (0);
}
if (st.st_size == 0)
return (1);
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
-
- fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
- fprintf(stderr, " File size: %d\n", (int)st.st_size);
- fprintf(stderr, " Contents:\n");
- fd = open(f1, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, " Unable to open %s\n", f1);
+ failure_start(test_filename, test_line, "File should be empty: %s", f1);
+ logprintf(" File size: %d\n", (int)st.st_size);
+ logprintf(" Contents:\n");
+ f = fopen(f1, "rb");
+ if (f == NULL) {
+ logprintf(" Unable to open %s\n", f1);
} else {
- s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
- s = read(fd, buff, s);
+ s = ((off_t)sizeof(buff) < st.st_size) ?
+ (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
+ s = fread(buff, 1, s, f);
hexdump(buff, NULL, s, 0);
+ fclose(f);
}
- report_failure(NULL);
+ failure_finish(NULL);
return (0);
}
-/* assertEqualFile() asserts that two files have the same contents. */
+/* Verify that the named file exists and is not empty. */
+int
+assertion_non_empty_file(const char *f1fmt, ...)
+{
+ char f1[1024];
+ struct stat st;
+ va_list ap;
+
+ assertion_count(test_filename, test_line);
+ va_start(ap, f1fmt);
+ vsprintf(f1, f1fmt, ap);
+ va_end(ap);
+
+ if (stat(f1, &st) != 0) {
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (st.st_size == 0) {
+ failure_start(test_filename, test_line, "File empty: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify that two files have the same contents. */
/* TODO: hexdump the first bytes that actually differ. */
int
-test_assert_equal_file(const char *f1, const char *f2pattern, ...)
+assertion_equal_file(const char *fn1, const char *f2pattern, ...)
{
- char f2[1024];
+ char fn2[1024];
va_list ap;
char buff1[1024];
char buff2[1024];
- int fd1, fd2;
+ FILE *f1, *f2;
int n1, n2;
+ assertion_count(test_filename, test_line);
va_start(ap, f2pattern);
- vsprintf(f2, f2pattern, ap);
+ vsprintf(fn2, f2pattern, ap);
va_end(ap);
- fd1 = open(f1, O_RDONLY);
- fd2 = open(f2, O_RDONLY);
+ f1 = fopen(fn1, "rb");
+ f2 = fopen(fn2, "rb");
for (;;) {
- n1 = read(fd1, buff1, sizeof(buff1));
- n2 = read(fd2, buff2, sizeof(buff2));
+ n1 = fread(buff1, 1, sizeof(buff1), f1);
+ n2 = fread(buff2, 1, sizeof(buff2), f2);
if (n1 != n2)
break;
- if (n1 == 0 && n2 == 0)
+ if (n1 == 0 && n2 == 0) {
+ fclose(f1);
+ fclose(f2);
return (1);
+ }
if (memcmp(buff1, buff2, n1) != 0)
break;
}
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
- fprintf(stderr, "%s:%d: Files are not identical\n",
- test_filename, test_line);
- fprintf(stderr, " file1=\"%s\"\n", f1);
- fprintf(stderr, " file2=\"%s\"\n", f2);
- report_failure(test_extra);
+ fclose(f1);
+ fclose(f2);
+ failure_start(test_filename, test_line, "Files not identical");
+ logprintf(" file1=\"%s\"\n", fn1);
+ logprintf(" file2=\"%s\"\n", fn2);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file does exist. */
int
-test_assert_file_exists(const char *fpattern, ...)
+assertion_file_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!_access(f, 0))
+ return (1);
+#else
if (!access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File doesn't exist\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file doesn't exist. */
int
-test_assert_file_not_exists(const char *fpattern, ...)
+assertion_file_not_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (_access(f, 0))
+ return (1);
+#else
if (access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File exists and shouldn't\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should not exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
-/* assertFileContents() asserts the contents of a file. */
+/* Compare the contents of a file to a block of memory. */
int
-test_assert_file_contents(const void *buff, int s, const char *fpattern, ...)
+assertion_file_contents(const void *buff, int s, const char *fpattern, ...)
{
- char f[1024];
+ char fn[1024];
va_list ap;
char *contents;
- int fd;
+ FILE *f;
int n;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
- vsprintf(f, fpattern, ap);
+ vsprintf(fn, fpattern, ap);
va_end(ap);
- fd = open(f, O_RDONLY);
+ f = fopen(fn, "rb");
+ if (f == NULL) {
+ failure_start(test_filename, test_line,
+ "File should exist: %s", fn);
+ failure_finish(test_extra);
+ return (0);
+ }
contents = malloc(s * 2);
- n = read(fd, contents, s * 2);
+ n = fread(contents, 1, s * 2, f);
+ fclose(f);
if (n == s && memcmp(buff, contents, s) == 0) {
free(contents);
return (1);
}
- failures ++;
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File contents don't match\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- if (n > 0)
- hexdump(contents, buff, n, 0);
- else {
- fprintf(stderr, " File empty, contents should be:\n");
- hexdump(buff, NULL, s, 0);
+ failure_start(test_filename, test_line, "File contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n > 512 ? 512 : n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s > 512 ? 512 : n, 0);
+ }
+ failure_finish(test_extra);
+ free(contents);
+ return (0);
+}
+
+/* Check the contents of a text file, being tolerant of line endings. */
+int
+assertion_text_file_contents(const char *buff, const char *fn)
+{
+ char *contents;
+ const char *btxt, *ftxt;
+ FILE *f;
+ int n, s;
+
+ assertion_count(test_filename, test_line);
+ f = fopen(fn, "r");
+ s = strlen(buff);
+ contents = malloc(s * 2 + 128);
+ n = fread(contents, 1, s * 2 + 128 - 1, f);
+ if (n >= 0)
+ contents[n] = '\0';
+ fclose(f);
+ /* Compare texts. */
+ btxt = buff;
+ ftxt = (const char *)contents;
+ while (*btxt != '\0' && *ftxt != '\0') {
+ if (*btxt == *ftxt) {
+ ++btxt;
+ ++ftxt;
+ continue;
}
- report_failure(test_extra);
+ if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
+ /* Pass over different new line characters. */
+ ++btxt;
+ ftxt += 2;
+ continue;
+ }
+ break;
+ }
+ if (*btxt == '\0' && *ftxt == '\0') {
+ free(contents);
+ return (1);
}
+ failure_start(test_filename, test_line, "Contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s, 0);
+ }
+ failure_finish(test_extra);
free(contents);
return (0);
}
+/* Test that two paths point to the same file. */
+/* As a side-effect, asserts that both files exist. */
+static int
+is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(path1, &bhfi1);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = my_GetFileInformationByName(path2, &bhfi2);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
+ && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
+ && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
+#else
+ struct stat st1, st2;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(path1, &st1);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = lstat(path2, &st2);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
+#endif
+}
+
+int
+assertion_is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s are not hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+int
+assertion_is_not_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (!is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s should not be hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify a/b/mtime of 'pathname'. */
+/* If 'recent', verify that it's within last 10 seconds. */
+static int
+assertion_file_time(const char *file, int line,
+ const char *pathname, long t, long nsec, char type, int recent)
+{
+ long long filet, filet_nsec;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define EPOC_TIME (116444736000000000ULL)
+ FILETIME ftime, fbirthtime, fatime, fmtime;
+ ULARGE_INTEGER wintm;
+ HANDLE h;
+ ftime.dwLowDateTime = 0;
+ ftime.dwHighDateTime = 0;
+
+ assertion_count(file, line);
+ h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ failure_start(file, line, "Can't access %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
+ switch (type) {
+ case 'a': ftime = fatime; break;
+ case 'b': ftime = fbirthtime; break;
+ case 'm': ftime = fmtime; break;
+ }
+ CloseHandle(h);
+ if (r == 0) {
+ failure_start(file, line, "Can't GetFileTime %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ wintm.LowPart = ftime.dwLowDateTime;
+ wintm.HighPart = ftime.dwHighDateTime;
+ filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
+ filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
+ nsec = (nsec / 100) * 100; /* Round the request */
+#else
+ struct stat st;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Can't stat %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ switch (type) {
+ case 'a': filet = st.st_atime; break;
+ case 'm': filet = st.st_mtime; break;
+ case 'b': filet = 0; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+#if defined(__FreeBSD__)
+ switch (type) {
+ case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
+ case 'b': filet = st.st_birthtime;
+ filet_nsec = st.st_birthtimespec.tv_nsec; break;
+ case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ filet_nsec = (filet_nsec / 1000) * 1000;
+ nsec = (nsec / 1000) * 1000;
+#else
+ filet_nsec = nsec = 0; /* Generic POSIX only has whole seconds. */
+ if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
+#if defined(__HAIKU__)
+ if (type == 'a') return (1); /* Haiku doesn't have atime. */
+#endif
+#endif
+#endif
+ if (recent) {
+ /* Check that requested time is up-to-date. */
+ time_t now = time(NULL);
+ if (filet < now - 10 || filet > now + 1) {
+ failure_start(file, line,
+ "File %s has %ctime %ld, %ld seconds ago\n",
+ pathname, type, filet, now - filet);
+ failure_finish(NULL);
+ return (0);
+ }
+ } else if (filet != t || filet_nsec != nsec) {
+ failure_start(file, line,
+ "File %s has %ctime %ld.%09ld, expected %ld.%09ld",
+ pathname, type, filet, filet_nsec, t, nsec);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify atime of 'pathname'. */
+int
+assertion_file_atime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
+}
+
+/* Verify atime of 'pathname' is up-to-date. */
+int
+assertion_file_atime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
+}
+
+/* Verify birthtime of 'pathname'. */
+int
+assertion_file_birthtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
+}
+
+/* Verify birthtime of 'pathname' is up-to-date. */
+int
+assertion_file_birthtime_recent(const char *file, int line,
+ const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
+}
+
+/* Verify mtime of 'pathname'. */
+int
+assertion_file_mtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
+}
+
+/* Verify mtime of 'pathname' is up-to-date. */
+int
+assertion_file_mtime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
+}
+
+/* Verify number of links to 'pathname'. */
+int
+assertion_file_nlinks(const char *file, int line,
+ const char *pathname, int nlinks)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(pathname, &bhfi);
+ if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, bhfi.nNumberOfLinks, nlinks);
+ failure_finish(NULL);
+ return (0);
+#else
+ struct stat st;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && st.st_nlink == nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, st.st_nlink, nlinks);
+ failure_finish(NULL);
+ return (0);
+#endif
+}
+
+/* Verify size of 'pathname'. */
+int
+assertion_file_size(const char *file, int line, const char *pathname, long size)
+{
+ int64_t filesize;
+ int r;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ {
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ r = !my_GetFileInformationByName(pathname, &bhfi);
+ filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
+ }
+#else
+ {
+ struct stat st;
+ r = lstat(pathname, &st);
+ filesize = st.st_size;
+ }
+#endif
+ if (r == 0 && filesize == size)
+ return (1);
+ failure_start(file, line, "File %s has size %ld, expected %ld",
+ pathname, (long)filesize, (long)size);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
+int
+assertion_is_dir(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Dir should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ failure_start(file, line, "%s is not a dir", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "Dir %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Verify that 'pathname' is a regular file. If 'mode' is >= 0,
+ * verify that too. */
+int
+assertion_is_reg(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0 || !S_ISREG(st.st_mode)) {
+ failure_start(file, line, "File should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "File %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Check whether 'pathname' is a symbolic link. If 'contents' is
+ * non-NULL, verify that the symlink has those contents. */
+static int
+is_symlink(const char *file, int line,
+ const char *pathname, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)pathname; /* UNUSED */
+ (void)contents; /* UNUSED */
+ assertion_count(file, line);
+ /* Windows sort-of has real symlinks, but they're only usable
+ * by privileged users and are crippled even then, so there's
+ * really not much point in bothering with this. */
+ return (0);
+#else
+ char buff[300];
+ struct stat st;
+ ssize_t linklen;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line,
+ "Symlink should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISLNK(st.st_mode))
+ return (0);
+ if (contents == NULL)
+ return (1);
+ linklen = readlink(pathname, buff, sizeof(buff));
+ if (linklen < 0) {
+ failure_start(file, line, "Can't read symlink %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ buff[linklen] = '\0';
+ if (strcmp(buff, contents) != 0)
+ return (0);
+ return (1);
+#endif
+}
+
+/* Assert that path is a symlink that (optionally) contains contents. */
+int
+assertion_is_symlink(const char *file, int line,
+ const char *path, const char *contents)
+{
+ if (is_symlink(file, line, path, contents))
+ return (1);
+ if (contents)
+ failure_start(file, line, "File %s is not a symlink to %s",
+ path, contents);
+ else
+ failure_start(file, line, "File %s is not a symlink", path);
+ failure_finish(NULL);
+ return (0);
+}
+
+
+/* Create a directory and report any errors. */
+int
+assertion_make_dir(const char *file, int line, const char *dirname, int mode)
+{
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+ if (0 == _mkdir(dirname))
+ return (1);
+#else
+ if (0 == mkdir(dirname, mode))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create directory %s", dirname);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a file with the specified contents and report any failures. */
+int
+assertion_make_file(const char *file, int line,
+ const char *path, int mode, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* TODO: Rework this to set file mode as well. */
+ FILE *f;
+ (void)mode; /* UNUSED */
+ assertion_count(file, line);
+ f = fopen(path, "wb");
+ if (f == NULL) {
+ failure_start(file, line, "Could not create file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if (strlen(contents)
+ != fwrite(contents, 1, strlen(contents), f)) {
+ fclose(f);
+ failure_start(file, line,
+ "Could not write file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ fclose(f);
+ return (1);
+#else
+ int fd;
+ assertion_count(file, line);
+ fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
+ if (fd < 0) {
+ failure_start(file, line, "Could not create %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if ((ssize_t)strlen(contents)
+ != write(fd, contents, strlen(contents))) {
+ close(fd);
+ failure_start(file, line, "Could not write to %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ close(fd);
+ return (1);
+#endif
+}
+
+/* Create a hardlink and report any failures. */
+int
+assertion_make_hardlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ succeeded = my_CreateHardLinkA(newpath, linkto);
+#elif HAVE_LINK
+ succeeded = !link(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded)
+ return (1);
+ failure_start(file, line, "Could not create hardlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a symlink and report any failures. */
+int
+assertion_make_symlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ int targetIsDir = 0; /* TODO: Fix this */
+ assertion_count(file, line);
+ if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
+ return (1);
+#elif HAVE_SYMLINK
+ assertion_count(file, line);
+ if (0 == symlink(linkto, newpath))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create symlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Set umask, report failures. */
+int
+assertion_umask(const char *file, int line, int mask)
+{
+ assertion_count(file, line);
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ umask(mask);
+ return (1);
+}
+
+/*
+ *
+ * UTILITIES for use by tests.
+ *
+ */
+
+/*
+ * Check whether platform supports symlinks. This is intended
+ * for tests to use in deciding whether to bother testing symlink
+ * support; if the platform doesn't support symlinks, there's no point
+ * in checking whether the program being tested can create them.
+ *
+ * Note that the first time this test is called, we actually go out to
+ * disk to create and verify a symlink. This is necessary because
+ * symlink support is actually a property of a particular filesystem
+ * and can thus vary between directories on a single system. After
+ * the first call, this returns the cached result from memory, so it's
+ * safe to call it as often as you wish.
+ */
+int
+canSymlink(void)
+{
+ /* Remember the test result */
+ static int value = 0, tested = 0;
+ if (tested)
+ return (value);
+
+ ++tested;
+ assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, "a");
+ /* Note: Cygwin has its own symlink() emulation that does not
+ * use the Win32 CreateSymbolicLink() function. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
+#elif HAVE_SYMLINK
+ value = (0 == symlink("canSymlink.0", "canSymlink.1"))
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
+#endif
+ return (value);
+}
+
+/*
+ * Can this platform run the gzip program?
+ */
+/* Platform-dependent options for hiding the output of a subcommand. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
+#else
+static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
+#endif
+int
+canGzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the gunzip program?
+ */
+int
+canGunzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gunzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Sleep as needed; useful for verifying disk timestamp changes by
+ * ensuring that the wall-clock time has actually changed before we
+ * go back to re-read something from disk.
+ */
+void
+sleepUntilAfter(time_t t)
+{
+ while (t >= time(NULL))
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ Sleep(500);
+#else
+ sleep(1);
+#endif
+}
+
/*
* Call standard system() call, but build up the command line using
* sprintf() conventions.
@@ -633,6 +1470,8 @@ systemf(const char *fmt, ...)
va_start(ap, fmt);
vsprintf(buff, fmt, ap);
+ if (verbosity > VERBOSITY_FULL)
+ logprintf("Cmd: %s\n", buff);
r = system(buff);
va_end(ap);
return (r);
@@ -651,112 +1490,263 @@ slurpfile(size_t * sizep, const char *fmt, ...)
va_list ap;
char *p;
ssize_t bytes_read;
- int fd;
+ FILE *f;
int r;
va_start(ap, fmt);
vsprintf(filename, fmt, ap);
va_end(ap);
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
+ f = fopen(filename, "rb");
+ if (f == NULL) {
/* Note: No error; non-existent file is okay here. */
return (NULL);
}
- r = fstat(fd, &st);
+ r = fstat(fileno(f), &st);
if (r != 0) {
- fprintf(stderr, "Can't stat file %s\n", filename);
- close(fd);
+ logprintf("Can't stat file %s\n", filename);
+ fclose(f);
return (NULL);
}
- p = malloc(st.st_size + 1);
+ p = malloc((size_t)st.st_size + 1);
if (p == NULL) {
- fprintf(stderr, "Can't allocate %ld bytes of memory to read file %s\n", (long int)st.st_size, filename);
- close(fd);
+ logprintf("Can't allocate %ld bytes of memory to read file %s\n",
+ (long int)st.st_size, filename);
+ fclose(f);
return (NULL);
}
- bytes_read = read(fd, p, st.st_size);
+ bytes_read = fread(p, 1, (size_t)st.st_size, f);
if (bytes_read < st.st_size) {
- fprintf(stderr, "Can't read file %s\n", filename);
- close(fd);
+ logprintf("Can't read file %s\n", filename);
+ fclose(f);
free(p);
return (NULL);
}
p[st.st_size] = '\0';
if (sizep != NULL)
*sizep = (size_t)st.st_size;
- close(fd);
+ fclose(f);
return (p);
}
+/* Read a uuencoded file from the reference directory, decode, and
+ * write the result into the current directory. */
+#define UUDECODE(c) (((c) - 0x20) & 0x3f)
+void
+extract_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+
+ sprintf(buff, "%s/%s.uu", refdir, name);
+ in = fopen(buff, "r");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Read up to and including the 'begin' line. */
+ for (;;) {
+ if (fgets(buff, sizeof(buff), in) == NULL) {
+ /* TODO: This is a failure. */
+ return;
+ }
+ if (memcmp(buff, "begin ", 6) == 0)
+ break;
+ }
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while (fgets(buff, sizeof(buff), in) != NULL) {
+ char *p = buff;
+ int bytes;
+
+ if (memcmp(buff, "end", 3) == 0)
+ break;
+
+ bytes = UUDECODE(*p++);
+ while (bytes > 0) {
+ int n = 0;
+ /* Write out 1-3 bytes from that. */
+ if (bytes > 0) {
+ n = UUDECODE(*p++) << 18;
+ n |= UUDECODE(*p++) << 12;
+ fputc(n >> 16, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++) << 6;
+ fputc((n >> 8) & 0xFF, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++);
+ fputc(n & 0xFF, out);
+ --bytes;
+ }
+ }
+ }
+ fclose(out);
+ fclose(in);
+}
+
/*
- * "list.h" is automatically generated; it just has a lot of lines like:
- * DEFINE_TEST(function_name)
- * It's used above to declare all of the test functions.
- * We reuse it here to define a list of all tests (functions and names).
+ *
+ * TEST management
+ *
+ */
+
+/*
+ * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
+ * a line like
+ * DEFINE_TEST(test_function)
+ * for each test.
*/
+
+/* Use "list.h" to declare all of the test functions. */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void);
+#include "list.h"
+
+/* Use "list.h" to create a list of all tests (functions and names). */
#undef DEFINE_TEST
-#define DEFINE_TEST(n) { n, #n },
-struct { void (*func)(void); const char *name; } tests[] = {
+#define DEFINE_TEST(n) { n, #n, 0 },
+struct { void (*func)(void); const char *name; int failures; } tests[] = {
#include "list.h"
};
/*
- * Each test is run in a private work dir. Those work dirs
- * do have consistent and predictable names, in case a group
- * of tests need to collaborate. However, there is no provision
- * for requiring that tests run in a certain order.
+ * Summarize repeated failures in the just-completed test.
*/
-static int test_run(int i, const char *tmpdir)
+static void
+test_summarize(const char *filename, int failed)
{
- int failures_before = failures;
+ unsigned int i;
- if (!quiet_flag) {
- printf("%d: %s\n", i, tests[i].name);
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY:
+ printf(failed ? "E" : ".");
fflush(stdout);
+ break;
+ case VERBOSITY_PASSFAIL:
+ printf(failed ? "FAIL\n" : "ok\n");
+ break;
}
- /*
- * Always explicitly chdir() in case the last test moved us to
- * a strange place.
- */
- if (chdir(tmpdir)) {
- fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir %s\n",
- tmpdir);
- exit(1);
+ log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
+
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].count > 1 && !failed_lines[i].skip)
+ logprintf("%s:%d: Summary: Failed %d times\n",
+ filename, i, failed_lines[i].count);
+ }
+ /* Clear the failure history for the next file. */
+ memset(failed_lines, 0, sizeof(failed_lines));
+}
+
+/*
+ * Actually run a single test, with appropriate setup and cleanup.
+ */
+static int
+test_run(int i, const char *tmpdir)
+{
+ char logfilename[64];
+ int failures_before = failures;
+ int oldumask;
+
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
+ break;
+ case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
+ printf("%3d: %-50s", i, tests[i].name);
+ fflush(stdout);
+ break;
+ default: /* Title of test, details will follow */
+ printf("%3d: %s\n", i, tests[i].name);
}
- /* Create a temp directory for this specific test. */
- if (mkdir(tests[i].name, 0755)) {
+
+ /* Chdir to the top-level work directory. */
+ if (!assertChdir(tmpdir)) {
fprintf(stderr,
- "ERROR: Couldn't create temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to top work dir %s\n", tmpdir);
exit(1);
}
- /* Chdir() to that work directory. */
- if (chdir(tests[i].name)) {
+ /* Create a log file for this test. */
+ sprintf(logfilename, "%s.log", tests[i].name);
+ logfile = fopen(logfilename, "w");
+ fprintf(logfile, "%s\n\n", tests[i].name);
+ /* Chdir() to a work dir for this specific test. */
+ if (!assertMakeDir(tests[i].name, 0755)
+ || !assertChdir(tests[i].name)) {
fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to work dir %s/%s\n",
+ tmpdir, tests[i].name);
exit(1);
}
/* Explicitly reset the locale before each test. */
setlocale(LC_ALL, "C");
- /* Run the actual test. */
+ /* Record the umask before we run the test. */
+ umask(oldumask = umask(0));
+ /*
+ * Run the actual test.
+ */
(*tests[i].func)();
- /* Summarize the results of this test. */
- summarize();
- /* If there were no failures, we can remove the work dir. */
- if (failures == failures_before) {
- if (!keep_temp_files && chdir(tmpdir) == 0) {
+ /*
+ * Clean up and report afterwards.
+ */
+ /* Restore umask */
+ umask(oldumask);
+ /* Reset locale. */
+ setlocale(LC_ALL, "C");
+ /* Reset directory. */
+ if (!assertChdir(tmpdir)) {
+ fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
+ tmpdir);
+ exit(1);
+ }
+ /* Report per-test summaries. */
+ tests[i].failures = failures - failures_before;
+ test_summarize(test_filename, tests[i].failures);
+ /* Close the per-test log file. */
+ fclose(logfile);
+ logfile = NULL;
+ /* If there were no failures, we can remove the work dir and logfile. */
+ if (tests[i].failures == 0) {
+ if (!keep_temp_files && assertChdir(tmpdir)) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Make sure not to leave empty directories.
+ * Sometimes a processing of closing files used by tests
+ * is not done, then rmdir will be failed and it will
+ * leave a empty test directory. So we should wait a few
+ * seconds and retry rmdir. */
+ int r, t;
+ for (t = 0; t < 10; t++) {
+ if (t > 0)
+ Sleep(1000);
+ r = systemf("rmdir /S /Q %s", tests[i].name);
+ if (r == 0)
+ break;
+ }
+ systemf("del %s", logfilename);
+#else
systemf("rm -rf %s", tests[i].name);
+ systemf("rm %s", logfilename);
+#endif
}
}
/* Return appropriate status. */
- return (failures == failures_before ? 0 : 1);
+ return (tests[i].failures);
}
-static void usage(const char *program)
+/*
+ *
+ *
+ * MAIN and support routines.
+ *
+ *
+ */
+
+static void
+usage(const char *program)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
int i;
@@ -782,92 +1772,129 @@ static void usage(const char *program)
exit(1);
}
-#define UUDECODE(c) (((c) - 0x20) & 0x3f)
-
-void
-extract_reference_file(const char *name)
+static char *
+get_refdir(const char *d)
{
- char buff[1024];
- FILE *in, *out;
+ char tried[512] = { '\0' };
+ char buff[128];
+ char *pwd, *p;
+
+ /* If a dir was specified, try that */
+ if (d != NULL) {
+ pwd = NULL;
+ snprintf(buff, sizeof(buff), "%s", d);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+ goto failure;
+ }
- sprintf(buff, "%s/%s.uu", refdir, name);
- in = fopen(buff, "r");
- failure("Couldn't open reference file %s", buff);
- assert(in != NULL);
- if (in == NULL)
- return;
- /* Read up to and including the 'begin' line. */
- for (;;) {
- if (fgets(buff, sizeof(buff), in) == NULL) {
- /* TODO: This is a failure. */
- return;
- }
- if (memcmp(buff, "begin ", 6) == 0)
- break;
+ /* Get the current dir. */
+ pwd = getcwd(NULL, 0);
+ while (pwd[strlen(pwd) - 1] == '\n')
+ pwd[strlen(pwd) - 1] = '\0';
+
+ /* Look for a known file. */
+ snprintf(buff, sizeof(buff), "%s", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+#if defined(LIBRARY)
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY);
+#else
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM);
+#endif
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ if (memcmp(pwd, "/usr/obj", 8) == 0) {
+ snprintf(buff, sizeof(buff), "%s", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
}
- /* Now, decode the rest and write it. */
- /* Not a lot of error checking here; the input better be right. */
- out = fopen(name, "w");
- while (fgets(buff, sizeof(buff), in) != NULL) {
- char *p = buff;
- int bytes;
- if (memcmp(buff, "end", 3) == 0)
- break;
+failure:
+ printf("Unable to locate known reference file %s\n", KNOWNREF);
+ printf(" Checked following directories:\n%s\n", tried);
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+ DebugBreak();
+#endif
+ exit(1);
- bytes = UUDECODE(*p++);
- while (bytes > 0) {
- int n = 0;
- /* Write out 1-3 bytes from that. */
- if (bytes > 0) {
- n = UUDECODE(*p++) << 18;
- n |= UUDECODE(*p++) << 12;
- fputc(n >> 16, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++) << 6;
- fputc((n >> 8) & 0xFF, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++);
- fputc(n & 0xFF, out);
- --bytes;
- }
- }
- }
- fclose(out);
- fclose(in);
+success:
+ free(p);
+ free(pwd);
+ return strdup(buff);
}
-
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
- int i, tests_run = 0, tests_failed = 0, opt;
+ int i, tests_run = 0, tests_failed = 0, option;
time_t now;
char *refdir_alloc = NULL;
- char *progname, *p;
+ const char *progname;
+ const char *tmp, *option_arg, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
+ (void)argc; /* UNUSED */
+
+#if defined(HAVE__CrtSetReportMode)
+ /* To stop to run the default invalid parameter handler. */
+ _set_invalid_parameter_handler(invalid_parameter_handler);
+ /* Disable annoying assertion message box. */
+ _CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
+
/*
* Name of this program, used to build root of our temp directory
* tree.
*/
progname = p = argv[0];
while (*p != '\0') {
- if (*p == '/')
+ /* Support \ or / dir separators for Windows compat. */
+ if (*p == '/' || *p == '\\')
progname = p + 1;
++p;
}
#ifdef PROGRAM
/* Get the target program from environment, if available. */
- testprog = getenv(ENVBASE);
+ testprogfile = getenv(ENVBASE);
#endif
+ if (getenv("TMPDIR") != NULL)
+ tmp = getenv("TMPDIR");
+ else if (getenv("TMP") != NULL)
+ tmp = getenv("TMP");
+ else if (getenv("TEMP") != NULL)
+ tmp = getenv("TEMP");
+ else if (getenv("TEMPDIR") != NULL)
+ tmp = getenv("TEMPDIR");
+ else
+ tmp = "/tmp";
+
/* Allow -d to be controlled through the environment. */
if (getenv(ENVBASE "_DEBUG") != NULL)
dump_on_failure = 1;
@@ -876,46 +1903,86 @@ int main(int argc, char **argv)
refdir = getenv(ENVBASE "_TEST_FILES");
/*
- * Parse options.
+ * Parse options, without using getopt(), which isn't available
+ * on all platforms.
*/
- while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) {
- switch (opt) {
- case 'd':
- dump_on_failure = 1;
+ ++argv; /* Skip program name */
+ while (*argv != NULL) {
+ if (**argv != '-')
break;
- case 'k':
- keep_temp_files = 1;
- break;
- case 'p':
+ p = *argv++;
+ ++p; /* Skip '-' */
+ while (*p != '\0') {
+ option = *p++;
+ option_arg = NULL;
+ /* If 'opt' takes an argument, parse that. */
+ if (option == 'p' || option == 'r') {
+ if (*p != '\0')
+ option_arg = p;
+ else if (*argv == NULL) {
+ fprintf(stderr,
+ "Option -%c requires argument.\n",
+ option);
+ usage(progname);
+ } else
+ option_arg = *argv++;
+ p = ""; /* End of this option word. */
+ }
+
+ /* Now, handle the option. */
+ switch (option) {
+ case 'd':
+ dump_on_failure = 1;
+ break;
+ case 'k':
+ keep_temp_files = 1;
+ break;
+ case 'p':
#ifdef PROGRAM
- testprog = optarg;
+ testprogfile = option_arg;
#else
- usage(progname);
+ usage(progname);
#endif
- break;
- case 'q':
- quiet_flag++;
- break;
- case 'r':
- refdir = optarg;
- break;
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- usage(progname);
+ break;
+ case 'q':
+ verbosity--;
+ break;
+ case 'r':
+ refdir = option_arg;
+ break;
+ case 'v':
+ verbosity++;
+ break;
+ default:
+ usage(progname);
+ }
}
}
- argc -= optind;
- argv += optind;
/*
* Sanity-check that our options make sense.
*/
#ifdef PROGRAM
- if (testprog == NULL)
+ if (testprogfile == NULL)
usage(progname);
+ {
+ char *testprg;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Command.com sometimes rejects '/' separators. */
+ testprg = strdup(testprogfile);
+ for (i = 0; testprg[i] != '\0'; i++) {
+ if (testprg[i] == '/')
+ testprg[i] = '\\';
+ }
+ testprogfile = testprg;
+#endif
+ /* Quote the name that gets put into shell command lines. */
+ testprg = malloc(strlen(testprogfile) + 3);
+ strcpy(testprg, "\"");
+ strcat(testprg, testprogfile);
+ strcat(testprg, "\"");
+ testprog = testprg;
+ }
#endif
/*
@@ -924,40 +1991,37 @@ int main(int argc, char **argv)
* to make it easier to track the results of multiple tests.
*/
now = time(NULL);
- for (i = 0; i < 1000; i++) {
+ for (i = 0; ; i++) {
strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
"%Y-%m-%dT%H.%M.%S",
localtime(&now));
- sprintf(tmpdir, "/tmp/%s.%s-%03d", progname, tmpdir_timestamp, i);
- if (mkdir(tmpdir,0755) == 0)
+ sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
+ tmpdir_timestamp, i);
+ if (assertMakeDir(tmpdir,0755))
break;
- if (errno == EEXIST)
- continue;
- fprintf(stderr, "ERROR: Unable to create temp directory %s\n",
- tmpdir);
- exit(1);
+ if (i >= 999) {
+ fprintf(stderr,
+ "ERROR: Unable to create temp directory %s\n",
+ tmpdir);
+ exit(1);
+ }
}
/*
* If the user didn't specify a directory for locating
- * reference files, use the current directory for that.
+ * reference files, try to find the reference files in
+ * the "usual places."
*/
- if (refdir == NULL) {
- systemf("/bin/pwd > %s/refdir", tmpdir);
- refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
- p = refdir + strlen(refdir);
- while (p[-1] == '\n') {
- --p;
- *p = '\0';
- }
- systemf("rm %s/refdir", tmpdir);
- }
+ refdir = refdir_alloc = get_refdir(refdir);
/*
* Banner with basic information.
*/
- if (!quiet_flag) {
- printf("Running tests in: %s\n", tmpdir);
+ printf("\n");
+ printf("If tests fail or crash, details will be in:\n");
+ printf(" %s\n", tmpdir);
+ printf("\n");
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
printf("Reference files will be read from: %s\n", refdir);
#ifdef PROGRAM
printf("Running tests on: %s\n", testprog);
@@ -965,12 +2029,15 @@ int main(int argc, char **argv)
printf("Exercising: ");
fflush(stdout);
printf("%s\n", EXTRA_VERSION);
+ } else {
+ printf("Running ");
+ fflush(stdout);
}
/*
* Run some or all of the individual tests.
*/
- if (argc == 0) {
+ if (*argv == NULL) {
/* Default: Run all tests. */
for (i = 0; i < limit; i++) {
if (test_run(i, tmpdir))
@@ -979,15 +2046,30 @@ int main(int argc, char **argv)
}
} else {
while (*(argv) != NULL) {
- i = atoi(*argv);
- if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
- printf("*** INVALID Test %s\n", *argv);
- usage(progname);
+ if (**argv >= '0' && **argv <= '9') {
+ i = atoi(*argv);
+ if (i < 0 || i >= limit) {
+ printf("*** INVALID Test %s\n", *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
} else {
- if (test_run(i, tmpdir))
- tests_failed++;
- tests_run++;
+ for (i = 0; i < limit; ++i) {
+ if (strcmp(*argv, tests[i].name) == 0)
+ break;
+ }
+ if (i >= limit) {
+ printf("*** INVALID Test ``%s''\n",
+ *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
}
+ if (test_run(i, tmpdir))
+ tests_failed++;
+ tests_run++;
argv++;
}
}
@@ -995,20 +2077,38 @@ int main(int argc, char **argv)
/*
* Report summary statistics.
*/
- if (!quiet_flag) {
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
+ printf("\n");
+ printf("Totals:\n");
+ printf(" Tests run: %8d\n", tests_run);
+ printf(" Tests failed: %8d\n", tests_failed);
+ printf(" Assertions checked:%8d\n", assertions);
+ printf(" Assertions failed: %8d\n", failures);
+ printf(" Skips reported: %8d\n", skips);
+ }
+ if (failures) {
+ printf("\n");
+ printf("Failing tests:\n");
+ for (i = 0; i < limit; ++i) {
+ if (tests[i].failures)
+ printf(" %d: %s (%d failures)\n", i,
+ tests[i].name, tests[i].failures);
+ }
printf("\n");
- printf("%d of %d tests reported failures\n",
- tests_failed, tests_run);
- printf(" Total of %d assertions checked.\n", assertions);
- printf(" Total of %d assertions failed.\n", failures);
- printf(" Total of %d assertions skipped.\n", skips);
+ printf("Details for failing tests: %s\n", tmpdir);
+ printf("\n");
+ } else {
+ if (verbosity == VERBOSITY_SUMMARY_ONLY)
+ printf("\n");
+ printf("%d tests passed, no failures\n", tests_run);
}
free(refdir_alloc);
/* If the final tmpdir is empty, we can remove it. */
/* This should be the usual case when all tests succeed. */
+ assertChdir("..");
rmdir(tmpdir);
- return (tests_failed);
+ return (tests_failed ? 1 : 0);
}
diff --git a/archivers/libarchive/files/libarchive/test/read_open_memory.c b/archivers/libarchive/files/libarchive/test/read_open_memory.c
index aacb0123fda..e4e911c2f8b 100644
--- a/archivers/libarchive/files/libarchive/test/read_open_memory.c
+++ b/archivers/libarchive/files/libarchive/test/read_open_memory.c
@@ -24,7 +24,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/read_open_memory.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/read_open_memory.c 191183 2009-04-17 01:06:31Z kientzle $");
#include <errno.h>
#include <stdlib.h>
@@ -43,21 +43,38 @@ struct read_memory_data {
unsigned char *end;
size_t read_size;
size_t copy_buff_size;
+ size_t copy_buff_offset;
char *copy_buff;
};
static int memory_read_close(struct archive *, void *);
static int memory_read_open(struct archive *, void *);
-#if ARCHIVE_API_VERSION < 2
-static ssize_t memory_read_skip(struct archive *, void *, size_t request);
-#else
static off_t memory_read_skip(struct archive *, void *, off_t request);
-#endif
static ssize_t memory_read(struct archive *, void *, const void **buff);
+static int read_open_memory_internal(struct archive *a, void *buff,
+ size_t size, size_t read_size, int fullapi);
+
int
read_open_memory(struct archive *a, void *buff, size_t size, size_t read_size)
{
+ return read_open_memory_internal(a, buff, size, read_size, 1);
+}
+
+/*
+ * As above, but don't register any optional part of the API, to verify
+ * that internals work correctly with just the minimal entry points.
+ */
+int
+read_open_memory2(struct archive *a, void *buff, size_t size, size_t read_size)
+{
+ return read_open_memory_internal(a, buff, size, read_size, 0);
+}
+
+static int
+read_open_memory_internal(struct archive *a, void *buff,
+ size_t size, size_t read_size, int fullapi)
+{
struct read_memory_data *mine;
mine = (struct read_memory_data *)malloc(sizeof(*mine));
@@ -69,10 +86,16 @@ read_open_memory(struct archive *a, void *buff, size_t size, size_t read_size)
mine->buffer = (unsigned char *)buff;
mine->end = mine->buffer + size;
mine->read_size = read_size;
- mine->copy_buff_size = read_size + 64;
+ mine->copy_buff_offset = 32;
+ mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
mine->copy_buff = malloc(mine->copy_buff_size);
- return (archive_read_open2(a, mine, memory_read_open,
- memory_read, memory_read_skip, memory_read_close));
+ memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+ if (fullapi)
+ return (archive_read_open2(a, mine, memory_read_open,
+ memory_read, memory_read_skip, memory_read_close));
+ else
+ return (archive_read_open2(a, mine, NULL,
+ memory_read, NULL, memory_read_close));
}
/*
@@ -102,24 +125,20 @@ memory_read(struct archive *a, void *client_data, const void **buff)
size = mine->end - mine->buffer;
if (size > mine->read_size)
size = mine->read_size;
- memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
- memcpy(mine->copy_buff, mine->buffer, size);
- *buff = mine->copy_buff;
+ else
+ memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+ memcpy(mine->copy_buff + mine->copy_buff_offset, mine->buffer, size);
+ *buff = mine->copy_buff + mine->copy_buff_offset;
mine->buffer += size;
- return (size);
+ return ((ssize_t)size);
}
/*
* How mean can a skip() routine be? Let's try to find out.
*/
-#if ARCHIVE_API_VERSION < 2
-static ssize_t
-memory_read_skip(struct archive *a, void *client_data, size_t skip)
-#else
static off_t
memory_read_skip(struct archive *a, void *client_data, off_t skip)
-#endif
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
diff --git a/archivers/libarchive/files/libarchive/test/test.h b/archivers/libarchive/files/libarchive/test/test.h
index fbbf10a8c3d..40c31e13dba 100644
--- a/archivers/libarchive/files/libarchive/test/test.h
+++ b/archivers/libarchive/files/libarchive/test/test.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/test/test.h,v 1.10 2008/06/15 10:35:22 kientzle Exp $
+ * $FreeBSD: head/lib/libarchive/test/test.h 201247 2009-12-30 05:59:21Z kientzle $
*/
/* Every test program should #include "test.h" as the first thing. */
@@ -33,39 +33,98 @@
*/
#if defined(HAVE_CONFIG_H)
/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../../config.h"
+#include "config.h"
#elif defined(__FreeBSD__)
/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "../config_freebsd.h"
-#elif defined(_WIN32)
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
/* Win32 can't run the 'configure' script. */
-#include "../config_windows.h"
+#include "config_windows.h"
#else
/* Warn if the library hasn't been (automatically or manually) configured. */
#error Oops: No config.h and no pre-built configuration in test.h.
#endif
+#include <sys/types.h> /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#if HAVE_DIRENT_H
#include <dirent.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#define dirent direct
+#endif
#include <errno.h>
#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
-#ifndef _WIN32
+#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <wchar.h>
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
#endif
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
+/*
+ * System-specific tweaks. We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
+ */
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#endif
+#define LOCALE_UTF8 NULL
#else
-#define __FBSDID(a) /* null */
+#define LOCALE_UTF8 "de_DE.UTF-8"
+#endif
+
+/* Visual Studio */
+#ifdef _MSC_VER
+#define snprintf sprintf_s
+#endif
+
+#if defined(__BORLANDC__)
+#pragma warn -8068 /* Constant out of range in comparison. */
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+/* Cygwin-1.7.x is lazy about populating nlinks, so don't
+ * expect it to be accurate. */
+# define NLINKS_INACCURATE_FOR_DIRS
+#endif
+
+/* Haiku OS */
+#if defined(__HAIKU__)
+/* Haiku has typedefs in stdint.h (needed for int64_t) */
+#include <stdint.h>
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
#endif
/*
@@ -75,38 +134,81 @@
#define DEFINE_TEST(name) void name(void); void name(void)
/* An implementation of the standard assert() macro */
-#define assert(e) test_assert(__FILE__, __LINE__, (e), #e, NULL)
-
+#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
+/* chdir() and error if it fails */
+#define assertChdir(path) \
+ assertion_chdir(__FILE__, __LINE__, path)
/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-
+#define assertEqualInt(v1,v2) \
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* Assert two strings are the same. Reports value of each one if not. */
#define assertEqualString(v1,v2) \
- test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but v1 and v2 are wchar_t * */
#define assertEqualWString(v1,v2) \
- test_assert_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but raw blocks of bytes. */
#define assertEqualMem(v1, v2, l) \
- test_assert_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
/* Assert two files are the same; allow printf-style expansion of second name.
* See below for comments about variable arguments here...
*/
#define assertEqualFile \
- test_setup(__FILE__, __LINE__);test_assert_equal_file
+ assertion_setup(__FILE__, __LINE__);assertion_equal_file
/* Assert that a file is empty; supports printf-style arguments. */
#define assertEmptyFile \
- test_setup(__FILE__, __LINE__);test_assert_empty_file
+ assertion_setup(__FILE__, __LINE__);assertion_empty_file
+/* Assert that a file is not empty; supports printf-style arguments. */
+#define assertNonEmptyFile \
+ assertion_setup(__FILE__, __LINE__);assertion_non_empty_file
+#define assertFileAtime(pathname, sec, nsec) \
+ assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileAtimeRecent(pathname) \
+ assertion_file_atime_recent(__FILE__, __LINE__, pathname)
+#define assertFileBirthtime(pathname, sec, nsec) \
+ assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileBirthtimeRecent(pathname) \
+ assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileExists \
- test_setup(__FILE__, __LINE__);test_assert_file_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_exists
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileNotExists \
- test_setup(__FILE__, __LINE__);test_assert_file_not_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_not_exists
/* Assert that file contents match a string; supports printf-style arguments. */
#define assertFileContents \
- test_setup(__FILE__, __LINE__);test_assert_file_contents
+ assertion_setup(__FILE__, __LINE__);assertion_file_contents
+#define assertFileMtime(pathname, sec, nsec) \
+ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileMtimeRecent(pathname) \
+ assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
+#define assertFileNLinks(pathname, nlinks) \
+ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size) \
+ assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertTextFileContents \
+ assertion_setup(__FILE__, __LINE__);assertion_text_file_contents
+#define assertIsDir(pathname, mode) \
+ assertion_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsHardlink(path1, path2) \
+ assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsNotHardlink(path1, path2) \
+ assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsReg(pathname, mode) \
+ assertion_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents) \
+ assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
+/* Create a directory, report error if it fails. */
+#define assertMakeDir(dirname, mode) \
+ assertion_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeFile(path, mode, contents) \
+ assertion_make_file(__FILE__, __LINE__, path, mode, contents)
+#define assertMakeHardlink(newfile, oldfile) \
+ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto) \
+ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertUmask(mask) \
+ assertion_umask(__FILE__, __LINE__, mask)
/*
* This would be simple with C99 variadic macros, but I don't want to
@@ -115,26 +217,60 @@
* but effective.
*/
#define skipping \
- test_setup(__FILE__, __LINE__);test_skipping
+ assertion_setup(__FILE__, __LINE__);test_skipping
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
-void test_setup(const char *, int);
+int assertion_assert(const char *, int, int, const char *, void *);
+int assertion_chdir(const char *, int, const char *);
+int assertion_empty_file(const char *, ...);
+int assertion_equal_file(const char *, const char *, ...);
+int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
+int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
+int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int assertion_file_atime(const char *, int, const char *, long, long);
+int assertion_file_atime_recent(const char *, int, const char *);
+int assertion_file_birthtime(const char *, int, const char *, long, long);
+int assertion_file_birthtime_recent(const char *, int, const char *);
+int assertion_file_contents(const void *, int, const char *, ...);
+int assertion_file_exists(const char *, ...);
+int assertion_file_mtime(const char *, int, const char *, long, long);
+int assertion_file_mtime_recent(const char *, int, const char *);
+int assertion_file_nlinks(const char *, int, const char *, int);
+int assertion_file_not_exists(const char *, ...);
+int assertion_file_size(const char *, int, const char *, long);
+int assertion_is_dir(const char *, int, const char *, int);
+int assertion_is_hardlink(const char *, int, const char *, const char *);
+int assertion_is_not_hardlink(const char *, int, const char *, const char *);
+int assertion_is_reg(const char *, int, const char *, int);
+int assertion_is_symlink(const char *, int, const char *, const char *);
+int assertion_make_dir(const char *, int, const char *, int);
+int assertion_make_file(const char *, int, const char *, int, const char *);
+int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
+int assertion_make_symlink(const char *, int, const char *newpath, const char *);
+int assertion_non_empty_file(const char *, ...);
+int assertion_text_file_contents(const char *buff, const char *f);
+int assertion_umask(const char *, int, int);
+void assertion_setup(const char *, int);
+
void test_skipping(const char *fmt, ...);
-int test_assert(const char *, int, int, const char *, void *);
-int test_assert_empty_file(const char *, ...);
-int test_assert_equal_file(const char *, const char *, ...);
-int test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
-int test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
-int test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
-int test_assert_file_contents(const void *, int, const char *, ...);
-int test_assert_file_exists(const char *, ...);
-int test_assert_file_not_exists(const char *, ...);
/* Like sprintf, then system() */
int systemf(const char * fmt, ...);
+/* Delay until time() returns a value after this. */
+void sleepUntilAfter(time_t);
+
+/* Return true if this platform can create symlinks. */
+int canSymlink(void);
+
+/* Return true if this platform can run the "gzip" program. */
+int canGzip(void);
+
+/* Return true if this platform can run the "gunzip" program. */
+int canGunzip(void);
+
/* Suck file into string allocated via malloc(). Call free() when done. */
/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
char *slurpfile(size_t *, const char *fmt, ...);
@@ -151,21 +287,16 @@ void extract_reference_file(const char *);
/* Special customized read-from-memory interface. */
int read_open_memory(struct archive *, void *, size_t, size_t);
-
-/*
- * ARCHIVE_VERSION_STAMP first appeared in 1.9 and libarchive 2.2.4.
- * We can approximate it for earlier versions, though.
- * This is used to disable tests of features not present in the current
- * version.
- */
-#ifndef ARCHIVE_VERSION_STAMP
-#define ARCHIVE_VERSION_STAMP \
- (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
-#endif
+/* "2" version exercises a slightly different set of libarchive APIs. */
+int read_open_memory2(struct archive *, void *, size_t, size_t);
/* Versions of above that accept an archive argument for additional info. */
-#define assertA(e) test_assert(__FILE__, __LINE__, (e), #e, (a))
+#define assertA(e) assertion_assert(__FILE__, __LINE__, (e), #e, (a))
#define assertEqualIntA(a,v1,v2) \
- test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
#define assertEqualStringA(a,v1,v2) \
- test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
diff --git a/archivers/libarchive/files/libarchive/test/test_acl_basic.c b/archivers/libarchive/files/libarchive/test/test_acl_basic.c
index effcfb78c48..f66014cdd31 100644
--- a/archivers/libarchive/files/libarchive/test/test_acl_basic.c
+++ b/archivers/libarchive/files/libarchive/test/test_acl_basic.c
@@ -23,12 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.4 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.6 2008/10/19 00:13:57 kientzle Exp $");
/*
* Exercise the system-independent portion of the ACL support.
- * Check that archive_entry objects can save and restore ACL data
- * and that pax archive can save and restore ACL data.
+ * Check that archive_entry objects can save and restore ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
@@ -42,7 +41,7 @@ struct acl_t {
const char *name; /* Name of user/group, depending on tag. */
};
-struct acl_t acls0[] = {
+static struct acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -51,7 +50,7 @@ struct acl_t acls0[] = {
ARCHIVE_ENTRY_ACL_OTHER, 0, "" },
};
-struct acl_t acls1[] = {
+static struct acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -62,7 +61,7 @@ struct acl_t acls1[] = {
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
-struct acl_t acls2[] = {
+static struct acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -165,7 +164,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
assert(matched == 1);
}
}
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Known broken before 1.9.0. */
skipping("archive_entry_acl_next() exits with ARCHIVE_EOF");
#else
diff --git a/archivers/libarchive/files/libarchive/test/test_acl_freebsd.c b/archivers/libarchive/files/libarchive/test/test_acl_freebsd.c
new file mode 100644
index 00000000000..be502067f5f
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_acl_freebsd.c
@@ -0,0 +1,255 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_freebsd.c 189427 2009-03-06 04:21:23Z kientzle $");
+
+#if defined(__FreeBSD__) && __FreeBSD__ > 4
+#include <sys/acl.h>
+
+struct myacl_t {
+ int type; /* Type of ACL: "access" or "default" */
+ int permset; /* Permissions for this class of users. */
+ int tag; /* Owner, User, Owning group, group, other, etc. */
+ int qual; /* GID or UID of user/group, depending on tag. */
+ const char *name; /* Name of user/group, depending on tag. */
+};
+
+static struct myacl_t acls2[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
+ ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_MASK, -1, "" },
+ { 0, 0, 0, 0, NULL }
+};
+
+static void
+set_acls(struct archive_entry *ae, struct myacl_t *acls)
+{
+ int i;
+
+ archive_entry_acl_clear(ae);
+ for (i = 0; acls[i].name != NULL; i++) {
+ archive_entry_acl_add_entry(ae,
+ acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual,
+ acls[i].name);
+ }
+}
+
+static int
+acl_match(acl_entry_t aclent, struct myacl_t *myacl)
+{
+ gid_t g, *gp;
+ uid_t u, *up;
+ acl_tag_t tag_type;
+ acl_permset_t opaque_ps;
+ int permset = 0;
+
+ acl_get_tag_type(aclent, &tag_type);
+
+ /* translate the silly opaque permset to a bitmap */
+ acl_get_permset(aclent, &opaque_ps);
+ if (acl_get_perm_np(opaque_ps, ACL_EXECUTE))
+ permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ if (acl_get_perm_np(opaque_ps, ACL_WRITE))
+ permset |= ARCHIVE_ENTRY_ACL_WRITE;
+ if (acl_get_perm_np(opaque_ps, ACL_READ))
+ permset |= ARCHIVE_ENTRY_ACL_READ;
+
+ if (permset != myacl->permset)
+ return (0);
+
+ switch (tag_type) {
+ case ACL_USER_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
+ break;
+ case ACL_USER:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ up = acl_get_qualifier(aclent);
+ u = *up;
+ acl_free(up);
+ if ((uid_t)myacl->qual != u)
+ return (0);
+ break;
+ case ACL_GROUP_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
+ break;
+ case ACL_GROUP:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ gp = acl_get_qualifier(aclent);
+ g = *gp;
+ acl_free(gp);
+ if ((gid_t)myacl->qual != g)
+ return (0);
+ break;
+ case ACL_MASK:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
+ break;
+ case ACL_OTHER:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
+ break;
+ }
+ return (1);
+}
+
+static void
+compare_acls(acl_t acl, struct myacl_t *myacls)
+{
+ int *marker;
+ int entry_id = ACL_FIRST_ENTRY;
+ int matched;
+ int i, n;
+ acl_entry_t acl_entry;
+
+ /* Count ACL entries in myacls array and allocate an indirect array. */
+ for (n = 0; myacls[n].name != NULL; ++n)
+ continue;
+ marker = malloc(sizeof(marker[0]) * n);
+ for (i = 0; i < n; i++)
+ marker[i] = i;
+
+ /*
+ * Iterate over acls in system acl object, try to match each
+ * one with an item in the myacls array.
+ */
+ while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
+ /* After the first time... */
+ entry_id = ACL_NEXT_ENTRY;
+
+ /* Search for a matching entry (tag and qualifier) */
+ for (i = 0, matched = 0; i < n && !matched; i++) {
+ if (acl_match(acl_entry, &myacls[marker[i]])) {
+ /* We found a match; remove it. */
+ marker[i] = marker[n - 1];
+ n--;
+ matched = 1;
+ }
+ }
+
+ /* TODO: Print out more details in this case. */
+ failure("ACL entry on file that shouldn't be there");
+ assert(matched == 1);
+ }
+
+ /* Dump entries in the myacls array that weren't in the system acl. */
+ for (i = 0; i < n; ++i) {
+ failure(" ACL entry missing from file: "
+ "type=%d,permset=%d,tag=%d,qual=%d,name=``%s''\n",
+ myacls[marker[i]].type, myacls[marker[i]].permset,
+ myacls[marker[i]].tag, myacls[marker[i]].qual,
+ myacls[marker[i]].name);
+ assert(0); /* Record this as a failure. */
+ }
+ free(marker);
+}
+
+#endif
+
+
+/*
+ * Verify ACL restore-to-disk. This test is FreeBSD-specific.
+ */
+
+DEFINE_TEST(test_acl_freebsd)
+{
+#if !defined(__FreeBSD__)
+ skipping("FreeBSD-specific ACL restore test");
+#elif __FreeBSD__ < 5
+ skipping("ACL restore supported only on FreeBSD 5.0 and later");
+#else
+ struct stat st;
+ struct archive *a;
+ struct archive_entry *ae;
+ int n, fd;
+ acl_t acl;
+
+ /*
+ * First, do a quick manual set/read of ACL data to
+ * verify that the local filesystem does support ACLs.
+ * If it doesn't, we'll simply skip the remaining tests.
+ */
+ acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx");
+ assert((void *)acl != NULL);
+ /* Create a test file and try to set an ACL on it. */
+ fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777);
+ failure("Could not create test file?!");
+ if (!assert(fd >= 0)) {
+ acl_free(acl);
+ return;
+ }
+
+ n = acl_set_fd(fd, acl);
+ acl_free(acl);
+ if (n != 0 && errno == EOPNOTSUPP) {
+ close(fd);
+ skipping("ACL tests require that ACL support be enabled on the filesystem");
+ return;
+ }
+ failure("acl_set_fd(): errno = %d (%s)",
+ errno, strerror(errno));
+ assertEqualInt(0, n);
+ close(fd);
+
+ /* Create a write-to-disk object. */
+ assert(NULL != (a = archive_write_disk_new()));
+ archive_write_disk_set_options(a,
+ ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL);
+
+ /* Populate an archive entry with some metadata, including ACL info */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "test0");
+ archive_entry_set_mtime(ae, 123456, 7890);
+ archive_entry_set_size(ae, 0);
+ set_acls(ae, acls2);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /* Verify the data on disk. */
+ assertEqualInt(0, stat("test0", &st));
+ assertEqualInt(st.st_mtime, 123456);
+ acl = acl_get_file("test0", ACL_TYPE_ACCESS);
+ assert(acl != (acl_t)NULL);
+ compare_acls(acl, acls2);
+ acl_free(acl);
+#endif
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_acl_pax.c b/archivers/libarchive/files/libarchive/test/test_acl_pax.c
index 1eb3d399a9e..1f0468ca115 100644
--- a/archivers/libarchive/files/libarchive/test/test_acl_pax.c
+++ b/archivers/libarchive/files/libarchive/test/test_acl_pax.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_pax.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_pax.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Exercise the system-independent portion of the ACL support.
@@ -151,10 +151,10 @@ static unsigned char reference[] = {
0,0,0,0,0,0,0,0,0,0,'1','1','3',' ','S','C','H','I','L','Y','.','a','c','l',
'.','a','c','c','e','s','s','=','u','s','e','r',':',':','r','-','x',',','g',
'r','o','u','p',':',':','r','-','-',',','o','t','h','e','r',':',':','-','w',
-'x',',','g','r','o','u','p',':','g','r','o','u','p','7','8',':','r','w','x',
-':','7','8',',','u','s','e','r',':','u','s','e','r','7','8',':','-','-','-',
-':','7','8',',','u','s','e','r',':','u','s','e','r','7','7',':','r','-','-',
-':','7','7',10,'1','6',' ','S','C','H','I','L','Y','.','d','e','v','=','0',
+'x',',','u','s','e','r',':','u','s','e','r','7','7',':','r','-','-',':','7',
+'7',',','u','s','e','r',':','u','s','e','r','7','8',':','-','-','-',':','7',
+'8',',','g','r','o','u','p',':','g','r','o','u','p','7','8',':','r','w','x',
+':','7','8',10,'1','6',' ','S','C','H','I','L','Y','.','d','e','v','=','0',
10,'1','6',' ','S','C','H','I','L','Y','.','i','n','o','=','0',10,'1','8',
' ','S','C','H','I','L','Y','.','n','l','i','n','k','=','0',10,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -386,7 +386,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
assert(matched == 1);
}
}
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Known broken before 1.9.0. */
skipping("archive_entry_acl_next() exits with ARCHIVE_EOF");
#else
@@ -406,7 +406,7 @@ DEFINE_TEST(test_acl_pax)
struct archive *a;
struct archive_entry *ae;
size_t used;
- int fd;
+ FILE *f;
/* Write an archive to memory. */
assert(NULL != (a = archive_write_new()));
@@ -446,27 +446,27 @@ DEFINE_TEST(test_acl_pax)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/* Write out the data we generated to a file for manual inspection. */
- assert(-1 < (fd = open("testout", O_WRONLY | O_CREAT | O_TRUNC, 0775)));
- assert(used == (size_t)write(fd, buff, used));
- close(fd);
+ assert(NULL != (f = fopen("testout", "wb")));
+ assertEqualInt(used, (size_t)fwrite(buff, 1, (unsigned int)used, f));
+ fclose(f);
/* Write out the reference data to a file for manual inspection. */
- assert(-1 < (fd = open("reference", O_WRONLY | O_CREAT | O_TRUNC, 0775)));
- assert(sizeof(reference) == write(fd, reference, sizeof(reference)));
- close(fd);
+ assert(NULL != (f = fopen("reference", "wb")));
+ assert(sizeof(reference) == fwrite(reference, 1, sizeof(reference), f));
+ fclose(f);
/* Assert that the generated data matches the built-in reference data.*/
failure("Generated pax archive does not match reference; check 'testout' and 'reference' files.");
- assert(0 == memcmp(buff, reference, sizeof(reference)));
+ assertEqualMem(buff, reference, sizeof(reference));
failure("Generated pax archive does not match reference; check 'testout' and 'reference' files.");
- assertEqualInt(used, sizeof(reference));
+ assertEqualInt((int)used, sizeof(reference));
/* Read back each entry and check that the ACL data is right. */
assert(NULL != (a = archive_read_new()));
@@ -509,9 +509,9 @@ DEFINE_TEST(test_acl_pax)
/* Close the archive. */
assertA(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertA(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_bad_fd.c b/archivers/libarchive/files/libarchive/test/test_bad_fd.c
index 1903cd07ee4..3ea7daacf2e 100644
--- a/archivers/libarchive/files/libarchive/test/test_bad_fd.c
+++ b/archivers/libarchive/files/libarchive/test/test_bad_fd.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/* Verify that attempting to open an invalid fd returns correct error. */
DEFINE_TEST(test_bad_fd)
@@ -33,9 +33,9 @@ DEFINE_TEST(test_bad_fd)
assertA(0 == archive_read_support_compression_all(a));
assertA(ARCHIVE_FATAL == archive_read_open_fd(a, -1, 1024));
assertA(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertA(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_bzip2.c b/archivers/libarchive/files/libarchive/test/test_compat_bzip2.c
new file mode 100644
index 00000000000..343f451ae69
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_bzip2.c
@@ -0,0 +1,85 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_bzip2.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Verify our ability to read sample files compatibly with bunzip2.
+ *
+ * In particular:
+ * * bunzip2 will read multiple bzip2 streams, concatenating the output
+ * * bunzip2 will stop at the end of a stream if the following data
+ * doesn't start with a bzip2 signature.
+ */
+
+/*
+ * All of the sample files have the same contents; they're just
+ * compressed in different ways.
+ */
+static void
+compat_bzip2(const char *name)
+{
+ const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
+ struct archive_entry *ae;
+ struct archive *a;
+ int i;
+
+ assert((a = archive_read_new()) != NULL);
+ if (ARCHIVE_OK != archive_read_support_compression_bzip2(a)) {
+ skipping("Unsupported bzip2");
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+ /* Read entries, match up names with list above. */
+ for (i = 0; i < 6; ++i) {
+ failure("Could not read file %d (%s) from %s", i, n[i], name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualString(n[i], archive_entry_pathname(ae));
+ }
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2);
+ assertEqualString(archive_compression_name(a), "bzip2");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_bzip2)
+{
+ compat_bzip2("test_compat_bzip2_1.tbz");
+ compat_bzip2("test_compat_bzip2_2.tbz");
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_bzip2_1.tbz.uu b/archivers/libarchive/files/libarchive/test/test_compat_bzip2_1.tbz.uu
new file mode 100644
index 00000000000..989af82b2e5
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_bzip2_1.tbz.uu
@@ -0,0 +1,24 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_1.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
+
+begin 644 test_compat_bzip2_1.tbz
+M0EIH.3%!62936;12^)(``#-;D=$00`!_@``!8RT>$`0`$```""``5#5/*'J>
+MD#(&30_5!H4_5-ZH`T``327U4@&L('"(9-%8<7&$I,`:7FXH<P(<:8)$*)(U
+MZH$>+*\GV#JF<`PK29-8'OPDG36S\7<D4X4)"T4OB2!"6F@Y,4%9)E-92FB6
+M4````'N4T1`$`$``?X```6,M'A`$```0``@@`'0:H]$R>HR&C(T:/U0:$U'I
+MJ!ZC0`#VECO\[$10H'-Z@F*:6A1$H$V("2G0Q(U0(8=(7AK$S04#!)RXOAP%
+MP:D%#Q;NO)\4UL23'2[\7<D4X4)!*:)90$)::#DQ05DF4UD;;[2>````6YC1
+M$$`$?X```6,M'A`$`!````@@`'4-4S*,U!HT!HT?J@T)E-I--!H`![6<G^E$
+M$5QJ!S2`*)/,*+VQ9'B0",=3$#5`CA"8<%1\7A4X$T:,-A)F5^*"X5[IR?&-
+M*DDY2+\7<D4X4)`;;[2>0EIH.3%!629364RNM^,```#?L-$00`#_@`0```AG
+M+1X0`!`$```((`!U#5-,:1IH`TT,1^J#)&H]3U`T``!CX[_.[`F40.64EC"D
+M()+?<M#$":=,4$46`@@DBMQ)81MJACLC[V0".0,7#AH=97F?G1I@9U))RD?Q
+M=R13A0D$RNM^,$)::#DQ05DF4UDS!PL0```!6]#1$$``_X``#&<M'A`0``0`
+M``@@`'4-4\2-&@`:#31^J#)3TU&U!H``!B_C_.]`)J4#F929S&D0$F:4(J50
+M&#)@@5&F"H,GH(J*7*@X&>KX6,VP?6Y;F%5$XR[Y/D#*9),K3^+N2*<*$@9@
+MX6(`0EIH.3%!62936>ZM4*4```);D-$00`#O@``(9ST>$`0```@@`'0:IFC2
+M&F@!B:/U0:$R&H:&@`"KS^U=Y`BC`#FY2*9-8%%&13E$@%8ZF(&J!##]!#E`
+MKVL'2LUW2.*<!T+W-B@46%:=GQ<#6Q*DYH/Q=R13A0D.ZM4*4$)::#DQ05DF
+M4UD!Z-!@```!P`'```"```@@`""J;4&8NH/%W)%.%"0`>C08`$)::#DQ05DF
+?4UDI/)=P````0!!```0`(``A`(*#%W)%.%"0*3R7<```
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_bzip2_2.tbz.uu b/archivers/libarchive/files/libarchive/test/test_compat_bzip2_2.tbz.uu
new file mode 100644
index 00000000000..9ba63e8772b
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_bzip2_2.tbz.uu
@@ -0,0 +1,11 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_2.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
+
+begin 644 test_compat_bzip2_2.tbz
+M0EIH.3%!629361HI1P<``4#;D-$00`#_@``)9RT>$`0``!@P`/@#&$Q,F`F`
+M`,83$R8"8``1133"1/2-J-#$/U3@;XVF9V'`Y3882XA$*KO6\WTL`]QU&J"8
+M$-=*Q$\@=`=QJ,TQ;3UH,NPT$-(!"HV&!ZO5D&@P-1D&1@'L<8&209QV9'G`
+MW&PRZ0Q(-BT%&DG*DE.!U*#J.P]*#%-P9G`W9+34:#S&M`;@^1R^![C]:Y)U
+MDF9/(\AR/@?P<CD<CD>@^@I_B[DBG"A(#12C@X!3;VUE(&UO<F4@9&%T82!T
+7:&%T(&ES(&YO="!B>FEP('-T<F5A;0H`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_cpio.c b/archivers/libarchive/files/libarchive/test/test_compat_cpio.c
new file mode 100644
index 00000000000..8f97036c4f3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_cpio.c
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_cpio.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Verify our ability to read various sample files.
+ * It should be easy to add any new sample files sent in by users
+ * to this collection of tests.
+ */
+
+/* Copy this function for each test file and adjust it accordingly. */
+
+/*
+ * test_compat_cpio_1.cpio checks heuristics for avoiding false
+ * hardlinks. foo1 and foo2 are files that have nlinks=1 and so
+ * should not be marked as hardlinks even though they have identical
+ * ino values. bar1 and bar2 have nlinks=2 so should be marked
+ * as hardlinks.
+ */
+static void
+test_compat_cpio_1(void)
+{
+ char name[] = "test_compat_cpio_1.cpio";
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 17));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("foo1", archive_entry_pathname(ae));
+ assertEqualString(NULL, archive_entry_hardlink(ae));
+ assertEqualInt(1260250228, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Read second entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("foo2", archive_entry_pathname(ae));
+ assertEqualString(NULL, archive_entry_hardlink(ae));
+ assertEqualInt(1260250228, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Read third entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("bar1", archive_entry_pathname(ae));
+ assertEqualString(NULL, archive_entry_hardlink(ae));
+ assertEqualInt(1260250228, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Read fourth entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("bar2", archive_entry_pathname(ae));
+ assertEqualString("bar1", archive_entry_hardlink(ae));
+ assertEqualInt(1260250228, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_cpio)
+{
+ test_compat_cpio_1();
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_cpio_1.cpio.uu b/archivers/libarchive/files/libarchive/test/test_compat_cpio_1.cpio.uu
new file mode 100644
index 00000000000..967a344b409
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_cpio_1.cpio.uu
@@ -0,0 +1,19 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_cpio_1.cpio.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_compat_cpio_1.cpio
+M,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
+M,31B,61E-#<T,#`P,#`P,#0P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`U,#`P,#`P,#!F;V\Q``!F;V\*,#<P-S`Q,#`U-CEE8F4P
+M,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P,31B,61E-#<T,#`P,#`P
+M,#0P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`U,#`P
+M,#`P,#!F;V\R``!B87(*,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X
+M,#`P,#`S93@P,#`P,#`P,C1B,61E-#<T,#`P,#`P,#0P,#`P,#`P,#`P,#`P
+M,#4T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`U,#`P,#`P,#!B87(Q``!B87H*
+M,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
+M,C1B,61E-#<T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`U,#`P,#`P,#!B87(R```P-S`W,#$P,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,&(P,#`P,#`P
+/,%1204E,15(A(2$`````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gtar.c b/archivers/libarchive/files/libarchive/test/test_compat_gtar.c
index 66cd7b02e87..c0a69598e98 100644
--- a/archivers/libarchive/files/libarchive/test/test_compat_gtar.c
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gtar.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gtar.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Verify our ability to read sample files created by GNU tar.
@@ -40,9 +40,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.2 2008/03/12
static void
test_compat_gtar_1(void)
{
- char name[] = "test_compat_gtar_1.tgz";
+ char name[] = "test_compat_gtar_1.tar";
struct archive_entry *ae;
struct archive *a;
+ int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
@@ -51,7 +52,11 @@ test_compat_gtar_1(void)
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_finish(a);
+ return;
+ }
assertEqualString(
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890"
@@ -66,7 +71,11 @@ test_compat_gtar_1(void)
assertEqualInt(0100644, archive_entry_mode(ae));
/* Read second entry. */
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_finish(a);
+ return;
+ }
assertEqualString(
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
@@ -90,14 +99,14 @@ test_compat_gtar_1(void)
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
- assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tar.uu b/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tar.uu
new file mode 100644
index 00000000000..da54476e881
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tar.uu
@@ -0,0 +1,232 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_gtar_1.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
+begin 644 test_compat_gtar_1.tar
+M+B\N+T!,;VYG3&EN:P``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````"`@("`@,"``("`@("`P(``@("`@(#`@`"`@("`@("`@,S$Q
+M("`@("`@("`@("`P("`Q,#<P,0`@3```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<B`@`')O;W0`
+M````````````````````````````````````=VAE96P`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X
+M.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S
+M-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X
+M.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S
+M-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````#$R,S0U-C<X.3`Q
+M,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V
+M-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.0`Q
+M,#`V-#0@`"`@,3<U,"``("`Q-S4P(``@("`@("`@("`@,"`Q,#<R-C<P,#$W
+M,R`@,C$P,C``(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(@(`!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````+B\N+T!,;VYG3&EN:P``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````"`@("`@,"``("`@("`P(``@("`@(#`@`"`@("`@
+M("`@,S$Q("`@("`@("`@("`P("`Q,#<P,``@2P``````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<B`@
+M`')O;W0`````````````````````````````````````=VAE96P`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R
+M,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W
+M.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R
+M,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W
+M.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,```
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````"XO+B]`
+M3&]N9TQI;FL`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````@("`@(#`@`"`@("`@,"``("`@("`P(``@("`@("`@(#,Q,2`@("`@
+M("`@("`@,"`@,3`W,#$`($P`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(@(`!R;V]T````````
+M`````````````````````````````'=H965L````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C
+M9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H
+M:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C
+M9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H
+M:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6H`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A8F-D969G:&EJ86)C9&5F
+M9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA
+M8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&D`,3(P-S4U
+M(``@(#$W-3`@`"`@,3<U,"``("`@("`@("`@(#`@,3`W,C8W,#`R-#,@(#0T
+M-3(Q`"`R,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y
+M,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T
+M-38W.#DP,3(S-#4V-S@Y`'5S=&%R("``=&EM````````````````````````
+M``````````````!T:6T`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gzip.c b/archivers/libarchive/files/libarchive/test/test_compat_gzip.c
new file mode 100644
index 00000000000..a76b2f8f8d7
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gzip.c
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * Verify our ability to read sample files compatibly with gunzip.
+ *
+ * In particular:
+ * * gunzip will read multiple gzip streams, concatenating the output
+ * * gunzip will stop at the end of a stream if the following data
+ * doesn't start with a gzip signature.
+ */
+
+/*
+ * All of the sample files have the same contents; they're just
+ * compressed in different ways.
+ */
+static void
+verify(const char *name)
+{
+ const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
+ struct archive_entry *ae;
+ struct archive *a;
+ int i,r;
+
+ assert((a = archive_read_new()) != NULL);
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 200));
+
+ /* Read entries, match up names with list above. */
+ for (i = 0; i < 6; ++i) {
+ failure("Could not read file %d (%s) from %s", i, n[i], name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_finish(a);
+ return;
+ }
+ assertEqualString(n[i], archive_entry_pathname(ae));
+ }
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP);
+ assertEqualString(archive_compression_name(a), "gzip");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_gzip)
+{
+ /* This sample has been 'split', each piece compressed separately,
+ * then concatenated. Gunzip will emit the concatenated result. */
+ /* Not supported in libarchive 2.6 and earlier */
+ verify("test_compat_gzip_1.tgz");
+ /* This sample has been compressed as a single stream, but then
+ * some unrelated garbage text has been appended to the end. */
+ verify("test_compat_gzip_2.tgz");
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gzip_1.tgz.uu b/archivers/libarchive/files/libarchive/test/test_compat_gzip_1.tgz.uu
new file mode 100644
index 00000000000..db23f03747e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gzip_1.tgz.uu
@@ -0,0 +1,24 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_gzip_1.tgz.uu 185683 2008-12-06 07:08:08Z kientzle $
+
+begin 644 test_compat_gzip_1.tgz
+M'XL(")B^(DD``W1E<W0M<W!L:70N=&%R86$`2S-DH#DP,#`P,S%1`-*&YJ:&
+MR#0,&"L8`H&!J;&9F:&A@H&AH9&),8."`>V=QL!06ER26`1T2G9F:EY)54XJ
+MN>9`/*(`IX<(2#/D&F@GC`(Z``#S<P4"Z`,``!^+"`B8OB))``-T97-T+7-P
+M;&ET+G1A<F%B`&-@P`[2C'!(4!$8&!B8F9@H`&E#<U-#9!H&C!4,@<#`U-C,
+MS-!8P<#0T,C$C$'!@/9.8V`H+2Y)+`(Z)3LS-:^D*B>57',@'E&`TT,$I!EQ
+M#;031@$5`0`Q!<\4Z`,``!^+"`B8OB))``-T97-T+7-P;&ET+G1A<F%C`&-@
+M(`VD&9.H@0Q@8&!@9F*B`*0-S4T-D6D8,%8P!`(#4V,S,T,S!0-#0R-3(P8%
+M`]H[C8&AM+@DL0CHE.S,U+R2JIQ4<LV!>$0!3@\1D&;,-=!.&`5D``#7L]HO
+MZ`,``!^+"`B8OB))``-T97-T+7-P;&ET+G1A<F%D`&-@H`Y(,=1/,Z226;B`
+M@8&!F8F)`I`V-#<U1*9AP%C!$`@,3(W-S(S,%0P,#4U-S1@4#&CL+C`H+2Y)
+M+`(Z)3LS-:^D*B>57',@'E&`TT,$I!ER#;031@$>``"Y*#OBZ`,``!^+"`B8
+MOB))``-T97-T+7-P;&ET+G1A<F%E`&-@H"U(,=1/,Z*Q'08&!F8F)@I`VM#<
+MU!"9A@%C!4,@,#`U-C,S-E`P,#0T-35D4#"@L;O`H+2X)+$(Z)3LS-2\DJJ<
+M5'+-@7A$`4X/$9!FQ#703A@%0```]%Z(F^@#```?BP@(F+XB20`#=&5S="US
+M<&QI="YT87)A9@!C8!@8D&*HGV9,8SL,#`S,3$P4@+2AN:DA,@T#Q@J&0&!@
+M:FQF9FRH8&!H:&IJS*!@0&-W@4%I<4EB$=`IV9FI>255.:GDF@/QB`*<'B(@
+MS9AKH)TPH@``)4=8$>@#```?BP@(F+XB20`#=&5S="US<&QI="YT87)A9P!C
+M8!@%HV`4#'<``(`7"P;H`P``'XL(")B^(DD``W1E<W0M<W!L:70N=&%R86@`
+.8V`8&@``E#SI#J@`````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gzip_2.tgz.uu b/archivers/libarchive/files/libarchive/test/test_compat_gzip_2.tgz.uu
new file mode 100644
index 00000000000..683b2a1f255
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gzip_2.tgz.uu
@@ -0,0 +1,11 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_gzip_2.tgz.uu 185683 2008-12-06 07:08:08Z kientzle $
+
+begin 644 test_compat_gzip_2.tgz
+M'XL(`&76(DD``^W800["(!"%8=:>@ALXPP`]CXF=Q&A<:-UX>EN)C5M,AL;P
+MO@V[0A=_.E39F2.B'*.?5QX2?Z\?XGE&27)F]L0<HCA/]D=S[G&?#K?Y*.?3
+M>)V>E_'7YY07\>OZ)Y1W6Q\!-J3!?H^Z_J7TG]%_"QK0?\]4[/>HZS^_^T\!
+M_;>@@OY[=N2]6E\!JOH/P])_2OC^-X'YOV]+_]97@*K^A4K_C/Y;P/S?MZ5_
+MZRM`7?]<^L?_OR8P_P,`].D%,XR2*0`<``!4:&ES(&ES('5N<F5L871E9"!J
+@=6YK(&1A=&$@870@=&AE(&5N9"!O9B!T:&4@9FEL90H`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_lzma.c b/archivers/libarchive/files/libarchive/test/test_compat_lzma.c
new file mode 100644
index 00000000000..6aefbc2ebc3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_lzma.c
@@ -0,0 +1,155 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_lzma.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following to rebuild the data for this program:
+ tail -n +33 test_compat_lzma.c | /bin/sh
+
+# Use lzma command of XZ Utils.
+name=test_compat_lzma_1
+zcmd=lzma
+zsuffix=lzma
+ztar_suffix=tlz
+dir="$name`date +%Y%m%d%H%M%S`.$USER"
+mktarfile()
+{
+mkdir $dir
+echo "f1" > $dir/f1
+echo "f2" > $dir/f2
+echo "f3" > $dir/f3
+mkdir $dir/d1
+echo "f1" > $dir/d1/f1
+echo "f2" > $dir/d1/f2
+echo "f3" > $dir/d1/f3
+(cd $dir; tar cf ../$name.tar f1 f2 f3 d1/f1 d1/f2 d1/f3)
+rm -r $dir
+}
+mktarfile
+$zcmd $name.tar
+mv $name.tar.$zsuffix $name.$ztar_suffix
+echo "This is unrelated junk data at the end of the file" >> $name.$ztar_suffix
+uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
+rm -f $name.$ztar_suffix
+#
+# Use option -e
+#
+name=test_compat_lzma_2
+dir="$name`date +%Y%m%d%H%M%S`.$USER"
+mktarfile
+$zcmd -e $name.tar
+mv $name.tar.$zsuffix $name.$ztar_suffix
+uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
+rm -f $name.$ztar_suffix
+#
+# Use lzma command of LZMA SDK with option -d12.
+#
+name=test_compat_lzma_3
+zcmd=lzmasdk # Change this path to use lzma of LZMA SDK.
+dir="$name`date +%Y%m%d%H%M%S`.$USER"
+mktarfile
+$zcmd e -d12 $name.tar $name.$ztar_suffix
+rm -f $name.tar
+uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
+rm -f $name.$ztar_suffix
+
+exit 0
+*/
+
+/*
+ * Verify our ability to read sample files compatibly with unlzma.
+ *
+ * In particular:
+ * * unlzma will read multiple lzma streams, concatenating the output
+ * * unlzma will read lzma streams which is made by lzma with option -e,
+ * concatenating the output
+ *
+ * Verify our ability to read sample files compatibly with lzma of
+ * LZMA SDK.
+ * * lzma will read lzma streams which is made by lzma with option -d12,
+ * concatenating the output
+ */
+
+/*
+ * All of the sample files have the same contents; they're just
+ * compressed in different ways.
+ */
+static void
+compat_lzma(const char *name)
+{
+ const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
+ struct archive_entry *ae;
+ struct archive *a;
+ int i, r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+ /* Read entries, match up names with list above. */
+ for (i = 0; i < 6; ++i) {
+ failure("Could not read file %d (%s) from %s", i, n[i], name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualString(n[i], archive_entry_pathname(ae));
+ }
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA);
+ assertEqualString(archive_compression_name(a), "lzma");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_lzma)
+{
+ /* This sample has been added junk datas to its tail. */
+ compat_lzma("test_compat_lzma_1.tlz");
+ /* This sample has been made by lzma with option -e,
+ * the first byte of which is 0x5e.
+ * Not supported in libarchive 2.7.* and earlier */
+ compat_lzma("test_compat_lzma_2.tlz");
+ /* This sample has been made by lzma of LZMA SDK with
+ * option -d12, second byte and third byte of which is
+ * not zero.
+ * Not supported in libarchive 2.7.* and earlier */
+ compat_lzma("test_compat_lzma_3.tlz");
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_lzma_1.tlz.uu b/archivers/libarchive/files/libarchive/test/test_compat_lzma_1.tlz.uu
new file mode 100644
index 00000000000..57fa501f00d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_lzma_1.tlz.uu
@@ -0,0 +1,10 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_lzma_1.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_compat_lzma_1.tlz
+M70``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(/
+M^W;\8!%O7<+P&=#(9W<_!$Z.7/Y<&\(8+E0^,_-\Z"D^P'N0J^4-UH"WMJ<&
+MV-P6=Y[-FY$IFNZ="RF24TO.B7EP[F]BGMJSP[]OZ_P9/#J'T=;7E&&A@J<[
+MA^C'Q*/Y&I)2^T930'MJTK-98U0D9R*-X2^5__6H:+A4:&ES(&ES('5N<F5L
+F871E9"!J=6YK(&1A=&$@870@=&AE(&5N9"!O9B!T:&4@9FEL90H`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_lzma_2.tlz.uu b/archivers/libarchive/files/libarchive/test/test_compat_lzma_2.tlz.uu
new file mode 100644
index 00000000000..ff91d2a608f
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_lzma_2.tlz.uu
@@ -0,0 +1,9 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_lzma_2.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_compat_lzma_2.tlz
+M7@``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'<FN`(!=!,)@8W
+M9R(6\QIOTA6SGM20X;2'6#3B&HC%2XOX2?D['5WD"`>`W2"/3R1F1:P:&Q9A
+MGH2JJI9$C?8.=WTE:O<1WA@X>DK-Y#SW;I2!P;NYG^2"-(D9/E(D_0XK_H,\
+95*/V"T#E9ZO][@'R,6E&^A([.##_\M#YU@``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_lzma_3.tlz.uu b/archivers/libarchive/files/libarchive/test/test_compat_lzma_3.tlz.uu
new file mode 100644
index 00000000000..bee82897beb
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_lzma_3.tlz.uu
@@ -0,0 +1,9 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_lzma_3.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_compat_lzma_3.tlz
+M70`0````'``````````S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(1
+M$Y^=;\4%U_CXKQ*F$OFZKEQUG)1U8="](V<2K"U1\Z6%H(UNQ[Y3.=D'>_G-
+MCO71X+M*7WH7$D1&E9Y$XHW,(`[X";GGTO+,'&1?F%<@`.$-OV;8P1?*M$A"
+:MA+1XONREMK,1('455L=X1>WC#1YW"('I@``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.c b/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.c
new file mode 100644
index 00000000000..ca1506a355e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.c
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_solaris_tar_acl.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Exercise support for reading Solaris-style ACL data
+ * from tar archives.
+ *
+ * This should work on all systems, regardless of whether local
+ * filesystems support ACLs or not.
+ */
+
+DEFINE_TEST(test_compat_solaris_tar_acl)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ const char *reference1 = "test_compat_solaris_tar_acl.tar";
+ int type, permset, tag, qual;
+ const char *name;
+
+ /* Sample file generated on Solaris 10 */
+ extract_reference_file(reference1);
+ assert(NULL != (a = archive_read_new()));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ assertA(0 == archive_read_open_filename(a, reference1, 512));
+
+ /* Archive has 1 entry with some ACLs set on it. */
+ assertA(0 == archive_read_next_header(a, &ae));
+ failure("Basic ACLs should set mode to 0644, not %04o",
+ archive_entry_mode(ae)&0777);
+ assertEqualInt((archive_entry_mode(ae) & 0777), 0644);
+ assertEqualInt(7, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(006, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_USER_OBJ, tag);
+ assertEqualInt(-1, qual);
+ assert(name == NULL);
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(004, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_GROUP_OBJ, tag);
+ assertEqualInt(-1, qual);
+ assert(name == NULL);
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(004, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_OTHER, tag);
+ assertEqualInt(-1, qual);
+ assert(name == NULL);
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(001, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
+ assertEqualInt(71, qual);
+ assertEqualString(name, "lp");
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(004, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
+ assertEqualInt(666, qual);
+ assertEqualString(name, "666");
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(007, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
+ assertEqualInt(1000, qual);
+ assertEqualString(name, "trasz");
+
+ assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+ assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
+ assertEqualInt(004, permset);
+ assertEqualInt(ARCHIVE_ENTRY_ACL_MASK, tag);
+ assertEqualInt(-1, qual);
+ assertEqualString(name, NULL);
+
+ assertEqualInt(ARCHIVE_EOF, archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ &type, &permset, &tag, &qual, &name));
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.tar.uu b/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.tar.uu
new file mode 100644
index 00000000000..54aabc2dde2
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_solaris_tar_acl.tar.uu
@@ -0,0 +1,61 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_solaris_tar_acl.tar.uu 191576 2009-04-27 18:27:54Z kientzle $
+begin 644 test_acl_solaris.tar
+M9FEL92UW:71H+7!O<VEX+6%C;',`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`P,#`P`#`P,#`P,#`P,30T
+M`#$Q,3<T-C`T,34W`#`P,34Q-S8`00``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,'1R87-Z
+M````````````````````````````````````<F]O=```````````````````
+M```````````````````P,#`P,C$P`#`P,#`P,3``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````Q,#`P,#`W`'5S97(Z.G)W+2QU<V5R.FQP.BTM
+M>#HW,2QU<V5R.C8V-CIR+2TZ-C8V+'5S97(Z=')A<WHZ<G=X.C$P,#`L9W)O
+M=7`Z.G(M+2QM87-K.G(M+2QO=&AE<CIR+2T``````````3````````/-@```
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````!%&8`````````&L`````,3`P,#`P-P!U
+M<V5R.CIR=RTL=7-E<CIL<#HM+7@Z-S$L=7-E<CHV-C8Z<BTM.C8V-BQU<V5R
+M.G1R87-Z.G)W>#HQ,#`P+&=R;W5P.CIR+2TL;6%S:SIR+69I;&4M=VET:"UP
+M;W-I>"UA8VQS````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,#`P,``P,#`P,#`P,#`P,``Q,3$W-#8P-#$U
+M-P`P,#$U,30T`#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T<F%S>@``````````````
+M`````````````````````')O;W0`````````````````````````````````
+M````,#`P,#(Q,``P,#`P,#$P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+H````````````````````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c
index ae71e9232c5..30785d1fb0c 100644
--- a/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c
+++ b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.3 2008/08/11 01:19:36 kientzle Exp $");
/*
* Background: There are two written standards for the tar file format.
@@ -93,7 +93,11 @@ test_compat_tar_hardlink_1(void)
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+#endif
}
DEFINE_TEST(test_compat_tar_hardlink)
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_xz.c b/archivers/libarchive/files/libarchive/test/test_compat_xz.c
new file mode 100644
index 00000000000..c3b790ffbd2
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_xz.c
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * Verify our ability to read sample files compatibly with unxz.
+ *
+ * In particular:
+ * * unxz will read multiple xz streams, concatenating the output
+ */
+
+/*
+ * All of the sample files have the same contents; they're just
+ * compressed in different ways.
+ */
+static void
+compat_xz(const char *name)
+{
+ const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
+ struct archive_entry *ae;
+ struct archive *a;
+ int i, r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xz reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+ /* Read entries, match up names with list above. */
+ for (i = 0; i < 6; ++i) {
+ failure("Could not read file %d (%s) from %s", i, n[i], name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualString(n[i], archive_entry_pathname(ae));
+ }
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ);
+ assertEqualString(archive_compression_name(a), "xz");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_xz)
+{
+ compat_xz("test_compat_xz_1.txz");
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_xz_1.txz.uu b/archivers/libarchive/files/libarchive/test/test_compat_xz_1.txz.uu
new file mode 100644
index 00000000000..9d4b8e8ee6d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_xz_1.txz.uu
@@ -0,0 +1,13 @@
+$FreeBSD: head/lib/libarchive/test/test_compat_xz_1.txz.uu 191183 2009-04-17 01:06:31Z kientzle $
+begin 644 test_compat_gzip_1.txz
+M_3=Z6%H```3FUK1&`@`A`18```!T+^6CX`^?`(-=`#,,/!NGC#0&C6L"2_R2
+M/O9*^(7KX=WM^(=KA(RH"\09$$)!Q_+JUHQ*`]R;ITL_F3/I6:^Q0550A&)B
+MHS@=K]7@K1-9FOIP#PU!I<PUHW+W#<F(6FSL/<?5:4*>?E5&IHH&Q=N>_C&G
+M-$G]+L[\,B<7%8&$NO5K31*Y>"D^*ZG,Z=H```"KU50H$1^1S``!GP&@'P``
+MLZ042+'$9_L"``````196OTW>EA:```$YM:T1@(`(0$6````="_EH^`,7P!I
+M70``;IBIKOMK%/A?-<U3^2)5\V,DQ(:ZUH:[B'3>TZV0266G?2,[/?\,JE6`
+M__C/SA[W1?*2<Y3NQ'DCK4JEJYHQU`Q\N=H9LL3KRAH,VQQ2OD*@?1NLV]<E
+MF&X."!L\R:Z]=*TJPT/BJ^``````R[PG*'(H!W,``84!X!@``/;+`G2QQ&?[
+(`@`````$65H`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_zip.c b/archivers/libarchive/files/libarchive/test/test_compat_zip.c
index fdeb9c64ac1..d8bc4de3608 100644
--- a/archivers/libarchive/files/libarchive/test/test_compat_zip.c
+++ b/archivers/libarchive/files/libarchive/test/test_compat_zip.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_zip.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_zip.c 196962 2009-09-08 05:02:41Z kientzle $");
/* Copy this function for each test file and adjust it accordingly. */
static void
@@ -32,10 +32,11 @@ test_compat_zip_1(void)
char name[] = "test_compat_zip_1.zip";
struct archive_entry *ae;
struct archive *a;
+ int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
@@ -44,7 +45,16 @@ test_compat_zip_1(void)
assertEqualString("META-INF/MANIFEST.MF", archive_entry_pathname(ae));
/* Read second entry. */
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ r = archive_read_next_header(a, &ae);
+ if (r != ARCHIVE_OK) {
+ if (strcmp(archive_error_string(a),
+ "libarchive compiled without deflate support (no libz)") == 0) {
+ skipping("Skipping ZIP compression check: %s",
+ archive_error_string(a));
+ goto finish;
+ }
+ }
+ assertEqualIntA(a, ARCHIVE_OK, r);
assertEqualString("tmp.class", archive_entry_pathname(ae));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
@@ -53,10 +63,11 @@ test_compat_zip_1(void)
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ZIP);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
+finish:
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu b/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu
index e13a6cac29d..29cdf96b029 100644
--- a/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu
+++ b/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu
@@ -1,3 +1,4 @@
+$FreeBSD: src/lib/libarchive/test/test_compat_zip_1.zip.uu,v 1.2 2008/06/30 15:49:12 des Exp $
begin 644 test_compat_zip_1.zip
M4$L#!!0`"``(``B$@S<````````````````4````345402U)3D8O34%.249%
M4U0N34;S3<S+3$LM+M$-2RTJSLS/LU(PU#/@Y7+,0Q)Q+$A,SDA5`(H!)<U!
diff --git a/archivers/libarchive/files/libarchive/test/test_empty_write.c b/archivers/libarchive/files/libarchive/test/test_empty_write.c
index 6a9f3f9c8d5..0523ec362c3 100644
--- a/archivers/libarchive/files/libarchive/test/test_empty_write.c
+++ b/archivers/libarchive/files/libarchive/test/test_empty_write.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_empty_write.c,v 1.2 2008/03/15 11:06:15 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_empty_write.c 189308 2009-03-03 17:02:51Z kientzle $");
DEFINE_TEST(test_empty_write)
{
@@ -31,6 +31,7 @@ DEFINE_TEST(test_empty_write)
struct archive_entry *ae;
struct archive *a;
size_t used;
+ int r;
/*
* Exercise a zero-byte write to a gzip-compressed archive.
@@ -39,28 +40,29 @@ DEFINE_TEST(test_empty_write)
/* Create a new archive in memory. */
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ustar(a));
- assertA(0 == archive_write_set_compression_gzip(a));
- assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
- /* Write a file to it. */
- assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "file");
- archive_entry_set_mode(ae, S_IFREG | 0755);
- archive_entry_set_size(ae, 0);
- assertA(0 == archive_write_header(a, ae));
- archive_entry_free(ae);
-
- /* THE TEST: write zero bytes to this entry. */
- /* This used to crash. */
- assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+ r = archive_write_set_compression_gzip(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("Empty write to gzip-compressed archive");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, sizeof(buff), &used));
+ /* Write a file to it. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertA(0 == archive_write_header(a, ae));
+ archive_entry_free(ae);
- /* Close out the archive. */
- assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
+ /* THE TEST: write zero bytes to this entry. */
+ /* This used to crash. */
+ assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+ /* Close out the archive. */
+ assertA(0 == archive_write_close(a));
+ assertA(0 == archive_write_finish(a));
+ }
/*
* Again, with bzip2 compression.
@@ -69,27 +71,28 @@ DEFINE_TEST(test_empty_write)
/* Create a new archive in memory. */
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ustar(a));
- assertA(0 == archive_write_set_compression_bzip2(a));
- assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
- /* Write a file to it. */
- assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "file");
- archive_entry_set_mode(ae, S_IFREG | 0755);
- archive_entry_set_size(ae, 0);
- assertA(0 == archive_write_header(a, ae));
- archive_entry_free(ae);
-
- /* THE TEST: write zero bytes to this entry. */
- assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+ r = archive_write_set_compression_bzip2(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("Empty write to bzip2-compressed archive");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, sizeof(buff), &used));
+ /* Write a file to it. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertA(0 == archive_write_header(a, ae));
+ archive_entry_free(ae);
- /* Close out the archive. */
- assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
+ /* THE TEST: write zero bytes to this entry. */
+ assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+ /* Close out the archive. */
+ assertA(0 == archive_write_close(a));
+ assertA(0 == archive_write_finish(a));
+ }
/*
* For good measure, one more time with no compression.
@@ -113,9 +116,5 @@ DEFINE_TEST(test_empty_write)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_entry.c b/archivers/libarchive/files/libarchive/test/test_entry.c
index 52820923803..b6a2da177ac 100644
--- a/archivers/libarchive/files/libarchive/test/test_entry.c
+++ b/archivers/libarchive/files/libarchive/test/test_entry.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry.c,v 1.6 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_entry.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <locale.h>
@@ -51,13 +51,40 @@ DEFINE_TEST(test_entry)
const char *xname; /* For xattr tests. */
const void *xval; /* For xattr tests. */
size_t xsize; /* For xattr tests. */
- int c;
wchar_t wc;
long l;
assert((e = archive_entry_new()) != NULL);
/*
+ * Verify that the AE_IF* defines match S_IF* defines
+ * on this platform. See comments in archive_entry.h.
+ */
+#ifdef S_IFREG
+ assertEqualInt(S_IFREG, AE_IFREG);
+#endif
+#ifdef S_IFLNK
+ assertEqualInt(S_IFLNK, AE_IFLNK);
+#endif
+#ifdef S_IFSOCK
+ assertEqualInt(S_IFSOCK, AE_IFSOCK);
+#endif
+#ifdef S_IFCHR
+ assertEqualInt(S_IFCHR, AE_IFCHR);
+#endif
+/* Work around MinGW, which defines S_IFBLK wrong. */
+/* sourceforge.net/tracker/?func=detail&atid=102435&aid=1942809&group_id=2435 */
+#if defined(S_IFBLK) && !defined(_WIN32)
+ assertEqualInt(S_IFBLK, AE_IFBLK);
+#endif
+#ifdef S_IFDIR
+ assertEqualInt(S_IFDIR, AE_IFDIR);
+#endif
+#ifdef S_IFIFO
+ assertEqualInt(S_IFIFO, AE_IFIFO);
+#endif
+
+ /*
* Basic set/read tests for all fields.
* We should be able to set any field and read
* back the same value.
@@ -69,15 +96,35 @@ DEFINE_TEST(test_entry)
* The following tests are ordered alphabetically by the
* name of the field.
*/
+
/* atime */
archive_entry_set_atime(e, 13579, 24680);
assertEqualInt(archive_entry_atime(e), 13579);
assertEqualInt(archive_entry_atime_nsec(e), 24680);
+ archive_entry_unset_atime(e);
+ assertEqualInt(archive_entry_atime(e), 0);
+ assertEqualInt(archive_entry_atime_nsec(e), 0);
+ assert(!archive_entry_atime_is_set(e));
+
+ /* birthtime */
+ archive_entry_set_birthtime(e, 17579, 24990);
+ assertEqualInt(archive_entry_birthtime(e), 17579);
+ assertEqualInt(archive_entry_birthtime_nsec(e), 24990);
+ archive_entry_unset_birthtime(e);
+ assertEqualInt(archive_entry_birthtime(e), 0);
+ assertEqualInt(archive_entry_birthtime_nsec(e), 0);
+ assert(!archive_entry_birthtime_is_set(e));
+
/* ctime */
archive_entry_set_ctime(e, 13580, 24681);
assertEqualInt(archive_entry_ctime(e), 13580);
assertEqualInt(archive_entry_ctime_nsec(e), 24681);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+ archive_entry_unset_ctime(e);
+ assertEqualInt(archive_entry_ctime(e), 0);
+ assertEqualInt(archive_entry_ctime_nsec(e), 0);
+ assert(!archive_entry_ctime_is_set(e));
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* dev */
archive_entry_set_dev(e, 235);
assertEqualInt(archive_entry_dev(e), 235);
@@ -85,17 +132,21 @@ DEFINE_TEST(test_entry)
skipping("archive_entry_dev()");
#endif
/* devmajor/devminor are tested specially below. */
-#if ARCHIVE_VERSION_STAMP >= 1009000
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* filetype */
archive_entry_set_filetype(e, AE_IFREG);
assertEqualInt(archive_entry_filetype(e), AE_IFREG);
#else
skipping("archive_entry_filetype()");
#endif
+
/* fflags are tested specially below */
+
/* gid */
archive_entry_set_gid(e, 204);
assertEqualInt(archive_entry_gid(e), 204);
+
/* gname */
archive_entry_set_gname(e, "group");
assertEqualString(archive_entry_gname(e), "group");
@@ -104,6 +155,7 @@ DEFINE_TEST(test_entry)
assertEqualWString(archive_entry_gname_w(e), L"wgroup");
memset(wbuff, 0, sizeof(wbuff));
assertEqualWString(archive_entry_gname_w(e), L"wgroup");
+
/* hardlink */
archive_entry_set_hardlink(e, "hardlinkname");
assertEqualString(archive_entry_hardlink(e), "hardlinkname");
@@ -112,12 +164,18 @@ DEFINE_TEST(test_entry)
assertEqualString(archive_entry_hardlink(e), "hardlinkname2");
memset(buff, 0, sizeof(buff));
assertEqualString(archive_entry_hardlink(e), "hardlinkname2");
+ archive_entry_copy_hardlink(e, NULL);
+ assertEqualString(archive_entry_hardlink(e), NULL);
+ assertEqualWString(archive_entry_hardlink_w(e), NULL);
wcscpy(wbuff, L"whardlink");
archive_entry_copy_hardlink_w(e, wbuff);
assertEqualWString(archive_entry_hardlink_w(e), L"whardlink");
memset(wbuff, 0, sizeof(wbuff));
assertEqualWString(archive_entry_hardlink_w(e), L"whardlink");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+ archive_entry_copy_hardlink_w(e, NULL);
+ assertEqualString(archive_entry_hardlink(e), NULL);
+ assertEqualWString(archive_entry_hardlink_w(e), NULL);
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* ino */
archive_entry_set_ino(e, 8593);
assertEqualInt(archive_entry_ino(e), 8593);
@@ -158,17 +216,24 @@ DEFINE_TEST(test_entry)
/* mode */
archive_entry_set_mode(e, 0123456);
assertEqualInt(archive_entry_mode(e), 0123456);
+
/* mtime */
archive_entry_set_mtime(e, 13581, 24682);
assertEqualInt(archive_entry_mtime(e), 13581);
assertEqualInt(archive_entry_mtime_nsec(e), 24682);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+ archive_entry_unset_mtime(e);
+ assertEqualInt(archive_entry_mtime(e), 0);
+ assertEqualInt(archive_entry_mtime_nsec(e), 0);
+ assert(!archive_entry_mtime_is_set(e));
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* nlink */
archive_entry_set_nlink(e, 736);
assertEqualInt(archive_entry_nlink(e), 736);
#else
skipping("archive_entry_nlink()");
#endif
+
/* pathname */
archive_entry_set_pathname(e, "path");
assertEqualString(archive_entry_pathname(e), "path");
@@ -184,7 +249,8 @@ DEFINE_TEST(test_entry)
assertEqualWString(archive_entry_pathname_w(e), L"wpath");
memset(wbuff, 0, sizeof(wbuff));
assertEqualWString(archive_entry_pathname_w(e), L"wpath");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* rdev */
archive_entry_set_rdev(e, 532);
assertEqualInt(archive_entry_rdev(e), 532);
@@ -192,24 +258,41 @@ DEFINE_TEST(test_entry)
skipping("archive_entry_rdev()");
#endif
/* rdevmajor/rdevminor are tested specially below. */
+
/* size */
archive_entry_set_size(e, 987654321);
assertEqualInt(archive_entry_size(e), 987654321);
+ archive_entry_unset_size(e);
+ assertEqualInt(archive_entry_size(e), 0);
+ assert(!archive_entry_size_is_set(e));
+
+ /* sourcepath */
+ archive_entry_copy_sourcepath(e, "path1");
+ assertEqualString(archive_entry_sourcepath(e), "path1");
+
/* symlink */
archive_entry_set_symlink(e, "symlinkname");
assertEqualString(archive_entry_symlink(e), "symlinkname");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
strcpy(buff, "symlinkname2");
archive_entry_copy_symlink(e, buff);
assertEqualString(archive_entry_symlink(e), "symlinkname2");
memset(buff, 0, sizeof(buff));
assertEqualString(archive_entry_symlink(e), "symlinkname2");
#endif
+ archive_entry_copy_symlink_w(e, NULL);
+ assertEqualWString(archive_entry_symlink_w(e), NULL);
+ assertEqualString(archive_entry_symlink(e), NULL);
archive_entry_copy_symlink_w(e, L"wsymlink");
assertEqualWString(archive_entry_symlink_w(e), L"wsymlink");
+ archive_entry_copy_symlink(e, NULL);
+ assertEqualWString(archive_entry_symlink_w(e), NULL);
+ assertEqualString(archive_entry_symlink(e), NULL);
+
/* uid */
archive_entry_set_uid(e, 83);
assertEqualInt(archive_entry_uid(e), 83);
+
/* uname */
archive_entry_set_uname(e, "user");
assertEqualString(archive_entry_uname(e), "user");
@@ -231,9 +314,13 @@ DEFINE_TEST(test_entry)
/* TODO: Make this system-independent. */
assertEqualString(archive_entry_fflags_text(e),
"uappnd,nouchg,nodump,noopaque,uunlnk");
- /* TODO: Test archive_entry_copy_fflags_text_w() */
+ /* Test archive_entry_copy_fflags_text_w() */
+ archive_entry_copy_fflags_text_w(e, L" ,nouappnd, nouchg, dump,uunlnk");
+ archive_entry_fflags(e, &set, &clear);
+ assertEqualInt(16, set);
+ assertEqualInt(7, clear);
/* Test archive_entry_copy_fflags_text() */
- archive_entry_copy_fflags_text(e, "nouappnd, nouchg, dump,uunlnk");
+ archive_entry_copy_fflags_text(e, " ,nouappnd, nouchg, dump,uunlnk");
archive_entry_fflags(e, &set, &clear);
assertEqualInt(16, set);
assertEqualInt(7, clear);
@@ -247,20 +334,20 @@ DEFINE_TEST(test_entry)
assertEqualInt(0, archive_entry_xattr_next(e, &xname, &xval, &xsize));
assertEqualString(xname, "xattr1");
assertEqualString(xval, "xattrvalue1");
- assertEqualInt(xsize, 12);
+ assertEqualInt((int)xsize, 12);
assertEqualInt(1, archive_entry_xattr_count(e));
assertEqualInt(ARCHIVE_WARN,
archive_entry_xattr_next(e, &xname, &xval, &xsize));
assertEqualString(xname, NULL);
assertEqualString(xval, NULL);
- assertEqualInt(xsize, 0);
+ assertEqualInt((int)xsize, 0);
archive_entry_xattr_clear(e);
assertEqualInt(0, archive_entry_xattr_reset(e));
assertEqualInt(ARCHIVE_WARN,
archive_entry_xattr_next(e, &xname, &xval, &xsize));
assertEqualString(xname, NULL);
assertEqualString(xval, NULL);
- assertEqualInt(xsize, 0);
+ assertEqualInt((int)xsize, 0);
archive_entry_xattr_add_entry(e, "xattr1", "xattrvalue1", 12);
assertEqualInt(1, archive_entry_xattr_reset(e));
archive_entry_xattr_add_entry(e, "xattr2", "xattrvalue2", 12);
@@ -271,7 +358,7 @@ DEFINE_TEST(test_entry)
archive_entry_xattr_next(e, &xname, &xval, &xsize));
assertEqualString(xname, NULL);
assertEqualString(xval, NULL);
- assertEqualInt(xsize, 0);
+ assertEqualInt((int)xsize, 0);
/*
@@ -281,27 +368,29 @@ DEFINE_TEST(test_entry)
/* Set values in 'e' */
archive_entry_clear(e);
archive_entry_set_atime(e, 13579, 24680);
+ archive_entry_set_birthtime(e, 13779, 24990);
archive_entry_set_ctime(e, 13580, 24681);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_dev(e, 235);
#endif
archive_entry_set_fflags(e, 0x55, 0xAA);
archive_entry_set_gid(e, 204);
archive_entry_set_gname(e, "group");
archive_entry_set_hardlink(e, "hardlinkname");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_ino(e, 8593);
#endif
archive_entry_set_mode(e, 0123456);
archive_entry_set_mtime(e, 13581, 24682);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_nlink(e, 736);
#endif
archive_entry_set_pathname(e, "path");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_rdev(e, 532);
#endif
archive_entry_set_size(e, 987654321);
+ archive_entry_copy_sourcepath(e, "source");
archive_entry_set_symlink(e, "symlinkname");
archive_entry_set_uid(e, 83);
archive_entry_set_uname(e, "user");
@@ -317,9 +406,11 @@ DEFINE_TEST(test_entry)
/* Clone should have same contents. */
assertEqualInt(archive_entry_atime(e2), 13579);
assertEqualInt(archive_entry_atime_nsec(e2), 24680);
+ assertEqualInt(archive_entry_birthtime(e2), 13779);
+ assertEqualInt(archive_entry_birthtime_nsec(e2), 24990);
assertEqualInt(archive_entry_ctime(e2), 13580);
assertEqualInt(archive_entry_ctime_nsec(e2), 24681);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_dev(e2), 235);
#endif
archive_entry_fflags(e, &set, &clear);
@@ -328,28 +419,29 @@ DEFINE_TEST(test_entry)
assertEqualInt(archive_entry_gid(e2), 204);
assertEqualString(archive_entry_gname(e2), "group");
assertEqualString(archive_entry_hardlink(e2), "hardlinkname");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_ino(e2), 8593);
#endif
assertEqualInt(archive_entry_mode(e2), 0123456);
assertEqualInt(archive_entry_mtime(e2), 13581);
assertEqualInt(archive_entry_mtime_nsec(e2), 24682);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_nlink(e2), 736);
#endif
assertEqualString(archive_entry_pathname(e2), "path");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_rdev(e2), 532);
#endif
assertEqualInt(archive_entry_size(e2), 987654321);
+ assertEqualString(archive_entry_sourcepath(e2), "source");
assertEqualString(archive_entry_symlink(e2), "symlinkname");
assertEqualInt(archive_entry_uid(e2), 83);
assertEqualString(archive_entry_uname(e2), "user");
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("ACL preserved by archive_entry_clone()");
#else
/* Verify ACL was copied. */
- assertEqualInt(4, c = archive_entry_acl_reset(e2,
+ assertEqualInt(4, archive_entry_acl_reset(e2,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
/* First three are standard permission bits. */
assertEqualInt(0, archive_entry_acl_next(e2,
@@ -386,48 +478,50 @@ DEFINE_TEST(test_entry)
assertEqualInt(qual, 77);
assertEqualString(name, "user77");
#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("xattr data preserved by archive_entry_clone");
#else
/* Verify xattr was copied. */
- assertEqualInt(1, c = archive_entry_xattr_reset(e2));
+ assertEqualInt(1, archive_entry_xattr_reset(e2));
assertEqualInt(0, archive_entry_xattr_next(e2, &xname, &xval, &xsize));
assertEqualString(xname, "xattr1");
assertEqualString(xval, "xattrvalue");
- assertEqualInt(xsize, 11);
+ assertEqualInt((int)xsize, 11);
assertEqualInt(ARCHIVE_WARN,
archive_entry_xattr_next(e2, &xname, &xval, &xsize));
assertEqualString(xname, NULL);
assertEqualString(xval, NULL);
- assertEqualInt(xsize, 0);
+ assertEqualInt((int)xsize, 0);
#endif
/* Change the original */
archive_entry_set_atime(e, 13580, 24690);
+ archive_entry_set_birthtime(e, 13980, 24999);
archive_entry_set_ctime(e, 13590, 24691);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_dev(e, 245);
#endif
archive_entry_set_fflags(e, 0x85, 0xDA);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_filetype(e, AE_IFLNK);
#endif
archive_entry_set_gid(e, 214);
archive_entry_set_gname(e, "grouper");
archive_entry_set_hardlink(e, "hardlinkpath");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_ino(e, 8763);
#endif
archive_entry_set_mode(e, 0123654);
archive_entry_set_mtime(e, 18351, 28642);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_nlink(e, 73);
#endif
archive_entry_set_pathname(e, "pathest");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_rdev(e, 132);
#endif
archive_entry_set_size(e, 987456321);
+ archive_entry_copy_sourcepath(e, "source2");
archive_entry_set_symlink(e, "symlinkpath");
archive_entry_set_uid(e, 93);
archive_entry_set_uname(e, "username");
@@ -437,9 +531,11 @@ DEFINE_TEST(test_entry)
/* Clone should still have same contents. */
assertEqualInt(archive_entry_atime(e2), 13579);
assertEqualInt(archive_entry_atime_nsec(e2), 24680);
+ assertEqualInt(archive_entry_birthtime(e2), 13779);
+ assertEqualInt(archive_entry_birthtime_nsec(e2), 24990);
assertEqualInt(archive_entry_ctime(e2), 13580);
assertEqualInt(archive_entry_ctime_nsec(e2), 24681);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_dev(e2), 235);
#endif
archive_entry_fflags(e2, &set, &clear);
@@ -448,28 +544,29 @@ DEFINE_TEST(test_entry)
assertEqualInt(archive_entry_gid(e2), 204);
assertEqualString(archive_entry_gname(e2), "group");
assertEqualString(archive_entry_hardlink(e2), "hardlinkname");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_ino(e2), 8593);
#endif
assertEqualInt(archive_entry_mode(e2), 0123456);
assertEqualInt(archive_entry_mtime(e2), 13581);
assertEqualInt(archive_entry_mtime_nsec(e2), 24682);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_nlink(e2), 736);
#endif
assertEqualString(archive_entry_pathname(e2), "path");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_rdev(e2), 532);
#endif
assertEqualInt(archive_entry_size(e2), 987654321);
+ assertEqualString(archive_entry_sourcepath(e2), "source");
assertEqualString(archive_entry_symlink(e2), "symlinkname");
assertEqualInt(archive_entry_uid(e2), 83);
assertEqualString(archive_entry_uname(e2), "user");
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("ACL held by clone of archive_entry");
#else
/* Verify ACL was unchanged. */
- assertEqualInt(4, c = archive_entry_acl_reset(e2,
+ assertEqualInt(4, archive_entry_acl_reset(e2,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
/* First three are standard permission bits. */
assertEqualInt(0, archive_entry_acl_next(e2,
@@ -514,7 +611,7 @@ DEFINE_TEST(test_entry)
assertEqualInt(qual, -1);
assertEqualString(name, NULL);
#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("xattr preserved in archive_entry copy");
#else
/* Verify xattr was unchanged. */
@@ -530,13 +627,15 @@ DEFINE_TEST(test_entry)
archive_entry_clear(e);
assertEqualInt(archive_entry_atime(e), 0);
assertEqualInt(archive_entry_atime_nsec(e), 0);
+ assertEqualInt(archive_entry_birthtime(e), 0);
+ assertEqualInt(archive_entry_birthtime_nsec(e), 0);
assertEqualInt(archive_entry_ctime(e), 0);
assertEqualInt(archive_entry_ctime_nsec(e), 0);
assertEqualInt(archive_entry_dev(e), 0);
archive_entry_fflags(e, &set, &clear);
assertEqualInt(clear, 0);
assertEqualInt(set, 0);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_filetype(e), 0);
#endif
assertEqualInt(archive_entry_gid(e), 0);
@@ -546,7 +645,7 @@ DEFINE_TEST(test_entry)
assertEqualInt(archive_entry_mode(e), 0);
assertEqualInt(archive_entry_mtime(e), 0);
assertEqualInt(archive_entry_mtime_nsec(e), 0);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_nlink(e), 0);
#endif
assertEqualString(archive_entry_pathname(e), NULL);
@@ -581,6 +680,7 @@ DEFINE_TEST(test_entry)
st.st_atimespec.tv_nsec = 6543210;
st.st_ctimespec.tv_nsec = 5432109;
st.st_mtimespec.tv_nsec = 3210987;
+ st.st_birthtimespec.tv_nsec = 7459386;
#endif
/* Copy them into the entry. */
archive_entry_copy_stat(e, &st);
@@ -592,7 +692,7 @@ DEFINE_TEST(test_entry)
assertEqualInt(archive_entry_ino(e), 234);
assertEqualInt(archive_entry_mode(e), 077777);
assertEqualInt(archive_entry_mtime(e), 234567);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(archive_entry_nlink(e), 345);
#endif
assertEqualInt(archive_entry_size(e), 123456789);
@@ -602,6 +702,7 @@ DEFINE_TEST(test_entry)
assertEqualInt(archive_entry_atime_nsec(e), 6543210);
assertEqualInt(archive_entry_ctime_nsec(e), 5432109);
assertEqualInt(archive_entry_mtime_nsec(e), 3210987);
+ assertEqualInt(archive_entry_birthtime_nsec(e), 7459386);
#endif
/*
@@ -613,17 +714,17 @@ DEFINE_TEST(test_entry)
/* Set a bunch of fields individually. */
archive_entry_set_atime(e, 456789, 321);
archive_entry_set_ctime(e, 345678, 432);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_dev(e, 123);
#endif
archive_entry_set_gid(e, 34);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_ino(e, 234);
#endif
archive_entry_set_mode(e, 012345);
archive_entry_set_mode(e, 012345);
archive_entry_set_mtime(e, 234567, 543);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_nlink(e, 345);
#endif
archive_entry_set_size(e, 123456789);
@@ -633,16 +734,16 @@ DEFINE_TEST(test_entry)
/* Check that the values match. */
assertEqualInt(pst->st_atime, 456789);
assertEqualInt(pst->st_ctime, 345678);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(pst->st_dev, 123);
#endif
assertEqualInt(pst->st_gid, 34);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(pst->st_ino, 234);
#endif
assertEqualInt(pst->st_mode, 012345);
assertEqualInt(pst->st_mtime, 234567);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
assertEqualInt(pst->st_nlink, 345);
#endif
assertEqualInt(pst->st_size, 123456789);
@@ -661,7 +762,7 @@ DEFINE_TEST(test_entry)
archive_entry_set_ctime(e, 345677, 431);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_ctime, 345677);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_dev(e, 122);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_dev, 122);
@@ -669,7 +770,7 @@ DEFINE_TEST(test_entry)
archive_entry_set_gid(e, 33);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_gid, 33);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_ino(e, 233);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_ino, 233);
@@ -680,7 +781,7 @@ DEFINE_TEST(test_entry)
archive_entry_set_mtime(e, 234566, 542);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_mtime, 234566);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_nlink(e, 344);
assert((pst = archive_entry_stat(e)) != NULL);
assertEqualInt(pst->st_nlink, 344);
@@ -708,7 +809,7 @@ DEFINE_TEST(test_entry)
* the necessary definitions on every platform.
*/
#if __FreeBSD__
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
archive_entry_set_dev(e, 0x12345678);
assertEqualInt(archive_entry_devmajor(e), major(0x12345678));
assertEqualInt(archive_entry_devminor(e), minor(0x12345678));
@@ -733,7 +834,7 @@ DEFINE_TEST(test_entry)
/*
* Exercise the character-conversion logic, if we can.
*/
- if (NULL == setlocale(LC_ALL, "de_DE.UTF-8")) {
+ if (NULL == LOCALE_UTF8 || NULL == setlocale(LC_ALL, LOCALE_UTF8)) {
skipping("Can't exercise charset-conversion logic without"
" a suitable locale.");
} else {
@@ -777,8 +878,8 @@ DEFINE_TEST(test_entry)
* "c89 plus GNU extensions.")
*/
wcscpy(wbuff, L"xxxAyyyBzzz");
- wbuff[3] = 0x12345678;
- wbuff[7] = 0x5678;
+ wbuff[3] = (wchar_t)0x12345678;
+ wbuff[7] = (wchar_t)0x5678;
/* A wide filename that cannot be converted to narrow. */
archive_entry_copy_pathname_w(e, wbuff);
failure("Converting wide characters from Unicode should fail.");
diff --git a/archivers/libarchive/files/libarchive/test/test_entry_strmode.c b/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
index 2941c4a4c38..ba183db025a 100644
--- a/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
+++ b/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry_strmode.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_entry_strmode.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_entry_strmode)
{
@@ -31,18 +31,41 @@ DEFINE_TEST(test_entry_strmode)
assert((entry = archive_entry_new()) != NULL);
- archive_entry_set_mode(entry, S_IFREG | 0642);
+ archive_entry_set_mode(entry, AE_IFREG | 0642);
assertEqualString(archive_entry_strmode(entry), "-rw-r---w- ");
- archive_entry_set_mode(entry, S_IFBLK | 03642);
+ /* Regular file + hardlink still shows as regular file. */
+ archive_entry_set_mode(entry, AE_IFREG | 0644);
+ archive_entry_set_hardlink(entry, "link");
+ assertEqualString(archive_entry_strmode(entry), "-rw-r--r-- ");
+
+ archive_entry_set_mode(entry, 0640);
+ archive_entry_set_hardlink(entry, "link");
+ assertEqualString(archive_entry_strmode(entry), "hrw-r----- ");
+ archive_entry_set_hardlink(entry, NULL);
+
+ archive_entry_set_mode(entry, AE_IFDIR | 0777);
+ assertEqualString(archive_entry_strmode(entry), "drwxrwxrwx ");
+
+ archive_entry_set_mode(entry, AE_IFBLK | 03642);
assertEqualString(archive_entry_strmode(entry), "brw-r-S-wT ");
- archive_entry_set_mode(entry, S_IFCHR | 05777);
+ archive_entry_set_mode(entry, AE_IFCHR | 05777);
assertEqualString(archive_entry_strmode(entry), "crwsrwxrwt ");
- archive_entry_set_mode(entry, S_IFLNK | 04000);
+ archive_entry_set_mode(entry, AE_IFSOCK | 0222);
+ assertEqualString(archive_entry_strmode(entry), "s-w--w--w- ");
+
+ archive_entry_set_mode(entry, AE_IFIFO | 0444);
+ assertEqualString(archive_entry_strmode(entry), "pr--r--r-- ");
+
+ archive_entry_set_mode(entry, AE_IFLNK | 04000);
assertEqualString(archive_entry_strmode(entry), "l--S------ ");
+ archive_entry_acl_add_entry(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ 0007, ARCHIVE_ENTRY_ACL_GROUP, 78, "group78");
+ assertEqualString(archive_entry_strmode(entry), "l--S------+");
+
/* Release the experimental entry. */
archive_entry_free(entry);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_extattr_freebsd.c b/archivers/libarchive/files/libarchive/test/test_extattr_freebsd.c
new file mode 100644
index 00000000000..4b19d276297
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_extattr_freebsd.c
@@ -0,0 +1,172 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_extattr_freebsd.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+#if defined(__FreeBSD__) && __FreeBSD__ > 4
+#include <sys/extattr.h>
+#endif
+
+/*
+ * Verify extended attribute restore-to-disk. This test is FreeBSD-specific.
+ */
+
+DEFINE_TEST(test_extattr_freebsd)
+{
+#if !defined(__FreeBSD__)
+ skipping("FreeBSD-specific extattr restore test");
+#elif __FreeBSD__ < 5
+ skipping("extattr restore supported only on FreeBSD 5.0 and later");
+#else
+ char buff[64];
+ const char *xname;
+ const void *xval;
+ size_t xsize;
+ struct stat st;
+ struct archive *a;
+ struct archive_entry *ae;
+ int n, fd;
+ int extattr_privilege_bug = 0;
+
+ /*
+ * First, do a quick manual set/read of an extended attribute
+ * to verify that the local filesystem does support it. If it
+ * doesn't, we'll simply skip the remaining tests.
+ */
+ /* Create a test file and try to set an ACL on it. */
+ fd = open("pretest", O_RDWR | O_CREAT, 0777);
+ failure("Could not create test file?!");
+ if (!assert(fd >= 0))
+ return;
+
+ errno = 0;
+ n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, "testattr", "1234", 4);
+ if (n != 4 && errno == EOPNOTSUPP) {
+ close(fd);
+ skipping("extattr tests require that extattr support be enabled on the filesystem");
+ return;
+ }
+ failure("extattr_set_fd(): errno=%d (%s)", errno, strerror(errno));
+ assertEqualInt(4, n);
+ close(fd);
+
+ /*
+ * Repeat the above, but with file permissions set to 0000.
+ * This should work (extattr_set_fd() should follow fd
+ * permissions, not file permissions), but is known broken on
+ * some versions of FreeBSD.
+ */
+ fd = open("pretest2", O_RDWR | O_CREAT, 00000);
+ failure("Could not create test file?!");
+ if (!assert(fd >= 0))
+ return;
+
+ n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, "testattr", "1234", 4);
+ if (n != 4) {
+ skipping("Restoring xattr to an unwritable file seems to be broken on this platform");
+ extattr_privilege_bug = 1;
+ }
+ close(fd);
+
+ /* Create a write-to-disk object. */
+ assert(NULL != (a = archive_write_disk_new()));
+ archive_write_disk_set_options(a,
+ ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_XATTR);
+
+ /* Populate an archive entry with an extended attribute. */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "test0");
+ archive_entry_set_mtime(ae, 123456, 7890);
+ archive_entry_set_size(ae, 0);
+ archive_entry_set_mode(ae, 0755);
+ archive_entry_xattr_add_entry(ae, "user.foo", "12345", 5);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Another entry; similar but with mode = 0. */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "test1");
+ archive_entry_set_mtime(ae, 12345678, 7890);
+ archive_entry_set_size(ae, 0);
+ archive_entry_set_mode(ae, 0);
+ archive_entry_xattr_add_entry(ae, "user.bar", "123456", 6);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close the archive. */
+ if (extattr_privilege_bug)
+ /* If the bug is here, write_close will return warning. */
+ assertEqualIntA(a, ARCHIVE_WARN, archive_write_close(a));
+ else
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /* Verify the data on disk. */
+ assertEqualInt(0, stat("test0", &st));
+ assertEqualInt(st.st_mtime, 123456);
+ /* Verify extattr */
+ n = extattr_get_file("test0", EXTATTR_NAMESPACE_USER,
+ "foo", buff, sizeof(buff));
+ if (assertEqualInt(n, 5)) {
+ buff[n] = '\0';
+ assertEqualString(buff, "12345");
+ }
+
+ /* Verify the data on disk. */
+ assertEqualInt(0, stat("test1", &st));
+ assertEqualInt(st.st_mtime, 12345678);
+ /* Verify extattr */
+ n = extattr_get_file("test1", EXTATTR_NAMESPACE_USER,
+ "bar", buff, sizeof(buff));
+ if (extattr_privilege_bug) {
+ /* If we have the bug, the extattr won't have been written. */
+ assertEqualInt(n, -1);
+ } else {
+ if (assertEqualInt(n, 6)) {
+ buff[n] = '\0';
+ assertEqualString(buff, "123456");
+ }
+ }
+
+ /* Use libarchive APIs to read the file back into an entry and
+ * verify that the extattr was read correctly. */
+ assert((a = archive_read_disk_new()) != NULL);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_pathname(ae, "test0");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_entry_from_file(a, ae, -1, NULL));
+ assertEqualInt(1, archive_entry_xattr_reset(ae));
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_xattr_next(ae, &xname, &xval, &xsize));
+ assertEqualString(xname, "user.foo");
+ assertEqualInt(xsize, 5);
+ assertEqualMem(xval, "12345", xsize);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ archive_entry_free(ae);
+#endif
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_fuzz.c b/archivers/libarchive/files/libarchive/test/test_fuzz.c
new file mode 100644
index 00000000000..e5dede93216
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_fuzz.c
@@ -0,0 +1,166 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_fuzz.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * This was inspired by an ISO fuzz tester written by Michal Zalewski
+ * and posted to the "vulnwatch" mailing list on March 17, 2005:
+ * http://seclists.org/vulnwatch/2005/q1/0088.html
+ *
+ * This test simply reads each archive image into memory, pokes
+ * random values into it and runs it through libarchive. It tries
+ * to damage about 1% of each file and repeats the exercise 100 times
+ * with each file.
+ *
+ * Unlike most other tests, this test does not verify libarchive's
+ * responses other than to ensure that libarchive doesn't crash.
+ *
+ * Due to the deliberately random nature of this test, it may be hard
+ * to reproduce failures. Because this test deliberately attempts to
+ * induce crashes, there's little that can be done in the way of
+ * post-failure diagnostics.
+ */
+
+/* Because this works for any archive, we can just re-use the archives
+ * developed for other tests. */
+static struct {
+ int uncompress; /* If 1, decompress the file before fuzzing. */
+ const char *name;
+} files[] = {
+ {0, "test_fuzz_1.iso.Z"}, /* Exercise compress decompressor. */
+ {1, "test_fuzz_1.iso.Z"},
+ {0, "test_compat_bzip2_1.tbz"}, /* Exercise bzip2 decompressor. */
+ {1, "test_compat_bzip2_1.tbz"},
+ {0, "test_compat_gtar_1.tar"},
+ {0, "test_compat_gzip_1.tgz"}, /* Exercise gzip decompressor. */
+ {0, "test_compat_gzip_2.tgz"}, /* Exercise gzip decompressor. */
+ {0, "test_compat_tar_hardlink_1.tar"},
+ {0, "test_compat_xz_1.txz"}, /* Exercise xz decompressor. */
+ {0, "test_compat_zip_1.zip"},
+ {0, "test_read_format_ar.ar"},
+ {0, "test_read_format_cpio_bin_be.cpio"},
+ {0, "test_read_format_cpio_svr4_gzip_rpm.rpm"}, /* Test RPM unwrapper */
+ {0, "test_read_format_gtar_sparse_1_17_posix10_modified.tar"},
+ {0, "test_read_format_mtree.mtree"},
+ {0, "test_read_format_tar_empty_filename.tar"},
+ {0, "test_read_format_zip.zip"},
+ {1, NULL}
+};
+
+DEFINE_TEST(test_fuzz)
+{
+ const void *blk;
+ size_t blk_size;
+ off_t blk_offset;
+ int n;
+
+ for (n = 0; files[n].name != NULL; ++n) {
+ const size_t buffsize = 30000000;
+ const char *filename = files[n].name;
+ struct archive_entry *ae;
+ struct archive *a;
+ char *rawimage, *image;
+ size_t size;
+ int i;
+
+ extract_reference_file(filename);
+ if (files[n].uncompress) {
+ int r;
+ /* Use format_raw to decompress the data. */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_raw(a));
+ r = archive_read_open_filename(a, filename, 16384);
+ if (r != ARCHIVE_OK) {
+ archive_read_finish(a);
+ skipping("Cannot uncompress %s", filename);
+ continue;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ rawimage = malloc(buffsize);
+ size = archive_read_data(a, rawimage, buffsize);
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_next_header(a, &ae));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_finish(a));
+ assert(size > 0);
+ failure("Internal buffer is not big enough for "
+ "uncompressed test file: %s", filename);
+ if (!assert(size < buffsize)) {
+ free(rawimage);
+ continue;
+ }
+ } else {
+ rawimage = slurpfile(&size, filename);
+ if (!assert(rawimage != NULL))
+ continue;
+ }
+ image = malloc(size);
+ assert(image != NULL);
+ srand((unsigned)time(NULL));
+
+ for (i = 0; i < 100; ++i) {
+ FILE *f;
+ int j, numbytes;
+
+ /* Fuzz < 1% of the bytes in the archive. */
+ memcpy(image, rawimage, size);
+ numbytes = (int)(rand() % (size / 100));
+ for (j = 0; j < numbytes; ++j)
+ image[rand() % size] = (char)rand();
+
+ /* Save the messed-up image to a file.
+ * If we crash, that file will be useful. */
+ f = fopen("after.test.failure.send.this.file."
+ "to.libarchive.maintainers.with.system.details", "wb");
+ fwrite(image, 1, (size_t)size, f);
+ fclose(f);
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+
+ if (0 == archive_read_open_memory(a, image, size)) {
+ while(0 == archive_read_next_header(a, &ae)) {
+ while (0 == archive_read_data_block(a,
+ &blk, &blk_size, &blk_offset))
+ continue;
+ }
+ archive_read_close(a);
+ }
+ archive_read_finish(a);
+ }
+ free(image);
+ free(rawimage);
+ }
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_fuzz_1.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_fuzz_1.iso.Z.uu
new file mode 100644
index 00000000000..07a3e934da4
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_fuzz_1.iso.Z.uu
@@ -0,0 +1,495 @@
+$FreeBSD: head/lib/libarchive/test/test_fuzz_1.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_fuzz_1.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GA0%`(,)$`4'QT(0``F'H@``@"(PJ)`"(A"04(6#"0"
+M`!P4E..+`;'(Q@(6),!``^"$>&)`*`+0X9),-NGDDU!&*>645%9IY9589JGE
+MEEQ>V<0224SQA!%3@!#F$R#D8(,-,+R`!)D@&)$$$T5,D<445!2AH1!5S$E$
+M$5*`8`((%Q8QQ!-2/"A@"U*\0(05BDI11!!4(`H""D.D`$(,.>0P`PA%N)#%
+M$U4X<0010=!Y:::;=GH#"$JX`,6D4HCIQ`NQ3C$$$G,RD82I708K;+`R$(A#
+M##'(4&P.R<8P`X'@%`O#L<DNV^RS,(!#X+;<=DL@`-)2JRP,S,K@++0'#JON
+MNNRVZ^Z[\,8K[[STUBOE?_@N)H"`!!H8D!$`R`%`&0,#(`0`4P!`A)(,@]#P
+MPPX[/(3"`$@!P!,`-`'QQA%O;!"((D91P@M%<)1BB@"L&'`"`R4@!P8):6`C
+M`.X45#./*0/P8Y!#%HDDDB9V+#3'1`]M=-%('ZUTTDPO[7334#\M==143VUU
+MU5A?K7767&]]M<9+`)`$PA<C2+;#8R>,L<,Y`&"#VP#``,`7`"!A=L(.`SPV
+M$P"4G'`69%/1=\8,'UR%V`#PO7#)%CML`L,3+VQQR1-C;/'"$E/<0L5S4VP%
+MQ9E/#D`074-=^M2G,QTNLN.6>VZVJU=+[K70>FO[MN`:R[JUYF(+3KKV!B_\
+M\,07;_SQR"</9;[,'_8/OP6:V/STU%=O_?78%_=E$B!,$08=(#CQAAT@*`L"
+MN3HDF_ZGX2K0QAIIS/&&&7.4[T*!(+101?Z!MJ!$_F\`P1C(X(+X!7"`7R!#
+M&@26O08Z\($0C*`$LW*@'/WL9^(0R(%(]P$`I$.#HPN""$=(PA*:\(0BS)D'
+M0"@'.7RA#>,K`QD.-`Z!A(B#`%B'0`800A3Z\(<I/%`(!$*`T0&@B.$@XNBV
+M5<1M*#$(_2IB-9Y((!D4\1E4A,$,BIB,+-*@B,/(8@V*V(LLVJ"(M\CB#8H8
+MBRSBH(BKR&(.BEB*+`:AB)_(HA"*F(DL#J&(D\@B$8K8B"P6H8B'R*(1BAB(
+M+!ZAB'O((A**6(<L)J&(;\BB$HJ8ABPNH8ACR"(3BMB%+#:AB%?(HA.*2**`
+M%!&*,'A"$</FRB7"``I%+%DM81F%(OX@BU(H8MMV2:`I%'$&6:1"$3='3!A4
+MH8@GR*(5#D0.@13`B!ULAT`,T$,@>K.$1[I10`Y@Q`-Q0R`L(]V!K"$0!903
+M`-`0R`+>J0R!,."=Q!!(`][I"X$XX)VX$,@#WBD+@4#@G:P02`3>:0J!2."=
+MH!#(!-ZI"8',2)T`H(1`*O!.1PBD1AA%A$`N\$Y!"`1F&.6#0#+P3CL(1&88
+MA8-`-O!.-0@D1Q@E@T`Z\$XO"&2%&,6"0#J(48L%Q&$8Y5M`AHA1@`7D1A@%
+M@D!&\$X="(0$[Z2!0$KP3A<(Y'$818%`HHG1<@A$K!BE:D!4\,YN"&0%[[R&
+M0%CPSF@(9',8789`O(K18@CD!>_\A4#DAM%<""0&[YR%0&3PSE8(!)D8/85`
+MM(K14`BD!N_<A$#>AM%*".0&[WR$0'#PSD0(I&T8'81`K(K1/@AD!^^\@T!X
+M\,XX"*0'[UR#0'SP3H(%Y)<8I5M`I(I1P`6$=!A-6$`.AE&-!61B&#V"0!:&
+M4=(%I&08A>V_WHG9@$@7HX`-B-TPF@*!C`VCYA"($MZ)U8"$#:/>$`C?,(H-
+M@6@,H](0B!/>R0R!8`RCQA`(%-X)#(&0"*.Z$(C%,$H+@20,HZX0B.`PB@J!
+M'`ZCHA#(YS#*"8&D$J.6$(A0,0H)@0`.HXH0B!;>20B!;.&=?A`(%]Z)!X&4
+M$J,,!(!/,<H&@=`-HV80"!C>.>2`A.&=*PZ(&-XIN("$$J/[#8A.,6JW@!`,
+MHP<+2)`Q2MN`G.&=;PL(&MXIMX!T$J-L#8A-,7H.@>@6HUP-2(\Q^@V!M.&=
+MV1"(&]XY#8%D$J/-$(A,,7H,@=@6H\$0B,`PN@N!S.&=M1`('=[Y"H%4$J.I
+M$(A+,3H*@<@6HYT02(TQ>@F!Y.&=D1"('MZY"(%$$J.%$(A*,?H'@;@6HZ<.
+M2(PQ^NB`U!JC=PX((-[YY8`T$J-'#HA),?KB@*@6HX<+2(LQBK&`Q!JC8PN(
+M(=XYL8`D$J.X#8A(,0K:@)@6HX@-2(HQ"M>`M!JCZ!`((][YN(`4$J/@$(A'
+M,:H-@8@6H]002(DQZ@R!I!JCR!"()-XI#($$$J.\$(A&,6H+@7@6H[`02(@Q
+MJ@J!E!JCI!`()M[I"8'T$:,C#TA%,;KP@&@6H_,.2(<QNNV`A!JCPPY(R3&Z
+MZH#D$:.3#DA$,;KG@%@6HV,.2(8QNN2`=!JC,PY(R#'ZN8#4$:,##DA#,;K>
+M@$@6HPL+2(4QRMN`9!JCI`U(QS'*V(#$$:-T#4A"K3O!NMO][GC/>WBDAZ,C
+M^3T@&0P`#@7R0<%_\_`CS-E/3]3"%\9PA@.IH0`&'Q`=#@#QF/\[`(9(`-(5
+M42!)[#P3!^)$T1?H\P&9HNFM.!`LFGZ+`^FBZ;\XD#":?HP#*:/ISSB0-)I^
+MC0-IH^G?.)`XFGZ.`ZFCZ>\XD#R:?H\#Z:/I_SB00)I^D`,II.D/.9!$FGZ1
+M`VFDZ1\YD$B:?I(#J:3I+SF03)I^DP/II.D_.9!0FGZ4`RFEZ4\YD%2:?I4#
+M02*F)TL#$3:FATL#43*FUTL#\4NF%TP#T3:F9TP#@4RFITP#L3FF]TP#$4VF
+M-TT#44T%0'D`H$T&@'F(IWDW<@`8)1#GE``M&!#LI``Q"$\`L``U6$\,4(/Y
+MU``UV$\.4(,!]0`U6%`04(,)%0$UV%`24(,1-0$U6%$44(,:50$UZ%$64(,B
+M=0$U:%(84(,JE0$UZ%(:4(,RM0$U:%,<4(,ZU0$UZ%,>4(-"]0$UV#@UR#<A
+M4(,`(P(U*%4C4(-610(UJ%4E4(->90(U*%8G4(-FA0(U2%4J4(-NM0(U*%<L
+M4(-VU0(UJ%<N4(-^]0(U*%@P4(.&%0,UJ%@R4(..-0,U*%DT4(.650,UJ%DV
+M4(.>=0,U*%HX4(.FE0,UJ%HZ4(.NM0,U*%L\4(.VU0,UJ%L^4(,$\P,U2#=`
+M4(,G5H,)(P0UJ#%#4(/2A2J:1SJ3HGFP900UB%E'4(.`A00U6%Y)4(/II00U
+MB%5+4(/QQ00U6%]-4(/YY00UV%]/4(,!!@4U6&!14(,))@4UV&!34(,11@4U
+M6&%54(,99@4UV&%74(,AA@4U6&)94(,II@4UV&);4(,QQ@4U6&-=4(,"XP4U
+MV&-?4(-!!@8U.&1A4(,K)@8U*#AC4(/[108U:#=E4(,'8P8U2%MG4(-O@P8U
+M*#=I4(-LI08UV&9K4(-<Q08U6&=M4(-YY@8UV&=O4(.!!@<U6&AQ4(.))@<U
+MV&AS4(.11@<U6&EU4(.99@<UV&EW4(.AA@<U6&IY4(.II@<UV&I[4(.QQ@<U
+M6&M]4(.GY@<U^&A_4(-W!@@U^&6!4(-')@@U^&*#4(.'0P@UB#&%4(-C8P@U
+M.#&'4(.XA0@U"%J)4(.(I0@U"%>+4(/QQ@@U^#B-4(/YY@@UV&^/4(,!!PDU
+M6'"14(,))PDUV'"34(,11PDU6'&54(,99PDUV'&74(,AAPDU6'*94(,CIPDU
+MN'";4(/SQ@DUN&V=4(/#Y@DUN&J?4(.3!@HUN&>A4(-C)@HUN&2C4(,S1@HU
+M^#FE4(,#9@HUN%ZG4(,+@PHUR%NI4(.DI0HUR%BK4(-TQ0ITIW<8FJ$:NJ$<
+MRAL'4C,7!``A`@LH,SK#=@LEBEQ&I*(LNJ(NVJ(P^J(R&J,T.J,V6J,X>J,Z
+M&@0A$@LF8B1!,&RX8"(\M*-&FJ-(>J1*FJ1,NJ0K&B*R8"*?%Z0`D`LF<DU.
+MVJ1:FJ5<NJ5>^J0`,`LFPDVC$R*T8"(OPJ,`4`LFPC)E"@"V8"+N]*;O($_'
+M%2+P8$]W"@#QH$][*@_^M*?S(%![2@\&M:?UH%![:@\.M:?W(%%[B@\6M:?Y
+ML%%[J@\?M:?[,%)[R@\GM:?]L%)[Z@\OM:?_,%-[ZG<6I*9)`@`\]:8"8"(K
+M]*8#8"(=]*8$$#1[6@`F,D1O:@`F(DYJ>@`FHE9JB@`FTEYJF@`F$F=JJ@`F
+M4F]JN@`F$DUOR@`F(E9OV@`F4EYOZ@`FDF9J^@`FTFYJ"@$F$G=J&@$FPDQJ
+M*@$FXE5O.@$F$EYJ2@$F4F9J6@$FDFYJ:@$FTG9J>@$F@DQOB@$FHE5OF@$F
+MTEUJJ@$F$F9JN@$F4FYJR@$FDG9JV@$F,DQJZ@$F8E5O^@$FHEUJ"@(FTF5J
+M&@(F$FYJ*@(F4G9J.@(F\DMO2@(F(E5O6@(F8EUJ:@(FDF5J>@(FTFUJB@(F
+M$G9JF@(FHDMJJ@(FXE1JN@(F(EUOR@(F4F5JV@(FDFUJZ@(FTG5J^@(F0DMJ
+M"@,FHE1JZB^$\Z8R8")1IJ8S8"+5IJ8T8")9IZ8U8"*MI*8V8")&I:8W8"+*
+MI:8X8")-IJ8Y8"+1IJ8Z8")5IZ8[8"*I]*8\8")"]:8]8"+&I:8^8"))IJ8_
+M8"+-IJ9`8")1IZ9!8"*E]*9"8"(^]:9#8"+"I:9$8")%IJ9%8"+)IJ9&8")-
+MIZ9'8"*A]*9(8"(Z]:9)8"*^I:9*8")!]J9+8"+%IJ9,8"))IZ9-8"*=]*9.
+M8"(V]:9/8"*Z]:908"(]]J918"+!IJ928")%IZ938"*9]*948"(R]:958"*V
+M]:8@&#![>@4FTFMJB@4F$G1JF@4F4DEOJ@4FXE)ON@4F(EMOR@4F4F-OV@4F
+MDFMJZ@4FTG-J^@4F$DEO"@8FHE)O&@8FXEIO*@8F$F-O.@8F4FMO"GD`D'-J
+M6@8FTDAO:@8F8E)O>@8FHEIOB@8FTF)OF@8F$FMOJ@8F4G-JN@8FDDAOR@8F
+M(E)OV@8F8EIOZ@8FDF)O^@8FTFIO"@<F$G-J&@<F4DAO*@<FXE%O.@<F(EIO
+M2@<F4F)O6@<FDFIO:@<FTG)J>@<F$DAOB@<FHE%OF@<FXEEOJ@<F$F)ON@<F
+M4FIOR@<FDG)JV@<FTD=OZ@<F4E%O^@<FHEEO"@@FTF%O&@@F$FIO*@@F4G)O
+M.@@FDD=O2@@F$E%O6@@F8EEO:@@FDF%O>@@FTFEOB@@F$G)OF@@F4D=OJ@@F
+MTE!ON@@F(EEOR@@F4F%OV@@FDFEOZ@@FTG%O^@@F$D=O"@DFDE!O&@DFXEAO
+M*@DF$F%O.@DF4FEO2@DFDG%O6@DFTD9O:@DF4E!O>@DFHEAOB@DFTF!OF@DF
+M$FEOJ@DF4G%ON@DFDD9OR@DF$E!OV@DF8EAOZ@DFDF!O^@DFTFAO"@HF$G%O
+M&@HF4D9O*@HFTD]O.@HF(EAO2@HF4F!O6@HFDFAO:@HFTG!O>@HF$D9OB@HF
+MDD]OF@HFXE=OJ@HF$F!ON@HF4FAOR@HFDG!OV@HFTD5OZ@HF4D]O^@HFHE=&
+MU*%F?=9HG=;LP7<U\Z,:E'$;E',GDD8;U*5V_:5X?==W;20GTD8W)-<!$%`\
+ME->$K=>%?=@WRM<!4%"O!-B&=4V('=F&/=F'K=B*Q4UJBB0-QB*9?2*1EDZ*
+M77'NU-D`4*?S1-IY>D^DW:?[1-J`^D^D/:@#1=J&>E"DG:@+1=J,^E"D_:@3
+M1=J2>E%\#0"5RE&DC:D@-=R;2E*D[:DH-=RARE*D3:HP-=RG2E.=;2(XI=@'
+MPE/9'2)`I=@\1%2*741(I=C7Q%2*S4U0I=CD1%79S2)8E=TLPU79[4Y@I=CS
+M1%:*?4]HI=C[5%[9_4]LE=T#!5?9?5!TE=T+A5>*_5!\I=@3!5C9/2.$I=@<
+MA5C972.,E=TD!5F*#3.4I=@LA5G9+3.<I=@T!5K9G2.DE=T\A5J*O4*LI=@=
+M!%O9[3"TE=U#A%O9?2.\E=U4!5R*C57$I=CV_:9(\CC,I=C1!%V*+5;4I=CE
+MA5V*S58`D]UP]5V*35?CI=B;<UZ*[57KE=V`]5Z*+3?SI=B(=5^*S5C[E=W(
+M]%^*K54#EMV8=6"*_38+IMB@]6"*35H3IMAM<V&*;54;IMBP]6&*35LCIMBX
+M=6**S5LKEMV_]&+9+54SEMVD<V.*?3`[IM@3\V.*O3!#EMTE<V39#3!+EMW2
+M]62*;3=3IMAC<V6*O5Y;IMAA\V79S3=CEMT:<V:*O5]KIM@8\V:*/6!SIM@D
+M<F?9;3%[EMT)\V>*+3B#IMB'<VB*_3F+IMBI]&C9+523EMV`<VF*O6*;IM@O
+M]FF*/6.CIMBE=&K9[5.KEMUT\VJ*/62SIMA'=FN*O62[IMBA]&N*K5/#EMT$
+M<VR*'63+IMA?]FR*/6;3IMB==&V*;5/;EMVZ]6V*W6/CIMAW=FZ*O6?KIMB9
+M]&Z*+5/SEMVV=6^*+3#[IMB/]F^*/6D#I]B5='"*[5(+E]VR]7"*76,3I]BG
+M=G&*O6H;I]B1]'&*K5(CE]VN=7**'6,KI]BU]G**/6PSI]B-='.*;5([I]BJ
+M]7.*W6)#I]BQ=G2*O6U+I]B)]'2*+5)3I]BF=76*G6);I]BM]G6*/6]CI]B%
+M=':*[5%KI]BB]7:*76)SI]BIYEC9O7`1EMV!5&G9K5$9E]V>U4;9'6(%E=VE
+MIEC9/7(-EMU]%&G975$5E]V:E4;9W6$!E=VA9EC977()EMUYU&C9'5$1E]V6
+M54;9G6']E-V=)EC9'7(%EMUUE&C9W5`-E]V2%4;976'YE-V9YE?9W7$!EMUQ
+M5&C9G5`)E]V.U479'6'UE-V5IE<7JM;JO_[LW_[0(5(6-!`[,A`^`B1"0B1&
+M<C((`P7$Z@MU*@52@%<%`BB`!7!6.[A00:`=8*F!4`#009$*"`,@WA@$*F`$
+M()8#V!GW#QQ@P)ZQ`8G$$"@"&$L7\)T``-(*@C8A".T@R,2_FZ)X>H3.L'\]
+M(_\!C0````4@`32`"%`!%H0&^``!0`0\"!30`G9`#0@#B<00U!D`((,0A`R"
+M,^H?S\!_%P1%!($:&``2@1-H`L!J=-S``'``!T("[($0T`$.A!\X`2M@`+B`
+M19`(/D$UF`$!@*3Z(`3A@S3!%[@&9>")H$,HZ)M002O8!`2:X<F#@#`0"L)!
+M2`@%X0?$6*]J("1"@H#/!@(L6#6S:B"L$)CQJ8:@'0P`"*#QP!`[($,J1@"L
+M@E>06P4,%[()9<@6S$I>L`VHE8$P`L3@#D$'KC`,!L$S.`1K81IT?[@P%^K"
+MQG`%W5@W*83`,!@*PQ&R!;N@0/B"!2$"]D`R6!!F(1I<@[9P#>[":4@-JZ$U
+MO(8X(<A$PL5#"0,"S+"$4?!`4,$!6``#`"H\AJJP(+3"90@+V:$SC(89\`BJ
+M0!W1`G,&./0[*((&?D)RB`.]H`XD"#QP#$K`9F@&GV$\3(-'4*;XJH$P1.;@
+M/3P94_`3)H,KF`6#0#',@6#0!\9"C0@$"R(\Y(!I4%+D*@`P:9((04@B#C$-
+M7D+3(S>HX$3$@AOD(OK#X180!,!&9(8$X1TBQ)VX!D7B@9@T3H0@.)&46`>C
+MH.E!+"Z1(L;$<F@,CTL[R(C*4"!V1"'($P]B3SPD/Q$`3!&",$6(8@9<B;"$
+ML21%F*@%F2)&3(8W<2#F1(]8%4'B51R)DP:+$`0LXA5CH%&$)<AD+%9$F7@,
+MGR):9(=3D1:V12,8$K$B200`7"WVU$,G^!7O(H'0*GIQ*?;#O@@5TV)@-(AN
+MT2IF0)]X&(E:[5F,=+`QXL/;XPEYU4O<BV;1'U9&P%@&J2(T'(S@@#-.&I:6
+M>T#C0T02NZ<T!H#3*!FYX%DD"%'Q%5[&CT@8WV)6I&B]QS:J1,<(`T!+9"R+
+MD]$IKD:IV!H%XVN\CIO1,$X:?A9\E&-1'(VPA+0\1XN8&BGC7Z2.!-$U:L;,
+MV#-D(P`@9\7'.XK&%'%\="-OA(Z^436>1^%8'3%C<5R/1,(],K/D(Q_M(G@D
+M$*1C//)%Z;@?P^!PA(U#T#W2LN93(*'@@80!!T-!ED<&"1PM8W\DCFRP/6I'
+M`,#)HD^%]!D7<F)HR.@X.OQBAV2-Z=$Z`L@0&2!')"&K/B<2+!((R2$1E2)^
+M;(HM<CKRQQCI'VFDD>2,:V'2L+'LDR.9(^/HD621/+)(9/@BT>-:5(_L\3^*
+M2+@(`*A8]VF2%Q)@K,C\:!ZKY)"\DC(R2Q[)$<G#P@^8I(^P1+J,22!))04B
+MC$2311)$ND<25G[>)&Z$)79C3OY&.VDE!X).Q(YJTCTRL/3C)T_$^K&//E)*
+MDDD.22C/I*%DBXA22]9(+EF_VD^C#`#O!U)&R049)!LD1_R0$+(P<LGN%7\^
+MY?P1E:AQ2KK(2ND@466F7)-<LGC5'U<)2_B&H-2/9K)6$DD0&2%'9.O*/[R2
+M0&B,7UDF:>6I'):ITC@>QLK5?Y(E#-@OS))2OL([>2FQI*;$E5FQE00@:VDY
+MH&2LG)2E,E@^2SQ)+%5E5J0E!<A:#IALF2Z=)4[LEFGR6Q9++JE+$I"U)!'T
+MLDYNRT(I83#EC-R76=%F-2!K:3$"YJP<F):R8'I+(XDP#^,PB4#6,F$X3"$I
+M+-EEM,R.7-)@52!K*3@VIJF\EQ(S7U),=WD8F4D&LI:'PV2J2Y09$`[EP629
+M2V'26*L.9"T_A\RTEVH17^9)V(@DL:'1/)I(,VDJS:<09!:B0&B(]"\T&DC]
+M-PY)I<`,@]PR90[-6PG`MF%`F(0#X1LN1WR((JA@*+":[6`53A4/"2UOY1"$
+M`DP`6P5-`!!O>HPXF1EUT4)"Q#T8*=$FQUR70K-=2L.E23@+I^$\G)DAR-Q-
+M@7`C\B:*I)K[T&^>S+E9,PVFFI2'FZ<@0$T8(37UY@RLFANR7D+,CADX/V;/
+M0()J,R!0%<=Y"04/WQR5H?-J:L2L63DG)HA$G+@S=^K.W=D8@DSJ!`"K,VK>
+MQA,A#B-G['R86)-@UDZ5>3L59T%HG,)S;)X,?6@#C^??I)D`P&9>SEO88]K+
+M0,`JK#,<1D1>Q0?/)9U$GK-3>69/RZDO;R'O?)_P,W[*S[D09+SG5?F4Q;-Z
+MRLKK23G7I^V$C0#`=ZI#_$D]`P`_1)>R,SB23JTI.-M@CXDS`X&KA$^R.3Y!
+M(>S<GY/S0;I-]SD_.Z@'_:`@-"L$&0BZ5?"G;CR@YY-_:M";*0WK9T$`G]'S
+M.TY/T(E!9V;_U)[M4QKVF'HS$!['!-V;G[!\]L84FD%M)0MM@R$TB2K1)<I$
+M@T*0X:%?Q8324`2*/A4HX&2@II-(!%``0$(#@@2-H?/Q<QK/&@HT5^CVE(8U
+M9A>,0))6$(Z@^*2"F:!O6L\BVC:/:,\8`G$S`.S,L=)$^Z@?_:.`M",$F3T:
+M$*+)#P4:)U1RVE`SFD/;H,#PF@``;%9"Z2E&>=79/)Z_<QVJ3QRZ,M<@W,16
+M4#0@/(X>HZT&@E@YI,2S@@K1'SDH1^<579Y;<T8&TEE*2VNI+24(0::4GA4I
+M.D:IJ`HUHF>T#0[2@F!(P>C4K*0&5)&646#:2$]GC_%6`Z&\H%(I^#K-9RM-
+MGA$3EC;0TWE+NZDW_::!-,A`4X$@38VIYR2>B72.+E)FVDF%*0#0I0'AE)K3
+MQXE,4>@U39_9U'\R3P#:8]+,0&`KT]1U!E$Y2D9=*?;DI+<3G"K4A<I0Y6>0
+M\:<"`:#.T]:93@LJ-EV@VC2+YAMQ6A#**><<GOEPBA+1=5I'@ZDS!0#M9B#`
+ME8"J2@FJ+Z6C'G.##LZ&2E-KJDU%FD$FI;X57JH_7RI)C:EV5(L^U((@43\J
+M)26>!=2>`LME6E*;J1;M,7%G(-`5EEI-A^@]M:('E7VV4VYZ4[NJ5_VJZR_(
+M1-6YPE.3J3IEJD#5I`I5E%H05NI$#8=)59D:U!NJ56]G&EVC!\&-4E`XZE)'
+M*EHMG3(U`^)1;.4R[PI8/:R(-;%FCR!36`/"Y@BH%=6G_E4L&EA/YR,M")+4
+M&W9.>HI4S2;:S*1L,ZTZ57#P20/`6`T(=*7'R*N!X%6HZD"]H))UKC+2K:I%
+M%:MMO:VX-3\$F=6Z5\JJ4FV6LI6=-D\`T%B)*P$5J5<UM`+6H)IO>DQX&0B`
+MQ;62S[Z:7&FG/HVE:C*W:M?MREWM0Y!YKG_%M\K5B_I*K^LV7:N\-2"TUK=*
+M-N/J60VN396V-M>X41#DAG2UH-9TJ<)7T2I?NZM__:\`UCP$F3(S$.PK>X6<
+M/=6O[M?EJE8W*@``KP$ANA[8>CI>\2E&-:\:%0FFFX&`6.[K*I64"I:\9M7_
+MR34#K(D]L2BV.@29#7M8Q.M[%;%TE<3*T@%;7X]K+PVQ%K:\(E1^"BX*`F/Q
+ML-15O\+8V9I04ZR1/;)(EC@$F;8S$'[LA$6GR%7(YM@1NT^YYHHM"!WVR8;4
+M&UM=-VE=!:!W=2`$`#9*$/0J$.55<12VXEBL&F.K[(P<K`%`9#Z6)$MGZZR=
+M50U!1LX&!&0"6:,L<!VRPA6`7E:"D%D!@-B4H<CTDLI*T&I==^RM+*U,=K$@
+M084U$+0*D%6S73:?.EI9>F<[K:?]M(D3`%#:R>)B+>J4;;/8]5MN43T+`/BL
+MEBV;7%;*LEDBRV.[RT#`+)<VO_[94TMK2RRH_;7`-MA2AB!C:R]+J8VM@#:^
+M#M=1&Q`L[:MUKZ9VU@9:KMECPLQ`>!NYUJK*6N5*69FKL/VVX#;<&H8@8VTW
+MR[%=L]PVHU;6M5IL`P*N?;9^5ELF6_YZ.WM,N1D(H"7;LM)MVVB_K*\5MP`W
+MX`I<^@D`[NUG.;>9]L)NVNQ*;@L"MH6WL7;72EMERV/3SD`@+?H6Q"9<'>MO
+M.>W`_;@@-^22A2!C<4<+PN6W7E;&,MR"6Q#R+<1-L!N7RJ9:(PD`PJP&(;,#
+MP<P"C0J:9G6MO.6UT_;-YM&+>5I$KM$]NDA7*009HAL0VD:?C;@_=^+26T$;
+M23&KH0V;F[5U%E!%2T49;<IULVJRM);<@$!:>HS(&@A6)>-66*G+8$=KTGV[
+M<#?NZH0@<W97R\F5N.D6PZY;!\MT`8#3?;EF-=KFW86K:GN,=AD(L$7MOEB@
+M2W'_K=Q]O)`W\LJ$('-X7\O=C;J#M^.NW+H;$-(NX/VMF+??JMS""P"ZS$"@
+M+8I7\(I>L*MJ):_K?;VPMR0$&=,[6RZOZ)RW;;>_4MZ"D'@_[]K-O*.7YO:8
+M<#,0<$OJ1;:,=^HZWMC+?)NO\XT(08;XWA;;FT"!+^NEN;.W(*!>W[MXV6ZW
+M;;!(L.P,!-YR?-'MZIVY>O7YJM_URWX'0I`1O[N%^E91ZXM^;V'T+0C&E_NJ
+MWJ];?]$H`%"C8A;G"@2=FTKY*J9%N9I6\WY+.*LP!4(#;K\0.`(?W2#S@`'`
+M+WFZ,!<!*UP%3','K22\NI,4T7;63\AUSZ?73<#!]VWF4?@;$'A+C]%9`T&J
+ME-^8BVK/:[Z1P#@X!P_<(`.#!8(,?K61U?SR7QN\12OP!=:_R-?[JEMO.V<*
+M`NF8P1J8XZ9@#JJ#J[`5_KA;Q@G+WU_:>&<L`.C!P\7&9F"\>WZ)<(_),@/A
+M8$!A,CR$,^P5?L-P&-P&&30L$-0P$(ZWMS?YYM[AFOZ,2$"%MDF8_IIA`-!M
+M!L+$6,.AMPWOW3C,B!NQIPTRA5@@'.([#'7SL!+6N]YV#A<$.VQ41?"6'<.)
+M&`5?WR/88\+.0%@8B-@2"V(W[(A;L2M&L4'&%$^7+0Q3]S``A<0%81)WXC`Z
+M@D&Q*B[#&=;F(@D!+&<XZ)D-`#U7V[)A4=Q_!6L>[9<"`1J_XFE,C6]JD)'&
+M@P,#!]Y`#(P7L0?FAE@7I,):2_I9U>$JWKNE518'A(718YS*0``8J;CZ=F-O
+M6XWKL3U>J$'&'0L$>$R)?;$\5L29>'`0A)+QA_'P/V;&@]AJ#03I$H_G[SP&
+MO_<X(DMDFAID%+)`8,C]>!L+882<8?-Q0>#'N_B8]F*-3(-[K2SM,55F(-B-
+MALR%E:_'G<@P.2;7TB"3D@7"2L[(H/<7`V3P6Y$+`D8.R>?T$Y/D*"QS!W&V
+M&0AC@R77XN_K=F6R4W[*?33('&7S0HM_JBVVLG6C(-QDH,Q9A7)./L@;>`KK
+M4`#0=0;">E'*5IDI]U>HS);;L@<-,F59O53ER;J$>3+B(`A)&0EOY+`\BF^A
+M,#X1Q'BS@I`"_`F3\;Y=QGRY&=_1/`HO!4)C=LN0.3)?PR#SF`%`V-#&7]DA
+M[V2W^XV_)@C6K.)XZY9C@J!).3(ZSJ-Q.2"LEQZC5`8"WT#+=!D30V3)3)MK
+M<RX,,JU9OLSE!:N6AVMEOLQZN20'W>S:8YS+0-`8L)DWU^6F;)N;LW.>AD'&
+M.-N7W8Q[>_,M3AP%X34'9Z)<@S-LCXDR`V&_).?JO)S7\G,^S^A9_049\*Q?
+MJ+,>MLY863H'!.2\G1&S%.[+8[G:#`2,,9[?<WDNLNDY0`OH#!5D]+-_<<^7
+MF/!B7P#`G@.">*[/H3@Q#^*L,Q`&3'].T!PX_0[H#<VA(TB0H=`"!D&?XX!L
+MH`,"?X;0.MDT>]N_/&;SJC'>N0;8YZ9H":U1X:RX-#`=.D?K:/\09&YT0"`1
+MF/GW/F3.7'4)[6>^NJ'9LV)2<SRDY6MI!=$!0=EQ#H)@,2[TB)[-.SI+:VGY
+M$&2,RD"HTCA92&]FW0L`?'29%L-#V3X79>],-@A"PK#231I`;^DY3:?I0Y!1
+M+@/A38?I[GNEW6Z7+@A@FBMK78.LF54T^.TQ3<90XL^6>H#5='=>Q'4Z4DMJ
+M]Q!D$K6$$=%Q^CKC:0>#IC-S2[[*)QD`1)N!<#C@])B6TY,Z5:OJ\!!D1K6%
+MP=2G^CI;ZIK9J<6TH7:[/:;J#(3/8:IOM7E>U<`Z6&N'(*.K-0RL]M7#U54'
+MA%*-HL'R?5;,6I1%!V8"3$T+<Y!UU"993<)9:NEAA+6W_M;((<APZX"02H(T
+MG\[47+,S5]UNB*2/JE`NP3GP!-/HTXRMBG5`^!P])G,-!*'2J^<U/0;7`#M@
+M]X8@HZ]%S+'VUW9Y7`.`<MVL"S7"QM4`P+@,!,#1KY\U$1;8&#MC!X<@([%-
+MS,&VV!T9`!3L@,"O&_:GAL^A.LD,A!53L=<TI-;8,#MFWX8@H[)5S,=VV0&Y
+M8P<$BFVRE_)_YK'-9B"\F);]J/^US#[:2+LU!)F@[6)N=M&VRS4[(+#LGIV6
+M?S:U!0!19R#,&**=K5MOTO[:8+LT!)FL+6.<=M=>T$P[(`QMJAV;%?01E-8N
+M>J8>8\.L<;GSV1Z"</98VIBPS;?[MF0(,GH[()02<[U_D375A:2%]M#RXG<]
+MFEEAGW;2>91L!X09TV-BUT#P*5Q[.'MMO\VY._>XU3$%`7/OZ<+]L,ETX`8`
+M@YMM*V?9#+&%RT"@&YF["V=7STV[:_=B"#*NV\>8;<V]H"VW0!#=@AJN$NJ3
+M;;5#=9$9"$,F=KODV6V[F[?S#@PQJ2`D[]'-C6,U5L[=`0%VJV[RS+K[:X])
+M-@/AR"AO4,V\G[?Y/M]W(<B`;X$@OJGW7@;9BSAZ$X3I';S;Z_#VV=V[W@*`
+MIC,0ELSX1MGE&WT+\`'>%H(,_Q8(_MM]"V?9K6K5=T%HW_5[AE9B9XVSP2_<
+M-@C46J"BV6L=H>$W<X6SNE(@A'`"3L)+.%8(,B,<`(02PEV]#7>Z+M(?F%TK
+M;I',N)<T:7[<(+*T'G`E@P23UT#0*?^[>`=P$T[$B[A3"#(^7"``<05NMWDW
+MYDSA*WQ[^^?\S6-]RT`@&$&<BB]?(\[%NSA4"#)67"!@<2:.K9VX_04`25S*
+MU.IS;;U#=?1ROXNZJA[F#E[!F;,7O^-X7.EN45RZNQGX@@[C5F:-DVX/?J@!
+M0+$9"%\FB[MM*IS'&[DC!PI!YI`+A$1.QNGXT_;3>QR.%^0)[K`).<1..@-A
+MS"CR#,W('[DI/^4V(<B`<H$@RBOYC/;D9%J2>QE!WL)+MUW]OW@5@[]HPKS!
+M&[4EO]MI$,ZR2H$PS%&Y,3_F(B'(%',`T$E8^/NNX_U572?NK"N\27#C7IOH
+M>D:6UE4N9I!@^!H(-F64BV4DBLS+N3G?"$'FFPN$<.[**?@E)]/+O)E+<0P]
+MSD]J^1H(ND6<XV=R?L[[N3\7I`#@GKN9/KZ\&S@`4.=JAI8_\W>NO]-7SHWC
+MKU5&NW-@/E/_N46_Z!0AR#CT`4S0R;=!%^@!(9_/<QS.8X/-0+@S^AQ:WV",
+MSM);.D,(,B;=SG1T`&[0-[J<4>@+O*`+7P!0=`;"GDGI%]NE"_6A#L=[NIZ9
+MZ4+<H,?T@(#21WHVSZX7O(WN\FK=RR5Z)X?F(!+.=DH_0]2[NCD/,EL](&02
+M9Y[3/7H'AN'@.`0O[G$<`."U/Y37L#R'YU&C'A#V3(_)7P-!I@!U5NS5^[HI
+M#S)X7=`@=2WNA<,Z`!CK3KV-$V<`T+\&@FW9ZR_;KTOV<QYD&KNA&>R+O(4"
+M@,`>$/1Z8G?AH3K'*!J(/EU]^2O'Z@!TLJOV<AYD1'M`$!ADO8G[<<QIV0/"
+M8__LMIS']IJ!\&@@N]%>[<#]D0>9W>YH,#LIU^RN'8!M<G]\U1DZCPTZ`V'2
+M^'8L'=RK.QX/,M!=TACW>KY6B7M`Z.VX/:Z#65P>@.,V.9_;'/RT._=;"6<7
+MI:6Q[O!]@`<9]QX0*DEL+^.S_19*\R,]PX,R6W?K?1&NH_9'FT>S>T"8-#T&
+M@@T$ES+=[7A\?_"V.\@H>$VSW??YZ9SO!<&^A_<!'ZHIV$"0+0W^5T/X$2_?
+M`8"']S057J5OT0D?$!C\AE_OH1J##80:$^)1-8F_\<X[R,AX49/BB7"0.?$!
+M`<2_>(KN0`%`KAD(IZ;&IW8<S^1SO)$O"$F^G3=W(G_A:VY!H/%#WHR/Y9XS
+M$%:-DM_B33[,]^T@P^5538\/V4?>U.!TV:[3WS9YO[GFG:NB=],^T;6\,\96
+M?-+5B/D]'[.#3)X/")'DOO]R.V]9T;IGEN'4W'Y;<QONN)_ZMRRM93X@K)H>
+M@\(&@DKY\B^9SVMZ<!UD*KVL.?/Q&P#\>5&_YO%[F^>>`("%#037@NF'^*9_
+M]1H[R*AZ6P/J`[*G#PB7/LOG][$,PP9"C&GUFQO6"WN,'61ZO4#X]5*>>!/V
+ME3OK`P*KU_6G?BS3L(%0:X`]S1WVV%Y@!YEI+Q"J?;+'WYG=G1I[75/J!_VN
+M+_)R32`,&VNOH;.]NP?602;="YM:;Y>YO:\I]^J=RD?K-S^,XWQMW:O6FLY/
+M>4+O`?-HFQ0(!__=*_P<'602/@!H)((^WQ/\?+/?$7V27O2+EDDK]D>?1^7]
+M#4."0&P@F!1V7\H7OLD/T`RO((S\;U^UE[U!=_@0']J;=5(,`(C80%`M)+^B
+MG_R=KZ6#C,T7"#B?Y;?MX^Y.0[Y`6/D1G,*R<="^V)'80&@Q.9^?\_RIS_`!
+M@-,7"%!?Z*_N<%_E?[ZSP?=U_MR?5"8V$&)-U.>J5#_M;^@@0_8%@MG7^MR;
+MZZ_5JR]MP/[`%_M/%0#4G(&P;<[^OU?[@#\]!YF]+Q#Z/MR?XG+?P;9]:V/W
+ME7WBM_(`&,[K<KD-HP.^57?\1'\Q8RLO*1`X?^#__$XYR'C^+DGOB33BYN^)
+M7H*38T:/S3>^D2RMA%_;($$L-A!$BM]?Z:`_]\/D($/[!8+M/_STW,*OU=&?
+M2)9[FC;WT;[(<[&!8%INO^Y__I(YR"Q_@=#\@3])Q\J]7]PT?G"?^?,^&!L(
+M*<;Y0__QSY:#S/<7".'?^COZ!3W]S<WV;_F/O\>0L8'0:L0_^;__,3G(S'^!
+M4/_5O^O'G.>?NO'^#7W<W7P5<PP$\X;]A_\M@/=8D'$`RANE'YFV_[D;`^#6
+MU_WE&U%=F375:7#(6'H7]B5_FE\`L"0)!",@`V@"5F%!1@D(`!02$=\'.//I
+M=X;>NA:.N6O_W36G.EU_VEP>]0`&!/-&CP''#`0>A0)X`@Z!$EB0\0/J&Q'@
+M<*4"LH`R'TVWT]$Q`X%H(002@53@&Q9D0('^1A)XG1V!`4$0V`0F=3L='C,0
+ME!A38!5H!N9@0888*'!H@5@9%A@02(%?H,NWT_$Q`T&J40:>@7A@^Q5DT($&
+M!QOHA:F!`0$9&`?&?P!`RS$0+!QW8!ZH"#I?088AJ'#X@2L7'Q@0V(&#X`4(
+M^>5R4AWEQ\MU@`(?YE<`PEDWDL.Q"(Z"D5>0$0H&!(%$"WCW@8!:5,4W`WIB
+M-2#K=P.N?RH8MN((!@0+1X^!R`P$&D4B2`K^@B!7D+$+2AR0H$%W"@(`J6`E
+M6``B08S,0.!9^(+`8#3X=@49S:#%40PN:,-@0-`+*H/"WWP%R0P$(08T*`V.
+M@R)7D/$-:AS7(.94#08$SR`WJ.+U&)3,0%!JB(/D8#TH<`49\:#'D0Z><>=@
+M0!`.NH.#6,HQ$(P<]*`]:!#*80"`0"AR[(.:73X8$,R#`&$PQN\!9O[>2C?G
+M77[<WR>81Y5()L=!Z!$&6T$&1Q@0]!&JH"?8#79-5I?%1P.*9K(@\(0#AEUY
+ME$(8$(P</08H,Q!4%`7A1Z@3FEA!ADTH$."$_A_39]")A"12!1CW68(]!BDS
+M$&@6.>%.Z!0F64&&4B@0,(5!86Z'E?F$*H=1B/@AA0``*C,0=!A-X5,H%L)B
+M76%!`!96A>(=5B85NAQ:8?#W#@(`K,Q`$&J$A6-A7?A?!1EQH4`P%Z*%'-[*
+MY14*!&=ATC>2>6H9X4G88\`R`T')01?:A8RA=A5D((8"@6+(%\)X*U=>:'.T
+MA2^AJI4!YEP;(,_E`:Z"+^`:!&=-2`(!:=@8GH:X59!A&@(`>41)6!BJ>*Z@
+M6D?#Q8(9WPU'"Z9!I15DJ',@0;C,0!!1+(:H87`(3@49O:%`\!M.AOJ>@[4:
+MMH81X2+68_`R`X%E`1P*A]2A315D0(<"@72('$Y\6U1Q*'1@AK?A6`;,#`09
+MQG18'9Z'^%B+4!"4A]LAWN=@88=&!WCX_Z%ZQ,Q`T&F8A^AA?MA-!1GUH4!P
+M'[:'K*"#-1X*!.RA8.B5V6I68:B&S`P$(0=^J!\^B+-4D+$@"@0-(H`8&KI3
+M_:'3(1\*A3379CB`=88QFC*&_%V((>"`)!"8B!!BBFA+!1DH(@!01[B&\)\E
+M&!N"9BNADE8;-GKSH2>51TV(4@<2!,T,!`V%@Z@B#HF\4Y#Q(PH$0:*%Z`1B
+M3BWBB]@<,F$``#4S$$@60B*1:"6^95%B04`E*HE@(.9T)&H=&V*"N-AA,P-!
+MA5$E7HEH(OP49)")`H&9R"7*@9B3E"@0;(D&(EM'&,:(RV"/P<T,!)G&F9@F
+M_HFY4Y"Q)PH$?>*;^/BMB06!FU@G`F(+77*(!($S`T''X2<"BI1BX11D0(H"
+M@:1H*%J"@F)!4"@NBO<;GG@2>HC%F"9(U7&"&*&HJ-+!6?"10-`J5HJP8I'X
+M'A4$<02,2`">A#-BNP8+LH0W8NO'(=:"`0"FJ'8@0>C,0)!03(JQ8K(85@$`
+MQ:)`<"QNBLM@D/$JSHK&WYUX*[Z%[,Q`X%@@B\IBM[@+!1G9HD"P+4*+)V&0
+MT2S*'6%B6ABJP3,#083!+7J+\&+[$V2PBP*!NT@NJGC@8D$P+H**G)Q)^!;2
+M,P-!I?$NQHL$8UH39`",`H'`>"_Z>```O1@0V(O\(G/G+PYBC9!`D'$,C`5C
+MQLBA!!D58T!P,2Z,(1O"&!`HC!'C\2?QN8>78'DW^9UWE5]5)R*>C`$BG,4=
+M"00SH\9H,]YF`$#-F#,RA(Y4##C-77RK7Z\X"^:(&5!IU3$"`!E'CP'0#`0%
+M!<9X,SZ-UD.0L30*!$TCR!CJZ8QM1+6((*J+BQU!,Q`H%DXCU"@V0A!!AM<H
+M$("-5F-`-C4&!%5CR6@M6H!Y(@"`T`P$F\VKQ:BEBM=B4#<V[HVZ4)`Q-PH$
+M=6.=&(25=4OB&6<V!@1HH]NX-?:%I!=#,Q!$&F$CWR@Y4@]!AN,H$$".::-=
+M]C<&!(&C"P0TFHPN8.$XED$T`T'%$3E.CJ@COA!DD(X"@>F8.6)REF-`@#DJ
+MCDN?F*@93H0MVLHHY[6,J.++&#IVB<%<'H4<"03#8^IH/$X004;Q"`"D$;8B
+MW(@K^HRHW^<(X#E%`AYER/%A*ZQC0%!Q]!@8S4`04)R.QV/XN!X$&=VC0/`]
+MOHYDFO+(/#Z)A1Q',Q`8%N"C^"@_<FE52D$`/Z*/PU7Y&!"<C[3C(,<X[G0E
+MD$"08,2/\V,!V1X$&0%D0#!`XH_7F?LH$-R/_6,MQS627@)8HT%`&I`8)'H0
+M9%20/&.5ET`"``MD!-DH<H<]!DHS$$0<%V0&J4*.!T&&"2D0H)`,)%;&06J-
+MM>,$V2'BCM,:B&CY^8Z@H>AXYP4`M)%`$$2ND$2D;@4`#)%'9`?9"D*/*N&N
+M:"-V71K?KX@;YE$N9$`0<?08,,U`T$^DD$5D%^D<!!E9I$"P1<:07A@264;0
+MD/ZC];C3T30#@6#!17J1<*2*!0"PD0*!&TE&KEQA9$`P1HJ0A"/P.);A-`-!
+M@?%&QI&$)'009`"2`H$@>4<:='1D0&!'\I%L'HF8]_$T`T&B,4@6DICD<A!D
+M4)("@26Y2"YHB&1`H$A"DJ:>)#E?`34#0<-Q26:2K*1Q$&2@D@*!*OE)8DZ<
+M9$#@29*2(Z(/>3J1BH+9&[5#SG$PHRD)9WE&`@$QV4H>DZP:`&!,*I-*),7'
+M1+Z":QVO"$7:AD1CSU!:P9(!0</18R`U`T$^L4HBD^!D;!!D<),"@3<Y2YYQ
+MRV08@49*D/\CS<?4#`1^Q3<93LZ3N$&0\4X*!/'D.:G9D9,!@3F)2P:3NF3>
+M!]4,!`&&/$E/'I2S09`Q4`H$!:4^Z4[=DP%!/OE/_HYP(JI'U0P$A89!B5!N
+ME*Y!D'%1"@09I4-9Y2V4`4%#.5'VD'YDD8?5#`0)AT;)4;Z4J4&0L5(*!"VE
+M2+E6?90!04AY4DZ,$F'DU^_ICO_>1<A#\I1[%YR5&`D$1R5,J50F!T%&4HD8
+M-9,HH9'61$:33Z0)%D7:CJ]?'C53!@0)1X\!U@P$]81+N52.E<,6`/!5"@1A
+MI4WI8#F57<0Z.4*BC#T&63,0Z!5B)5EI5VX&089<*1#0E6KE%G56!@1IY4[Y
+M&@YB_05!T%_4E7=E8FD9!!F%Y4!P6/:5>65!P%<*EJKB(!9H$`2!!F*I6&Z6
+MD4&0<5D.!)DE9`D`-)8"P6-)6>:-;%K!01`4')HE9^E:,@9!AFHY$+"6HN5G
+M*1"$EJ>E\ZCB\9(9G&?8"0Z6-5H>)1>U'J]E<5D;!!G#I4!`%_65N6)_UY71
+MAM,DCBA%ZHC8BFPI$!0</48\01#$$ZVE<>E=IF\VR'8)52*7!<%RF5L>A7&C
+M74$0V!7=Y7?I7OH%089Z.1"PEZ*E=CD0<)?L(\267Q`$^45[^5[^EWE!D+%?
+M#@3]I6@I7PH$].5YN17&C7T&0=!G^)<`9H1)%P09#>9`\&"*E@.F0%!@*IAN
+MX2`6<!`$`0>$*6&.F&]!D/%A#@0AIFA980H$%R:'F1G>D#XE10A46H2\(]VV
+M.*J1>%L>M14-!#LFB>EC:@9!1H^9>D"5S67JEVC9@"YA>%@TYE$GID`0</08
+M[`1!P$Z(F#]FE:D5!!E1YD`P98J60J96E"ZVDZB>7$$0R!54II5I9H8%08:8
+M.1"0F:)EEBD0;)DNII)Y4M47!$%]46:>F7@F5Q!DT)D#@9TI6JJ9`@&;&6=6
+MDWE?GD$0Y!EW9IZI:%X%08:A.1`@FJ(EGRD0^)F#YG19Y/4;!$&_D6@NFIRF
+M5!!D8)H#@:8I6CJ:`@&D66EBE6Y>C)D[9H(LXR9H8]:08*9HF$<%1:1'IVEK
+M%@9!!JTI$`Q%S.4S*1OZ=]*D54E-6IK69!X%:@H$_4:/<4X0!.?$IGEK/IL]
+M09"Q;`X$S:9HJ6L&!+SFJ6E#TGQN!4'@5CB;T&:X210$&=WF0/!MBI;3I@OR
+M9>*8J%Y\01#$%^"FN"EO_@1!AKLY$,";HF6Y*1"<F]IFK%GDU1D$09T1;\Z;
+M!.?<!0``G`.!P"E:VIL"`;[9;[*;8QGN%Q#D&P-GP6EQU@1!AL0)`%"<HB7"
+M*1`HG`^GH\A;ZI`N(S"9`-%$(LJ+F6-B*R;10-!R7IPPIUH09+R<`0%*).6A
+MG#:1G+E$GGY3Y6P8;,9K5^6V.45B*QJGQAES'IW/09"A!`T$3)!HN0(%!///
+M2;D`61,J)ZI70Q`$-43%B71NG2A!D'%U1A[C91)4$#2=(2<)"0!4$P1!-:%U
+M<IULYT@09*"=(4C8^74*!%EG?NF]`0!F!4%@5JR=;6??Z1$$&7GG0+!WBI9P
+MIT"@=MJ=^EMZ01"D%WRGW^EX9@1!AN(Y$#">HF7@*1`,GF4G7`D`M!D$09O1
+M>#Z>H&=&MWD6!)ZG:"EY"@249^89(")!<U.\\7F&GK#G0Q!DM)YA)^<Y$)2>
+MJJ<IF3)*?JSF[NAJ?H9$Y0>71SE-2T7L:7PV!4$&'#00R$%.)SWD5N9`4V=`
+M$!`1FUJ4I*)#$`0ZQ#2%!PU#C)H?Q'U^G^!G^%D('4(!@#I0$)B?!L'1>#0>
+MGW=E+[1!B)_P9_QI0MR8CB+[:7]F!T'&]3D09)^BI?))>*R;CJ*D<@(-!-J$
+M]@E^OD[>I_RI@"Z@\"?YR0X4!`]H^ED0K)_WYU+I?OY"#&@&"@RA33AGU:GS
+M5:`@:-)9@IA`\E<'JG,Z6/JG0,!_YIX!I=$9@KZ@KL&-`*(,!#<#$":#V@P$
+M%%9!HHA9'Z.!>$.HARB*F+4^&H@'#V5CA$HV2*B3`H,NH7+!C5"G$`1U"F1U
+M(\0I8I;KN"AB%7D*09"G3%,_*!/JA4H0-T(6.A!LH39H:5,01*'/%E;1IQ`$
+M?0H76M9\H7!H`W$CK*$#01M:AHJA`@$9>H4"`(`*00"HN*%]6!PJB#8/-T(?
+M.A#\H64H'2H0V*%[Z*!"$`PJ@.@@*HE2#S>"(SH00*)EJ"$J$""B>ZBA0A`8
+M*I'H)"J*X@LW@B<Z$("B9:@E*A!@HGMHHD(0)"JAZ"@JB^X'-X(K.A#`HF6H
+M*2H0H*)[**-"$#`JL>@L*HS:!S>"+SH0`*-EJ"TJ$."B>^BC0A`\*L'H,"J-
+MQ@<W@C,Z$$"C9:@Q*A`@HWNHI$(02"K1Z#0JCK('-X(W.A"`HV6H-2H08*-[
+M:*5"$%0JX>@X*H^>!S>".SH0P*-EJ#DJ$*"C>RBF0A!@*O'H/"J0B@<W@C\Z
+M$`"D9:@]*A#@HWOHID(0;"H!Z4`JD78'-X)#.A!`I&6H02H0(*1[J*="$'@J
+M$>E$*I)B!S>"1SH0@*1EJ$4J$&"D>VBH0A"$*B'I2"J33@<W@DLZ$,"D9:A)
+M*A"@I'LHJ4(0D"HQZ4PJE#H'-X)/.A``I66H32H0X*1[Z*E"$)PJ0>E0*I4F
+M!S>"4SH00*5EJ%$J$""E>ZCF@:9H65WH5"J6/@?BQ`CD`@F.56E!@)7NH:T*
+M(A65CJ5P*7!P([2EZ)04&J+X'7\85A&KB%DAPEL:E_ZEN\&-L)=J$'UI&4J7
+M)@EYJ0\T`O$0?BE@ZIC:!C="K2)F,:9EZ&"*)!2F>^A(I$$4$8WI8^J9Q@8W
+M@F:*&YE0D>EBFH,"`+R*F'5-=*:?:6O*&MP(J:D&L9J6H:*IHW2:9D$:!#?!
+MFKJFO.EI<"/@IDB";EJ&QJ9(PFRZAQ(K8A8YL9OVILRI:+""C$#*:1D*G)X(
+MPND>BJR(62S"<MJ<;J>=0>,T`F6G92ARJD%$IWLHLR)FL0S:*7>JGF(&-X)Y
+MJD&@IV7H=:I!@*=[*+0B9KD3Z>EZJI].!C>"?:I!X*=EJ'N*),"G>RBU(F;-
+M$_GI?JJ@.@8W@H&J02"H9:A_BB0`J'LHMB)FW1,)ZH*JH28&-X*%JD%@J&6H
+M@XHD0*A[J"BD0>P3&>J&JJ(2!C>"B8HDH*AEJ(>*)("H>RBX(F;]$RGJBJJC
+M_@4W@HVJ0>"H9:B+>B+`J'LHN2)F#10YZHZJI.H%-X*1JD$@J66HCXHD`*E[
+M*+HB9AT42>J2JJ76!3>"E:I!8*EEJ).*)$"I>RB[(F8M%%GJEJJFP@4W@IFJ
+M0:"I9:B7BB2`J7LHO")F/11IZIJJIZX%-X*=JD'@J66HFXHDP*E[*+TB9DT4
+M>>J>JJB:!3>"H:I!(*IEJ)^*)`"J>RB^(F;-"(GJHJJIA@4W@J6J06"J9:BC
+MBB1`JGLHOR)F<129ZJ:JJG(%-X*IJD&@JF6HIXHD@*I[*,`B9M4(J>JJJJM>
+M!3>"K:I!X*IEJ*N*),"J>RC!(F:1%+GJKJJL2@4W@K&J02"K9:BOBB0`JWLH
+MPB)FP0S)ZK*JK38%-X*UJD%@JV6HLXHD0*M[*,,B9K$4V>JVJJXB!3>"N:I!
+MH*MEJ+>*)("K>RC$(F;)#.GJNJJO#@4W@KVJ0>"K9:B[BB3`JWLHQ2)FT13Y
+MZKZJL/H$-X+!JD$@K&6HOXHD`*Q[*,8B9D6=GJ.[%I8NK!RK5W`C6*P:!,9J
+M#]&``$##.@)!K'LHQR)F\10):\?JLM8$-X+*JD&PK&4HR(HDB*R,D<^)58`L
+M8M8*T;*^K$`K3'`C\*P:A,]:ALJL2`+-NH>2+&)6!_&S!JU0ZTIP(S"M&H33
+M6H82K4B"T;J'HBQBEL/PM$:M8*M)<"-PK1J$UUJ&4JU(@M6ZA[(L8M;FE+%Z
+M8AMKV"JW)@4W`MNJ0;BM(RLL6+(J"2.0V;J'PBQB%O3D@[ZA<VOA:A3<"("K
+M!B&XOJUKW=YJMR()>&O."FQB%32+F!4\#:Z!J.&JN3*LP-,(=+DRKK/AWIJX
+M(@F+:]X:36(5.(N8!4-AKIMKZQH4W`BIJP:QNH*N_MW>6KEJ$)^KZ:JS<E$C
+MT!?%NKJNP"M/<"/P+&*6[TJ[/I=[:^R*),RNNNOD"@``+6*6#P66$J[!:_4*
+MLSZO(Y#TBI;RKL7K:4JTB%G%U.]JO8ZO,\&-\+UJ$.'K\4I1W0C0JP:AO:JO
+M<!56@;2(6?*4^$J^WJ\NP8TPOVH0]2O\2C;MK><KDI"^-J_/90"`53`M8I9'
+MY;^F"'$K_NK`H@0W`@*K02BP!.SZ^DZ-0/UK!1N_`@!0BYA55"VPERGU^L".
+ML"3!C=#!:A`?K`;[OT:P(Q`%*[D6L%@%U2)FN57V*PEKPX8$-X(,JT'0L"`L
+M.F7"CD`I[`NK=6$56(N8-55-KYGK#:O$9@0W0A&K01RQVZL.BR3PL"KL](15
+M<"UBUF.%Q"ZQ7&Q'<"-@L1J$%KN].K%(`A3;P^9#6`78(F:M5S5L%^O&4@0W
+M@AJK0;"Q9^R!\,6.0&)L'6O`/E@CD(35QKZQ@.Q#<".0+6*6'UO'[JUR+))`
+MQU:Q,Q!6@;:(60;6'QO(3K(*P8WPR&H0D>PA.\CVL:<IVX(D9%F2+"4KRCY/
+M`(`G>R*`LIILW#`"9;*,+%*%5;PM8I:3%<J.LK3LW@K+:A"R;"IKR@8`J&PK
+MB\:V6B.0JS7+UK*B[(TPMXA9PFPJ>\LB";FL+XLB8!5WBYCE;`VSQ.PD>R-$
+MLQK$-)O*'K,:1#+KS.ZQ>XN8]6Y1L]4L('LCA+,:Q#B;RF*S2((V^\UB%7^+
+MF/5PD;/EK!M[(\2S&L0\F\JBLTB".OO.%EPCD,M%S]:S7.R-,+B(60)M*HO/
+M(@GZ[#][N(A9&-<62]`2LS?"0ZM!1+3;ZT&K022T_^SB(F;]70/M1'O#W@@>
+MK08!TJ:R%BV2@-'JL5C%XR)F>5XAK4A+PMX(+JT&`=.FLB4MDG#2_K.3BYC5
+M>\6T,NT#>R/TM!K$3YO*UK1(PDW[SUXN8M;V!=0&M?CKC<#4:A!.;2I+U"()
+M1NT_N[F(6?G74PO5DJ\WPE:K072UJ>Q4BR14M?_LYR)FD5\2[5<;R`(Y(Q!;
+MN[V*M4@"6?O/CBYBUA'FU;JUU>N-@-=J$'IM*JO6:A!R+4O[A8U`/]A>R]<"
+MKS?"Z2)F);:I[%^+)`2V_^SJ(F8]86WM8MO%0A4C$&:[O3JV&@1D^\^^+F(6
+M)W;&-K":[4AK,(Q`IJTSN[=:MAJ$9VO8SBYBEBYVVHJPJ:T->R/0MAJ$;>O:
+MW@BDK0;1V@JQ&^SM(F:A8IEM;JO:&K<:!'*[O?*V2()O2]RV5UC%[B)F$63)
+MK7([T_8-(Q!VN[TRMTB"<VO8_BYB%DAVVR:QVNW]>B.0MQJ$>?O;<K?7[6DZ
+MO(A9/]EYF]XJL3?"?*M!U+?O+7N+)+BWTZT56S>,0%N9?7O?ZK8#KIA5X+ZW
+M^BV2P-\&N(VLV#`"Y66*[8$+MMX(RXN81>&FLL>+@GN:/B]BUEF6W5JX8"U9
+M-@*)N-MKAJM!;+C_[/0B9@%G%2Z)&[3>""ZN!@'CIK(@K@:!XAJVUXN8I9W%
+MN#+NRWHC]+@:Q(^;RM:X2,*-^\]N+V(6?0;D!KD=ZXW`Y&H03FXJ2^0B"4;N
+M/_N]B%D/VI,+Y2ZL-\*6JT%TN:GLE(LD5+G_[/@B9IUH7NZ7NZ_>"&JN!L'F
+MIK)B+I)`YOZSYXN89:&-N&YNZWHCY+D:Q)Z[O<:Y2,*<^\^N+V(6D,;G]KF:
+MZXV`Z&H0BN[V"N@B"8*N8?N^B%F!FH'+Z`:O-\*EJT%DNN_MHXLD1+J&[?PB
+M9NEI;>ZFJZW>"*:N!H'JIK*>+I(`ZD*XKFSV-`()#E^KJKNDW@CWBYB%ZY:A
+MK2Z2\.K^L_N+F,6LI;JZ[JYZ(Q2[&L2QF\KVNAK$K[N'_B](`J^VZ":[%RX`
+M0.V>"-;N]LKL(@G.[C\KP(A9#!NRB^VJJC?"N*M!E+NI[+8;`'2[AJT!(V:5
+M;.;NN:NIW@CRK@9![Z:RZBZ2P.[^LPJ,F,6SU;OVKJ)Z(P2\&L3`F\KFNTC"
+MOOO/.C!BUM1&\!:\>NJ-`/%J$!)O*HOP(@D*[S\KP8A9:]O$2_&JJ3?"QZM!
+MA+RI[,6+)&2\_ZP%(V9M;=?NR!OE8FTC$,R[O9J\2`+*^\]J,&)6ZB;RRKR[
+M+NHV`OF\J:S+JT'8O(:M!R-F`6^:+M`+M=X(2J\&P?2^MSRO!D'T_K,BC)BE
+MO?V\3J^.>B-DO1K$UIO*1KU(PM1+Z_ZR)HR81;\UO5VOD`L`I+T:Q-K[WH*]
+M2(+8^\^J,&(6!,?VMKTS+]ZK0>B][RW<BR3(O6?O,[N_C4`)'-?+]VJH-X(+
+M(V8EOJFLWXLD`+Z%[QXKPXA949SBN_@JJ#?"Y:M!9+ZIK..K04"^_ZP-@R0L
+M<9KOYJN?W@BF[XF`^J:RGB^2`/K^LSJ,F#7&I;ZJKWIZ(]2^&L3MF\JVO@'`
+MZ_O/^C!B5I"1Z^:^O.F-0/QJ$,9O&<K[(@F^[S\KQ(A9E!SNB_PVIS?"]*M!
+M5+^I[/*+)#2_>Z@1(V:U<M;O]=N;W@CBKP9!_J:RVB^2P/W^LTJ,F"7/E;_F
+MKVMZ(\2_&L3\F\JFOTC"^OO/.C%B%CM'_]:_G^F-``!K$`)P*HO_(@GZ[S\K
+MQ8A9(MT`3``_IC?"`ZQ!1,"I[`&,)"3`_ZP5(V;U&,?O!`R8W@@>L`8!`I>A
+M%C"2@`'_LUJ,F-742<`B\%]Z([3`&L0+G,J6P$C"";R'>C%BUD\7\\;`!B]/
+M-P+YP-LK#8PDV,#_K!@C9B%V,#`0/);>"$JP!L$$I[(\L`9!!!NV9HR8Y=DU
+MP4[P5'HC9,$:Q!:<RD;!2,(4_,^J,6+6;<<%=\%#Z8V`!FL0:G`J"P8C"6+P
+M/^L+:1"PW0_,!F^I-\(=C"3DP=OK&XPDQ,'_K!PC9H%W:_`>+)/>"(:P!H$(
+MI[)^,.-QFMHQ8I9TIP<KPDKJC4`):Q"6\/;:"",)C_`_J\>(61I>(HP)3Z0W
+MPBBL093"J>PFC"1TPH:M'R-FN7BF\"D\D-X(LK`&00NGLJHPDL`*_[."C)@E
+MY-7"MO`\>B,$PQK$,)S*YL)(PB[\SQHR8A:61PP7P^/HC0`-:Q#2<"J+#",)
+MRO`_J\B(65'>-$P-3Z,WPC>L083#J>PUC"1DP_^L(R-F>7F7\#B\H-X([K`&
+M`0]OK^8PDH`._[.2C)@5Z,7#\O!^>B/TPQK$/[R]UL-(PCULV%HR8E:N)PX'
+MQ+/HC<`0:Q`.<2I+$",)!K%AJ\F(6<_>0PP1CZ(WPD:L073$J>Q$C"14Q/^L
+M)R-F(7L>\4<\B=X(*K$&P1*GLB(QDD`2_[.BC)CE[;7$+O$@>B/DQ!K$3IS*
+MQL1(PDS\SYHR8M:Z!Q#WQ-CO#3,"*<7;*U",)`C%_ZPJ(V;%?#PQ4PR'W@A6
+ML0:!%:>R2+$&`14;MJZ,F(7T[;U:\3P,`)3%&L19_-YVQ4C"5_S/RC)B5M"7
+M%:?%3.B-0!=K$'9Q*LL6(PEN<>6+5=@R8E;6=Q?CQ3#HC4`8:Q"&<2J[%R,)
+M??$_J\N(66_?88P8AZ`WPF2L053&J>QBC"0TQO^L+R-F&7Z6\65<@=X(HK$&
+M01JGLIHQDL`9_[/"C)A5_"W%IC$%W"6-0+/Q]IH:(PFK\3]KS(A9OU]I7!NS
+MGS?";ZQ!!,>I;&RL0>3&AJTR(V95?\+Q<&Q\W@C.L08!':>RQC&2@!S_L\Z,
+MF)7^1<?2,>QY(W3'&L1WG,I6QTC"=?S/2C-B5O\''H?'H.>-P!YK$.YQ*DL>
+M(PGF\3]KS8A9"2!M#!\_P0#`?JQ!],?;ZWR,)-3'_ZPV(V8Q@>_Q?^QWW@@*
+ML@;!(*>R`C*20"`;MMZ,F.4%-L@.<MMY(V3(&L2&G,I&R$C"A/S/BC-B%AS(
+M(7?(7.>-@")K$"IR*@LB(PDB\C]KSHA9@N"*S"(CG3?"C:Q!Y,BI[(N,),3(
+M_ZPZ(V91@CKRCAQSW@A&L@:!)*>R/C*2`"3_L^Z,F(4(^L=*\B)<"(Y`5_+V
+MVB0C"4_R/RO/B%G)8)*<)5N<-\*8K$&4R:ELE:Q!=,F&K3TC9FV#9O*93'#>
+M"'*R!D$GI[)J,I+`)O^S^HR8U0[6R7:RO'DC!,H:Q*"<RN;)2,*>_,_Z,V+6
+M/T@H%\KAYHT`*6L0DG(JBR@C"8KR/RO0B%D0X:1,*3^;-\*GK$&$RJGLI8PD
+M9,K_K$$C9A&$6/*H;`PGA",0K+R]FLI(`JK\SRHT8A9)&"O+RM4PB30"^<K;
+MJZNL0=C*AJU#(V8!A:(RL,QIW@C*L@;!+*>RO+(&02P;MA*-F$45-LO.LJ)Y
+M(V3+&L2VG,I&RTC"M/S/6C1B5F"(%G?+0NF-@"YK$.KR>PLN(PGB\C^KT8A9
+M>R&WS"Z?F3?"O:Q!Y,NI[+N,),3+@C$`X-&(69*AOKPO6YDWPL&L023,J:R_
+MC"0`S/^L2"-F,8<*\\+\8]X(%K,&@3&GL@XSD@`Q_[,FC9AU'&;,&C.)>2.4
+MS!K$R9S*=LQ(PL?\SZHT8I9VB#*GS!+FC4`S:Q`V<RK+,B,)+O,_Z]*(607B
+MNHPSW\(MP@A4-+^W.S.2T#/_LS*-F/4?WLQ'\W]Y(T3-&L34G,H.S1K$TEPP
+MVS1B5H5(-5?-[N6-`#9K$&)S*HLU(PE:\S^KTXA93N+83#9[ES?"VZQ!Q,VI
+M[-F,)*3-_ZQ/(V8EB7+SW%Q<W@A^LP8!.*>R=C.2@#?_LT*-F$4G&LV",SD<
+M)8Y`C_-[6S@C"8?S/VO4B%F*(N0<.0^C-\+FK$%TSN]MXZQ!5,X%LU(C9GV*
+MGO/G'!$#`*JS!L$ZO[>B,Y)`.A?,3HV8I2D&SJZS8GDCY,X:Q.Z<RL;.2,+L
+M7#!+-6)6K?@K]\Y+Z(V`/&L0RO/V"CPC"<+S/VO5B%G/(N_,/-N5-\+UK$%D
+MSZGL\XPD1,^&K58C9NV+K?/V+(G>".:S!H$^O[?>,Y(`/O^S7HV8!3&FS^JS
+M('HCU,\:Q/W\WK;/2,+[7#"+-6(6R8@_Y\];,0!`0&L0!O1[RS\C"?YSY8M`
+MZ[Y(XPC4@Z:R,ZA`4(/NH3Z*F)4U+L\3M/UY(W30&L0'O;WNH&_-:1JEB%EM
+MXP$=0C?/`,`*K4&TT.\M"8TDF-"&K9@B9B6.+O0+_8+>"#JT!L%#O[<R-))`
+M0Q?,9XJ8U3GZLJBM#ZT_RXTCT!)=^.ZM0322,$07S&R*F#4[]M!.]&F\IHQ`
+M6_1[FT1K$%*TD5GK4J$:A!7*17?1(C2<,@*IT>]M%JU!A-$%\Q,Z$*"AVC,;
+M/4_>"$&H!C&$8M`XZ!^680PI8A;_>,86H4EH(GV$+M(QBAXM-MX(A+0&84B_
+MMWTTDO!'?[,9AI4B9D&0AS0C[4DKTJ`T;NM(%XPW@B:M07#2[VTDC21,TA+T
+M*/V8`@KM0`"@`%`!P@P`E`1``5\`I\`L4`I(0!$``F`(0\`2\$LG`43`$>!+
+M_PIY@A2P*P0!IH(O#05@")7"H<`$@`#/]!-@!1#3=4+W4`5``5``HD`%Q`F6
+M0C<]!20!6$"<,"?XTG8"GJ`G=`]Z`C--!20!0\`4`#=-"E.`+WTH.`$.R1#P
+M31,!8<(00$U7`4*`KS`%]-*!@A%@*<C3AD(2("=L(^_T$^`$=`^D@C(=*D`(
+M];0S#5`+U`2UF?`GX-,*=1(`*)@)#_4SG03D(U)`%@`"6`%/`!-0!30!OO2?
+MH"M(`;=TI5!06PKW=#[]3?\*!K44D(\TU$Y`>N5*_]1`=5`M5`_51'51;50?
+MU4AU4JU4+]5,=5/M5#_54'54+55/U51U56U57]58=5:M56_57'57[55_U6!U
+M6"U6C]5D=5EM5I_5:'5:K5:OU6QU6^U6O]5P=5PM5\_5='5=;5??U7AU7JU7
+M[]5\=5_M5__5@'5@+5@/UH1U86U8']:(=6*M6"_6C'5C[5@_UI!U9"U93]:4
+M=65M65_6F'5FK5EOUIQU9^U9?]:@=6@M6H_6I'5I;5J?UJAU:JU:K]:L=6OM
+M6K_6L'5L+5O/UK1U;6U;W]:X=6ZM6^_6O'5O[5O_UL!U<"U<#]?$=7%M7!_7
+MR'5RK5POU\QU<^U</]?0=70M74_7U'5U;5U?U]AU=JU=;]?<=7?M77_7X'5X
+M+5Z/U^1U>6U>G]?H=7JM7J_7['5[[5Z_U_!U?"U?S]?T=7UM7]_7^'5^K5_O
+MU_QU?^U?_]<`=H`M8`_8!':!;6`?V`AV@JU@+]@,=H/M8#_8$':$+6%/V!1V
+MA6UA7]@8=H:M86_8'':'[6%_V"!VB"UBC]@D=HEM8I_8*':*K6*OV"QVB^UB
+4O]@P=HPM8\_8-':-;6/?V#BVW0$`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_open_fd.c b/archivers/libarchive/files/libarchive/test/test_open_fd.c
new file mode 100644
index 00000000000..5e118ad8f43
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_open_fd.c
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_fd.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define open _open
+#if !defined(__BORLANDC__)
+#define lseek _lseek
+#endif
+#define close _close
+#endif
+
+DEFINE_TEST(test_open_fd)
+{
+ char buff[64];
+ struct archive_entry *ae;
+ struct archive *a;
+ int fd;
+
+#if defined(__BORLANDC__)
+ fd = open("test.tar", O_RDWR | O_CREAT | O_BINARY);
+#else
+ fd = open("test.tar", O_RDWR | O_CREAT | O_BINARY, 0777);
+#endif
+ assert(fd >= 0);
+ if (fd < 0)
+ return;
+
+ /* Write an archive through this fd. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_open_fd(a, fd));
+
+ /*
+ * Write a file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 1, 0);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+ /*
+ * Write a second file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file2");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 819200);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close out the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Now, read the data back.
+ */
+ assert(lseek(fd, 0, SEEK_SET) == 0);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_fd(a, fd, 512));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff, 10));
+ assertEqualMem(buff, "12345678", 8);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(819200, archive_entry_size(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_data_skip(a));
+
+ /* Verify the end of the archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ close(fd);
+
+
+ /*
+ * Verify some of the error handling.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ /* FD 100 shouldn't be open. */
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_open_fd(a, 100, 512));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_open_file.c b/archivers/libarchive/files/libarchive/test/test_open_file.c
new file mode 100644
index 00000000000..871249d8729
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_open_file.c
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_file.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+DEFINE_TEST(test_open_file)
+{
+ char buff[64];
+ struct archive_entry *ae;
+ struct archive *a;
+ FILE *f;
+
+ f = fopen("test.tar", "wb");
+ assert(f != NULL);
+ if (f == NULL)
+ return;
+
+ /* Write an archive through this FILE *. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_open_FILE(a, f));
+
+ /*
+ * Write a file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 1, 0);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+ /*
+ * Write a second file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file2");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 819200);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close out the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+ fclose(f);
+
+ /*
+ * Now, read the data back.
+ */
+ f = fopen("test.tar", "rb");
+ assert(f != NULL);
+ if (f == NULL)
+ return;
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_FILE(a, f));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff, 10));
+ assertEqualMem(buff, "12345678", 8);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(819200, archive_entry_size(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_data_skip(a));
+
+ /* Verify the end of the archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ fclose(f);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_open_filename.c b/archivers/libarchive/files/libarchive/test/test_open_filename.c
new file mode 100644
index 00000000000..07224cde135
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_open_filename.c
@@ -0,0 +1,109 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_filename.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+DEFINE_TEST(test_open_filename)
+{
+ char buff[64];
+ struct archive_entry *ae;
+ struct archive *a;
+
+ /* Write an archive through this FILE *. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_filename(a, "test.tar"));
+
+ /*
+ * Write a file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 1, 0);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+ /*
+ * Write a second file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file2");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 819200);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close out the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Now, read the data back.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, "test.tar", 512));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff, 10));
+ assertEqualMem(buff, "12345678", 8);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(819200, archive_entry_size(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_data_skip(a));
+
+ /* Verify the end of the archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Verify some of the error handling.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_open_filename(a, "nonexistent.tar", 512));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c
index aad8327431d..5f1ac935c1e 100644
--- a/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c
+++ b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_pax_filename_encoding.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_pax_filename_encoding.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <locale.h>
@@ -40,9 +40,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_pax_filename_encoding.c,v 1.2 2
* the right filename returned and that we get a warning only
* if the header isn't marked as binary.
*/
-DEFINE_TEST(test_pax_filename_encoding_1)
+static void
+test_pax_filename_encoding_1(void)
{
- static const char testname[] = "test_pax_filename_encoding.tar.gz";
+ static const char testname[] = "test_pax_filename_encoding.tar";
/*
* \314\214 is a valid 2-byte UTF-8 sequence.
* \374 is invalid in UTF-8.
@@ -57,7 +58,7 @@ DEFINE_TEST(test_pax_filename_encoding_1)
extract_reference_file(testname);
a = archive_read_new();
assertEqualInt(ARCHIVE_OK, archive_read_support_format_tar(a));
- assertEqualInt(ARCHIVE_OK, archive_read_support_compression_gzip(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_support_compression_all(a));
assertEqualInt(ARCHIVE_OK,
archive_read_open_filename(a, testname, 10240));
/*
@@ -84,7 +85,8 @@ DEFINE_TEST(test_pax_filename_encoding_1)
* This should work; the underlying implementation should automatically
* fall back to storing the pathname in binary.
*/
-DEFINE_TEST(test_pax_filename_encoding_2)
+static void
+test_pax_filename_encoding_2(void)
{
char filename[] = "abc\314\214mno\374xyz";
struct archive *a;
@@ -105,9 +107,10 @@ DEFINE_TEST(test_pax_filename_encoding_2)
* de_DE.UTF-8 seems to be commonly supported.
*/
/* If it doesn't exist, just warn and return. */
- if (NULL == setlocale(LC_ALL, "de_DE.UTF-8")) {
+ if (LOCALE_UTF8 == NULL
+ || NULL == setlocale(LC_ALL, LOCALE_UTF8)) {
skipping("invalid encoding tests require a suitable locale;"
- " de_DE.UTF-8 not available on this system");
+ " %s not available on this system", LOCALE_UTF8);
return;
}
@@ -183,7 +186,8 @@ DEFINE_TEST(test_pax_filename_encoding_2)
* read it back into "C" locale, which doesn't support the name.
* TODO: Figure out the "right" behavior here.
*/
-DEFINE_TEST(test_pax_filename_encoding_3)
+static void
+test_pax_filename_encoding_3(void)
{
wchar_t badname[] = L"xxxAyyyBzzz";
const char badname_utf8[] = "xxx\xE1\x88\xB4yyy\xE5\x99\xB8zzz";
@@ -202,6 +206,31 @@ DEFINE_TEST(test_pax_filename_encoding_3)
return;
}
+ /* If wctomb is broken, warn and return. */
+ if (wctomb(buff, 0x1234) > 0) {
+ skipping("Cannot test conversion failures because \"C\" "
+ "locale on this system has no invalid characters.");
+ return;
+ }
+
+ /* If wctomb is broken, warn and return. */
+ if (wctomb(buff, 0x1234) > 0) {
+ skipping("Cannot test conversion failures because \"C\" "
+ "locale on this system has no invalid characters.");
+ return;
+ }
+
+ /* Skip test if archive_entry_update_pathname_utf8() is broken. */
+ /* In particular, this is currently broken on Win32 because
+ * setlocale() does not set the default encoding for CP_ACP. */
+ entry = archive_entry_new();
+ if (archive_entry_update_pathname_utf8(entry, badname_utf8)) {
+ archive_entry_free(entry);
+ skipping("Cannot test conversion failures.");
+ return;
+ }
+ archive_entry_free(entry);
+
assert((a = archive_write_new()) != NULL);
assertEqualIntA(a, 0, archive_write_set_format_pax(a));
assertEqualIntA(a, 0, archive_write_set_compression_none(a));
@@ -295,3 +324,10 @@ DEFINE_TEST(test_pax_filename_encoding_3)
assertEqualInt(0, archive_read_close(a));
assertEqualInt(0, archive_read_finish(a));
}
+
+DEFINE_TEST(test_pax_filename_encoding)
+{
+ test_pax_filename_encoding_1();
+ test_pax_filename_encoding_2();
+ test_pax_filename_encoding_3();
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.tar.uu b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.tar.uu
new file mode 100644
index 00000000000..47db1891569
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.tar.uu
@@ -0,0 +1,118 @@
+$FreeBSD: head/lib/libarchive/test/test_pax_filename_encoding.tar.uu 191183 2009-04-17 01:06:31Z kientzle $
+begin 644 test_pax_filename_encoding.tar
+M4&%X2&5A9&5R+V%B8\R,;6YO6'AY>@``````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#8T-"``,#`Q-S4P(``P,#$W-3`@`#`P,#`P,#`P,38V
+M(#$P-S8V-C`W,#,V(#`Q-3,P-@`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,'1I;0``
+M````````````````````````````````````=&EM````````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````R,2!P871H/6%B8\R,;6YO_'AY>@HR,"!C=&EM
+M93TQ,C`U-3,X-C@U"C(P(&%T:6UE/3$R,#4U,S@V,C8*,3<@4T-(24Q9+F1E
+M=CTX.`HR,B!30TA)3%DN:6YO/30S,34T-#D*,3@@4T-(24Q9+FYL:6YK/3$*
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&%B8\R,;6YO6'AY
+M>@``````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`V-#0@`#`P,3<U,"``,#`Q-S4P(``P,#`P,#`P,#`P-2`Q,#<V-C8P-S`S
+M-B`P,3,S,C4`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````2&5L;&\`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!087A(96%D97(O86)CS(QM;F_\>'EZ
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P-C0T(``P,#$W
+M-3`@`#`P,3<U,"``,#`P,#`P,#`R,3,@,3`W-C8V,#<P,S8@,#$U-30S`"!X
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P=&EM````````````````````````````````
+M``````!T:6T``````````````````````````````````````#`P,#`P,"``
+M,#`P,#`P(```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````#(Q(&AD
+M<F-H87)S970]0DE.05)9"C(Q('!A=&@]86)CS(QM;F_\>'EZ"C(P(&-T:6UE
+M/3$R,#4U-#$W,S4*,C`@871I;64],3(P-34S.#8R-@HQ-R!30TA)3%DN9&5V
+M/3@X"C(R(%-#2$E,62YI;F\]-#,Q-3$R-@HQ."!30TA)3%DN;FQI;FL],0H`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````86)CS(QM;F_\>'EZ````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#8T-"``,#`Q-S4P(``P,#$W-3`@
+M`#`P,#`P,#`P,#`U(#$P-S8V-C`W,#,V(#`Q,S4W,0`@,```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,'1I;0``````````````````````````````````````=&EM````
+M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!(96QL;P``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+C````````````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_compress_program.c b/archivers/libarchive/files/libarchive/test/test_read_compress_program.c
index ec688e62999..4e6c610de25 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_compress_program.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_compress_program.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_compress_program.c,v 1.2 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U',
@@ -34,26 +34,51 @@ static unsigned char archive[] = {
DEFINE_TEST(test_read_compress_program)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("archive_read_support_compression_program()");
-#else
+ int r;
struct archive_entry *ae;
struct archive *a;
+
+ /*
+ * First, test handling when a non-existent compression
+ * program is requested.
+ */
+ assert((a = archive_read_new()) != NULL);
+ r = archive_read_support_compression_program(a, "nonexistent");
+ if (r == ARCHIVE_FATAL) {
+ skipping("archive_read_support_compression_program() "
+ "unsupported on this platform");
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * If we have "gzip -d", try using that.
+ */
+ if (!canGunzip()) {
+ skipping("Can't run gunzip program on this platform");
+ return;
+ }
assert((a = archive_read_new()) != NULL);
- assertEqualIntA(a, 0, archive_read_support_compression_none(a));
- assertEqualIntA(a, 0, archive_read_support_compression_program(a, "gunzip"));
- assert(0 == archive_read_support_format_all(a));
- assertEqualIntA(a, 0, archive_read_open_memory(a, archive, sizeof(archive)));
- assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_PROGRAM);
- assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
-#endif
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_none(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_program(a, "gunzip"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_PROGRAM);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_data_large.c b/archivers/libarchive/files/libarchive/test/test_read_data_large.c
index a690b7b0daa..fe9120b5954 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_data_large.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_data_large.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_data_large.c,v 1.3 2007/05/29 01:00:20 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_data_large.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Test read/write of a 10M block of data in a single operation.
@@ -33,6 +33,11 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_data_large.c,v 1.3 2007/05
* had a bug relating to this, fixed in Nov 2006).
*/
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define open _open
+#define close _close
+#endif
+
char buff1[11000000];
char buff2[10000000];
char buff3[10000000];
@@ -43,6 +48,7 @@ DEFINE_TEST(test_read_data_large)
struct archive *a;
char tmpfilename[] = "largefile";
int tmpfilefd;
+ FILE *f;
unsigned int i;
size_t used;
@@ -63,14 +69,14 @@ DEFINE_TEST(test_read_data_large)
archive_entry_set_size(ae, sizeof(buff2));
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
- assertA(sizeof(buff2) == archive_write_data(a, buff2, sizeof(buff2)));
+ assertA((int)sizeof(buff2) == archive_write_data(a, buff2, sizeof(buff2)));
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/* Check that archive_read_data can handle 10*10^6 at a pop. */
@@ -84,10 +90,10 @@ DEFINE_TEST(test_read_data_large)
failure("Read expected 10MB, but data read didn't match what was written");
assert(0 == memcmp(buff2, buff3, sizeof(buff3)));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Check archive_read_data_into_fd */
@@ -96,22 +102,24 @@ DEFINE_TEST(test_read_data_large)
assertA(0 == archive_read_support_compression_all(a));
assertA(0 == archive_read_open_memory(a, buff1, sizeof(buff1)));
assertA(0 == archive_read_next_header(a, &ae));
- tmpfilefd = open(tmpfilename, O_WRONLY | O_CREAT, 0777);
+#if defined(__BORLANDC__)
+ tmpfilefd = open(tmpfilename, O_WRONLY | O_CREAT | O_BINARY);
+#else
+ tmpfilefd = open(tmpfilename, O_WRONLY | O_CREAT | O_BINARY, 0777);
+#endif
assert(tmpfilefd != 0);
assertEqualIntA(a, 0, archive_read_data_into_fd(a, tmpfilefd));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
close(tmpfilefd);
- tmpfilefd = open(tmpfilename, O_RDONLY);
- assert(tmpfilefd != 0);
- assertEqualIntA(NULL, sizeof(buff3), read(tmpfilefd, buff3, sizeof(buff3)));
- close(tmpfilefd);
+ f = fopen(tmpfilename, "rb");
+ assert(f != NULL);
+ assertEqualInt(sizeof(buff3), fread(buff3, 1, sizeof(buff3), f));
+ fclose(f);
assert(0 == memcmp(buff2, buff3, sizeof(buff3)));
-
- unlink(tmpfilename);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_disk.c b/archivers/libarchive/files/libarchive/test/test_read_disk.c
new file mode 100644
index 00000000000..d52659bb73b
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_disk.c
@@ -0,0 +1,172 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_disk.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+static void
+gname_cleanup(void *d)
+{
+ int *mp = d;
+ assertEqualInt(*mp, 0x13579);
+ *mp = 0x2468;
+}
+
+static const char *
+gname_lookup(void *d, gid_t g)
+{
+ int *mp = d;
+ assertEqualInt(*mp, 0x13579);
+ if (g == 1)
+ return ("FOOGROUP");
+ return ("NOTFOOGROUP");
+}
+
+static void
+uname_cleanup(void *d)
+{
+ int *mp = d;
+ assertEqualInt(*mp, 0x1234);
+ *mp = 0x2345;
+}
+
+static const char *
+uname_lookup(void *d, uid_t u)
+{
+ int *mp = d;
+ assertEqualInt(*mp, 0x1234);
+ if (u == 1)
+ return ("FOO");
+ return ("NOTFOO");
+}
+
+/* We test GID lookup by looking up the name of group number zero and
+ * checking it against the following list. If your system uses a
+ * different conventional name for group number zero, please extend
+ * this array and send us a patch. As always, please keep this list
+ * sorted alphabetically.
+ */
+static const char *zero_groups[] = {
+ "root", /* Linux */
+ "wheel" /* BSD */
+};
+
+DEFINE_TEST(test_read_disk)
+{
+ struct archive *a;
+ int gmagic = 0x13579, umagic = 0x1234;
+ const char *p;
+ size_t i;
+
+ assert((a = archive_read_disk_new()) != NULL);
+
+ /* Default uname/gname lookups always return NULL. */
+ assert(archive_read_disk_gname(a, 0) == NULL);
+ assert(archive_read_disk_uname(a, 0) == NULL);
+
+ /* Register some weird lookup functions. */
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_gname_lookup(a,
+ &gmagic, &gname_lookup, &gname_cleanup));
+ /* Verify that our new function got called. */
+ assertEqualString(archive_read_disk_gname(a, 0), "NOTFOOGROUP");
+ assertEqualString(archive_read_disk_gname(a, 1), "FOOGROUP");
+
+ /* De-register. */
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_set_gname_lookup(a, NULL, NULL, NULL));
+ /* Ensure our cleanup function got called. */
+ assertEqualInt(gmagic, 0x2468);
+
+ /* Same thing with uname lookup.... */
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_uname_lookup(a,
+ &umagic, &uname_lookup, &uname_cleanup));
+ assertEqualString(archive_read_disk_uname(a, 0), "NOTFOO");
+ assertEqualString(archive_read_disk_uname(a, 1), "FOO");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_set_uname_lookup(a, NULL, NULL, NULL));
+ assertEqualInt(umagic, 0x2345);
+
+ /* Try the standard lookup functions. */
+ if (archive_read_disk_set_standard_lookup(a) != ARCHIVE_OK) {
+ skipping("standard uname/gname lookup");
+ } else {
+#if defined(__CYGWIN__) || defined(__HAIKU__)
+ /* Some platforms don't have predictable names for
+ * uid=0, so we skip this part of the test. */
+ skipping("standard uname/gname lookup");
+ i = 0;
+ p = zero_groups[0]; /* avoid unused warnings */
+#else
+ /* XXX Someday, we may need to generalize this the
+ * same way we generalized the group name check below.
+ * That's needed only if we encounter a system where
+ * uid 0 is not "root". XXX */
+ assertEqualString(archive_read_disk_uname(a, 0), "root");
+
+ /* Get the group name for group 0 and see if it makes sense. */
+ p = archive_read_disk_gname(a, 0);
+ if (assert(p != NULL)) {
+ i = 0;
+ while (i < sizeof(zero_groups)/sizeof(zero_groups[0])) {
+ if (strcmp(zero_groups[i], p) == 0)
+ break;
+ ++i;
+ }
+ if (i == sizeof(zero_groups)/sizeof(zero_groups[0])) {
+ /* If you get a failure here, either
+ * archive_read_disk_gname() isn't working or
+ * your system uses a different name for group
+ * number zero. If the latter, please add a
+ * new entry to the zero_groups[] array above.
+ */
+ failure("group 0 didn't have any of the expected names");
+ assertEqualString(p, zero_groups[0]);
+ }
+ }
+#endif
+ }
+
+ /* Deregister again and verify the default lookups again. */
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_set_gname_lookup(a, NULL, NULL, NULL));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_set_uname_lookup(a, NULL, NULL, NULL));
+ assert(archive_read_disk_gname(a, 0) == NULL);
+ assert(archive_read_disk_uname(a, 0) == NULL);
+
+ /* Re-register our custom handlers. */
+ gmagic = 0x13579;
+ umagic = 0x1234;
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_gname_lookup(a,
+ &gmagic, &gname_lookup, &gname_cleanup));
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_uname_lookup(a,
+ &umagic, &uname_lookup, &uname_cleanup));
+
+ /* Destroy the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /* Verify our cleanup functions got called. */
+ assertEqualInt(gmagic, 0x2468);
+ assertEqualInt(umagic, 0x2345);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_disk_entry_from_file.c b/archivers/libarchive/files/libarchive/test/test_read_disk_entry_from_file.c
new file mode 100644
index 00000000000..6e34abe441d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_disk_entry_from_file.c
@@ -0,0 +1,80 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_disk_entry_from_file.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+static const char *
+gname_lookup(void *d, gid_t g)
+{
+ (void)d; /* UNUSED */
+ (void)g; /* UNUSED */
+ return ("FOOGROUP");
+}
+
+static const char *
+uname_lookup(void *d, uid_t u)
+{
+ (void)d; /* UNUSED */
+ (void)u; /* UNUSED */
+ return ("FOO");
+}
+
+DEFINE_TEST(test_read_disk_entry_from_file)
+{
+ struct archive *a;
+ struct archive_entry *entry;
+ FILE *f;
+
+ assert((a = archive_read_disk_new()) != NULL);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_uname_lookup(a,
+ NULL, &uname_lookup, NULL));
+ assertEqualInt(ARCHIVE_OK, archive_read_disk_set_gname_lookup(a,
+ NULL, &gname_lookup, NULL));
+ assertEqualString(archive_read_disk_uname(a, 0), "FOO");
+ assertEqualString(archive_read_disk_gname(a, 0), "FOOGROUP");
+
+ /* Create a file on disk. */
+ f = fopen("foo", "wb");
+ assert(f != NULL);
+ assertEqualInt(4, fwrite("1234", 1, 4, f));
+ fclose(f);
+
+ /* Use archive_read_disk_entry_from_file to get information about it. */
+ entry = archive_entry_new();
+ assert(entry != NULL);
+ archive_entry_copy_pathname(entry, "foo");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_entry_from_file(a, entry, -1, NULL));
+
+ /* Verify the information we got back. */
+ assertEqualString(archive_entry_uname(entry), "FOO");
+ assertEqualString(archive_entry_gname(entry), "FOOGROUP");
+ assertEqualInt(archive_entry_size(entry), 4);
+
+ /* Destroy the archive. */
+ archive_entry_free(entry);
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_extract.c b/archivers/libarchive/files/libarchive/test/test_read_extract.c
index ec8483077c2..5696e0d356f 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_extract.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_extract.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_extract.c,v 1.4 2008/06/15 10:35:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_extract.c 201247 2009-12-30 05:59:21Z kientzle $");
#define BUFF_SIZE 1000000
#define FILE_BUFF_SIZE 100000
@@ -32,18 +32,15 @@ DEFINE_TEST(test_read_extract)
{
struct archive_entry *ae;
struct archive *a;
- struct stat st;
size_t used;
- int i;
+ int i, numEntries = 0;
char *buff, *file_buff;
- int fd;
- ssize_t bytes_read;
buff = malloc(BUFF_SIZE);
file_buff = malloc(FILE_BUFF_SIZE);
/* Force the umask to something predictable. */
- umask(022);
+ assertUmask(022);
/* Create a new archive in memory containing various types of entries. */
assert((a = archive_write_new()) != NULL);
@@ -51,12 +48,14 @@ DEFINE_TEST(test_read_extract)
assertA(0 == archive_write_set_compression_none(a));
assertA(0 == archive_write_open_memory(a, buff, BUFF_SIZE, &used));
/* A directory to be restored with EXTRACT_PERM. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir_0775");
archive_entry_set_mode(ae, S_IFDIR | 0775);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* A regular file. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "file");
archive_entry_set_mode(ae, S_IFREG | 0755);
@@ -67,49 +66,53 @@ DEFINE_TEST(test_read_extract)
assertA(FILE_BUFF_SIZE == archive_write_data(a, file_buff, FILE_BUFF_SIZE));
archive_entry_free(ae);
/* A directory that should obey umask when restored. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir");
archive_entry_set_mode(ae, S_IFDIR | 0777);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* A file in the directory. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir/file");
archive_entry_set_mode(ae, S_IFREG | 0700);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* A file in a dir that is not already in the archive. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir2/file");
archive_entry_set_mode(ae, S_IFREG | 0000);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* A dir with a trailing /. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir3/.");
archive_entry_set_mode(ae, S_IFDIR | 0710);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* Multiple dirs with a single entry. */
+ ++numEntries;
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "dir4/a/../b/../c/");
archive_entry_set_mode(ae, S_IFDIR | 0711);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* A symlink. */
- assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "symlink");
- archive_entry_set_mode(ae, S_IFLNK | 0755);
- archive_entry_set_symlink(ae, "file");
- assertA(0 == archive_write_header(a, ae));
- archive_entry_free(ae);
+ if (canSymlink()) {
+ ++numEntries;
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "symlink");
+ archive_entry_set_mode(ae, AE_IFLNK | 0755);
+ archive_entry_set_symlink(ae, "file");
+ assertA(0 == archive_write_header(a, ae));
+ archive_entry_free(ae);
+ }
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
/* Extract the entries to disk. */
assert((a = archive_read_new()) != NULL);
@@ -121,72 +124,44 @@ DEFINE_TEST(test_read_extract)
assertA(0 == archive_read_next_header(a, &ae));
assertA(0 == archive_read_extract(a, ae, ARCHIVE_EXTRACT_PERM));
/* Rest of entries get restored with no flags. */
- for (i = 0; i < 7; i++) {
- failure("Error reading entry %d", i+1);
+ for (i = 1; i < numEntries; i++) {
+ failure("Error reading entry %d", i);
assertA(0 == archive_read_next_header(a, &ae));
+ failure("Failed to extract entry %d: %s", i,
+ archive_entry_pathname(ae));
assertA(0 == archive_read_extract(a, ae, 0));
}
assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
/* Test the entries on disk. */
/* This first entry was extracted with ARCHIVE_EXTRACT_PERM,
* so the permissions should have been restored exactly,
* including resetting the gid bit on those platforms
* where gid is inherited by subdirs. */
- assert(0 == stat("dir_0775", &st));
failure("This was 0775 in archive, and should be 0775 on disk");
- assertEqualInt(st.st_mode, S_IFDIR | 0775);
+ assertIsDir("dir_0775", 0775);
/* Everything else was extracted without ARCHIVE_EXTRACT_PERM,
* so there may be some sloppiness about gid bits on directories. */
- assert(0 == stat("file", &st));
- failure("st.st_mode=%o should be %o", st.st_mode, S_IFREG | 0755);
- assertEqualInt(st.st_mode, S_IFREG | 0755);
- failure("The file extracted to disk is the wrong size.");
- assert(st.st_size == FILE_BUFF_SIZE);
- fd = open("file", O_RDONLY);
- failure("The file on disk could not be opened.");
- assert(fd != 0);
- bytes_read = read(fd, buff, FILE_BUFF_SIZE);
- failure("The file contents read from disk are the wrong size");
- assert(bytes_read == FILE_BUFF_SIZE);
- failure("The file contents on disk do not match the file contents that were put into the archive.");
- assert(memcmp(buff, file_buff, FILE_BUFF_SIZE) == 0);
- assert(0 == stat("dir", &st));
- failure("This was 0777 in archive, but umask should make it 0755");
+ assertIsReg("file", 0755);
+ assertFileSize("file", FILE_BUFF_SIZE);
+ assertFileContents(file_buff, FILE_BUFF_SIZE, "file");
/* If EXTRACT_PERM wasn't used, be careful to ignore sgid bit
* when checking dir modes, as some systems inherit sgid bit
* from the parent dir. */
- assertEqualInt(0755, st.st_mode & 0777);
- assert(0 == stat("dir/file", &st));
- assert(st.st_mode == (S_IFREG | 0700));
- assert(0 == stat("dir2", &st));
- assertEqualInt(0755, st.st_mode & 0777);
- assert(0 == stat("dir2/file", &st));
- assert(st.st_mode == (S_IFREG | 0000));
- assert(0 == stat("dir3", &st));
- assertEqualInt(0710, st.st_mode & 0777);
- assert(0 == stat("dir4", &st));
- assertEqualInt(0755, st.st_mode & 0777);
- assert(0 == stat("dir4/a", &st));
- assertEqualInt(0755, st.st_mode & 0777);
- assert(0 == stat("dir4/b", &st));
- assertEqualInt(0755, st.st_mode & 0777);
- assert(0 == stat("dir4/c", &st));
- assertEqualInt(0711, st.st_mode & 0777);
- assert(0 == lstat("symlink", &st));
- assert(S_ISLNK(st.st_mode));
-#if HAVE_LCHMOD
- /* Systems that lack lchmod() can't set symlink perms, so skip this. */
- assert((st.st_mode & 07777) == 0755);
-#endif
- assert(0 == stat("symlink", &st));
- assert(st.st_mode == (S_IFREG | 0755));
+ failure("This was 0777 in archive, but umask should make it 0755");
+ assertIsDir("dir", 0755);
+ assertIsReg("dir/file", 0700);
+ assertIsDir("dir2", 0755);
+ assertIsReg("dir2/file", 0000);
+ assertIsDir("dir3", 0710);
+ assertIsDir("dir4", 0755);
+ assertIsDir("dir4/a", 0755);
+ assertIsDir("dir4/b", 0755);
+ assertIsDir("dir4/c", 0711);
+ if (canSymlink())
+ assertIsSymlink("symlink", "file");
free(buff);
free(file_buff);
diff --git a/archivers/libarchive/files/libarchive/test/test_read_file_nonexistent.c b/archivers/libarchive/files/libarchive/test/test_read_file_nonexistent.c
new file mode 100644
index 00000000000..9494dbab6f4
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_file_nonexistent.c
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_file_nonexistent.c 189473 2009-03-07 02:09:21Z kientzle $");
+
+DEFINE_TEST(test_read_file_nonexistent)
+{
+ struct archive* a = archive_read_new();
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_FATAL,
+ archive_read_open_filename(a, "notexistent.tar", 512));
+ archive_read_finish(a);
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_ar.ar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_ar.ar.uu
new file mode 100644
index 00000000000..ae61e59fc7a
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_ar.ar.uu
@@ -0,0 +1,12 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_ar.ar.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 755 test_read_format_ar.ar
+M(3QA<F-H/@HO+R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`T,"`@("`@("`@8`IY>7ET='1S<W-A86%F9F8N;R\*:&AH
+M:&IJ:FIK:VMK;&QL;"YO+PH*+S`@("`@("`@("`@("`@(#$Q-S4T-C4V-3(@
+M(#$P,#$@(#`@("`@(#$P,#8T-"`@."`@("`@("`@(&`*-34V-C<W.#AG9VAH
+M+F\O("`@("`@("`@,3$W-30V-38V."`@,3`P,2`@,"`@("`@,3`P-C0T("`T
+M("`@("`@("`@8`HS,S,S+S$Y("`@("`@("`@("`@(#$Q-S4T-C4W,3,@(#$P
+H,#$@(#`@("`@(#$P,#8T-"`@.2`@("`@("`@(&`*.3@W-C4T,S(Q"@``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_ar.c b/archivers/libarchive/files/libarchive/test/test_read_format_ar.c
index 0c01a2bb713..efea38d2c53 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_ar.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_ar.c
@@ -26,48 +26,21 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_ar.c,v 1.5 2008/03/12 21:10:26 kaiw Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_ar.c 201247 2009-12-30 05:59:21Z kientzle $");
-#if ARCHIVE_VERSION_STAMP >= 1009000
-/*
- * This "archive" is created by "GNU ar". Here we try to verify
- * our GNU format handling functionality.
- */
-static unsigned char archive[] = {
-'!','<','a','r','c','h','>',10,'/','/',' ',' ',' ',' ',' ',' ',' ',
-' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-' ',' ',' ',' ',' ','4','0',' ',' ',' ',' ',' ',' ',' ',' ','`',10,
-'y','y','y','t','t','t','s','s','s','a','a','a','f','f','f','.','o',
-'/',10,'h','h','h','h','j','j','j','j','k','k','k','k','l','l','l',
-'l','.','o','/',10,10,'/','0',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-' ',' ',' ',' ','1','1','7','5','4','6','5','6','5','2',' ',' ','1',
-'0','0','1',' ',' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4',
-' ',' ','8',' ',' ',' ',' ',' ',' ',' ',' ',' ','`',10,'5','5','6',
-'6','7','7','8','8','g','g','h','h','.','o','/',' ',' ',' ',' ',' ',
-' ',' ',' ',' ','1','1','7','5','4','6','5','6','6','8',' ',' ','1',
-'0','0','1',' ',' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4',
-' ',' ','4',' ',' ',' ',' ',' ',' ',' ',' ',' ','`',10,'3','3','3',
-'3','/','1','9',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-'1','1','7','5','4','6','5','7','1','3',' ',' ','1','0','0','1',' ',
-' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4',' ',' ','9',' ',
-' ',' ',' ',' ',' ',' ',' ',' ','`',10,'9','8','7','6','5','4','3',
-'2','1',10};
-
-char buff[64];
-#endif
DEFINE_TEST(test_read_format_ar)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("test_read_support_format_ar()");
-#else
+ char buff[64];
+ const char reffile[] = "test_read_format_ar.ar";
struct archive_entry *ae;
struct archive *a;
+
+ extract_reference_file(reffile);
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_compression_all(a));
assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_memory(a, archive, sizeof(archive)));
+ assertA(0 == archive_read_open_file(a, reffile, 7));
/* Filename table. */
assertA(0 == archive_read_next_header(a, &ae));
@@ -110,10 +83,5 @@ DEFINE_TEST(test_read_format_ar)
/* Test EOF */
assertA(1 == archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
-#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin.c
index b188228fb6e..fecc0ab4834 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
static unsigned char archive[] = {
199,'q',21,4,177,'y',237,'A',232,3,232,3,2,0,0,0,'p','C',244,'M',2,0,0,0,
@@ -54,10 +54,10 @@ DEFINE_TEST(test_read_format_cpio_bin)
assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE);
assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_Z.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_Z.c
index 1dcebd33b44..bae370b1717 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_Z.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_Z.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin_Z.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_Z.c 189464 2009-03-07 00:25:33Z kientzle $");
static unsigned char archive[] = {
31,157,144,199,226,'T',' ',16,'+','O',187,' ',232,6,'$',20,0,160,'!',156,
@@ -36,17 +36,25 @@ DEFINE_TEST(test_read_format_cpio_bin_Z)
struct archive_entry *ae;
struct archive *a;
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assertA(0 == archive_read_next_header(a, &ae));
- assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS);
- assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ failure("archive_compression_name(a)=\"%s\"",
+ archive_compression_name(a));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualString(archive_compression_name(a), "compress (.Z)");
+ failure("archive_format_name(a)=\"%s\"",
+ archive_format_name(a));
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.c
new file mode 100644
index 00000000000..8cd59dc5d01
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.c
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_be.c 191592 2009-04-27 19:30:09Z kientzle $");
+
+DEFINE_TEST(test_read_format_cpio_bin_be)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ const char *reference = "test_read_format_cpio_bin_be.cpio";
+
+ extract_reference_file(reference);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, reference, 10));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString(archive_entry_pathname(ae), "file1111222233334444");
+ assertEqualInt(archive_entry_size(ae), 5);
+ assertEqualInt(archive_entry_mtime(ae), 1240664175);
+ assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644);
+ assertEqualInt(archive_entry_uid(ae), 1000);
+ assertEqualInt(archive_entry_gid(ae), 0);
+
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_BE);
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.cpio.uu b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.cpio.uu
new file mode 100644
index 00000000000..f29b0713880
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_be.cpio.uu
@@ -0,0 +1,8 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_be.cpio.uu 191592 2009-04-27 19:30:09Z kientzle $
+begin 644 test_read_format_cpio_bin_be.cpio
+M<<<`"#P\@:0#Z`````$``$GS"&\`%0````5F:6QE,3$Q,3(R,C(S,S,S-#0T
+M-```86)C9&4`<<<```````````````$`````````"P````!44D%)3$52(2$A
+M````````````````````````````````````````````````````````````
+3````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_bz2.c
index e2841a7ce03..598c6256ad1 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_bz2.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_bz2.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin_bz2.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',134,'J',208,'4',0,0,30,246,141,253,
@@ -36,19 +36,23 @@ DEFINE_TEST(test_read_format_cpio_bin_bz2)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
+ r = archive_read_support_compression_bzip2(a);
+ if (r != ARCHIVE_OK) {
+ skipping("bzip2 support unavailable");
+ archive_read_close(a);
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2);
assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_gz.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_gz.c
index efabf3196b9..4457fb3c6ff 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_gz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_gz.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin_gz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_gz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,244,'M','p','C',0,3,';','^','(',202,178,177,242,173,227,11,230,
@@ -35,19 +35,27 @@ DEFINE_TEST(test_read_format_cpio_bin_gz)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP);
- assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualInt(ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ failure("archive_read_support_compression_gzip");
+ assertEqualInt(ARCHIVE_OK, r);
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE);
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_lzma.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_lzma.c
new file mode 100644
index 00000000000..035b38856d5
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_lzma.c
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_lzma.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+static unsigned char archive[] = {
+ 93, 0, 0,128, 0,255,255,255,255,255,255,255,255, 0, 99,156,
+ 62,160, 67,124,230, 93,220,235,118, 29, 75, 27,226,158, 67,149,
+151, 96, 22, 54,198,209, 63,104,209,148,249,238, 71,187,201,243,
+162, 1, 42, 47, 43,178, 35, 90, 6,156,208, 74,107, 91,229,126,
+ 5, 85,255,136,255, 64, 0
+};
+
+DEFINE_TEST(test_read_format_cpio_bin_lzma)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_xz.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_xz.c
new file mode 100644
index 00000000000..813b343fda0
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_bin_xz.c
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+static unsigned char archive[] = {
+ 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04,
+ 0xe6, 0xd6, 0xb4, 0x46, 0x02, 0x00, 0x21, 0x01,
+ 0x16, 0x00, 0x00, 0x00, 0x74, 0x2f, 0xe5, 0xa3,
+ 0xe0, 0x01, 0xff, 0x00, 0x33, 0x5d, 0x00, 0x63,
+ 0x9c, 0x3e, 0xa0, 0x43, 0x7c, 0xe6, 0x5d, 0xdc,
+ 0xeb, 0x76, 0x1d, 0x4b, 0x1b, 0xe2, 0x9e, 0x43,
+ 0x95, 0x97, 0x60, 0x16, 0x36, 0xc6, 0xd1, 0x3f,
+ 0x68, 0xd1, 0x94, 0xf9, 0xee, 0x47, 0xbb, 0xc9,
+ 0xf3, 0xa2, 0x01, 0x2a, 0x2f, 0x2b, 0xb2, 0x23,
+ 0x5a, 0x06, 0x9c, 0xd0, 0x4a, 0x6b, 0x5b, 0x14,
+ 0xb4, 0x00, 0x00, 0x00, 0x91, 0x62, 0x1e, 0x15,
+ 0x04, 0x46, 0x6b, 0x4d, 0x00, 0x01, 0x4f, 0x80,
+ 0x04, 0x00, 0x00, 0x00, 0xa1, 0x4b, 0xdf, 0x03,
+ 0xb1, 0xc4, 0x67, 0xfb, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x59, 0x5a
+};
+
+DEFINE_TEST(test_read_format_cpio_bin_xz)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xz reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
index 1d80ef96a6a..6563fcd7e9e 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_odc.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_odc.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
static unsigned char archive[] = {
'0','7','0','7','0','7','0','0','2','0','2','5','0','7','4','6','6','1','0',
@@ -58,10 +58,10 @@ DEFINE_TEST(test_read_format_cpio_odc)
assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE);
assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_POSIX);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
new file mode 100644
index 00000000000..3b4170cb787
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+
+/*
+Execute the following command to rebuild the data for this program:
+ tail -n +32 test_read_format_cpio_svr4_bzip2_rpm.c | /bin/sh
+
+F=test_read_format_cpio_svr4_bzip2_rpm.rpm
+NAME=rpmsample
+TMPRPM=/tmp/rpm
+rm -rf ${TMPRPM}
+mkdir -p ${TMPRPM}/BUILD
+mkdir -p ${TMPRPM}/RPMS
+mkdir -p ${TMPRPM}/SOURCES
+mkdir -p ${TMPRPM}/SPECS
+mkdir -p ${TMPRPM}/SRPMS
+echo "hello" > ${TMPRPM}/BUILD/file1
+echo "hello" > ${TMPRPM}/BUILD/file2
+echo "hello" > ${TMPRPM}/BUILD/file3
+cat > ${TMPRPM}/SPECS/${NAME}.spec <<END
+##
+%define _topdir ${TMPRPM}
+%define _binary_payload w9.bzdio
+
+Summary: Sample data of RPM filter of libarchive
+Name: ${NAME}
+Version: 1.0.0
+Release: 1
+License: BSD
+URL: http://code.google.com/p/libarchive
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%install
+rm -rf \$RPM_BUILD_ROOT
+
+mkdir -p \$RPM_BUILD_ROOT%{_sysconfdir}
+install -m 644 file1 \$RPM_BUILD_ROOT%{_sysconfdir}/file1
+install -m 644 file2 \$RPM_BUILD_ROOT%{_sysconfdir}/file2
+install -m 644 file3 \$RPM_BUILD_ROOT%{_sysconfdir}/file3
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file1
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file2
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file3
+
+%files
+%{_sysconfdir}/file1
+%{_sysconfdir}/file2
+%{_sysconfdir}/file3
+
+%description
+Sample data.
+END
+#
+rpmbuild -bb ${TMPRPM}/SPECS/${NAME}.spec
+uuencode ${F} < ${TMPRPM}/RPMS/noarch/${NAME}-1.0.0-1.noarch.rpm > ${F}.uu
+
+rm -rf ${TMPRPM}
+exit 1
+*/
+
+DEFINE_TEST(test_read_format_cpio_svr4_bzip2_rpm)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ const char *name = "test_read_format_cpio_svr4_bzip2_rpm.rpm";
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ r = archive_read_support_compression_bzip2(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("bzip2 reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_rpm(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file1", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file2", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file3", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2);
+ assertEqualString(archive_compression_name(a), "bzip2");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
new file mode 100644
index 00000000000..884ca9487cb
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
@@ -0,0 +1,47 @@
+begin 644 test_read_format_cpio_svr4_bzip2_rpm.rpm
+M[:ONVP,``````7)P;7-A;7!L92TQ+C`N,"TQ````````````````````````
+M```````````````````````````````````````````!``4`````````````
+M````````CJWH`0`````````%````5````#X````'````1````!````$-````
+M!@`````````!```#Z`````0````L`````0```^P````'````,````!````/O
+M````!````$`````!,F4X-3)F-39E,#,W83EE.61A9C<W8V(Q,&0P8S4T-65E
+M9&8S-6$U8@````````:<A,!!LG.$S/]SK-(FA0BH6@```@@````^````!___
+M_[`````0`````(ZMZ`$`````````,0```NP````_````!P```MP````0````
+M9`````@``````````0```^@````&`````@````$```/I````!@````P````!
+M```#Z@````8````2`````0```^P````)````%`````$```/M````"0```#P`
+M```!```#[@````0```!,`````0```^\````&````4`````$```/Q````!```
+M`%P````!```#]@````8```!@`````0```_@````)````9`````$```/\````
+M!@```'`````!```#_0````8```"4`````0```_X````&````F@````$```0$
+M````!````*0````#```$!@````,```"P`````P``!`D````#````M@````,`
+M``0*````!````+P````#```$"P````@```#(`````P``!`P````(```!*P``
+M``,```0-````!````3`````#```$#P````@```$\`````P``!!`````(```!
+M2P````,```04````!@```5H````!```$%0````0```%T`````P``!!<````(
+M```!@`````$```08````!````8P````#```$&0````@```&8`````P``!!H`
+M```(```!Z@````,```0H````!@```@`````!```$1P````0```((`````P``
+M!$@````$```"%`````,```1)````"````B`````#```$6`````0```(D````
+M`0``!%D````(```"*`````$```1<````!````C`````#```$70````@```(\
+M`````P``!%X````(```"3@````$```1B````!@```E0````!```$9`````8`
+M``)S`````0``!&4````&```">`````$```1F````!@```GX````!```$;```
+M``8```*``````0``!'0````$```"E`````,```1U````!````J`````#```$
+M=@````@```*L`````P``!'<````$```"Q`````,```1X````!````M`````#
+M0P!R<&US86UP;&4`,2XP+C``,0!386UP;&4@9&%T82!O9B!24$T@9FEL=&5R
+M(&]F(&QI8F%R8VAI=F4`4V%M<&QE(&1A=&$N`````$L)MWQC=64M9&5S:W1O
+M<``````20E-$`%5N<W!E8VEF:65D`&AT='`Z+R]C;V1E+F=O;V=L92YC;VTO
+M<"]L:6)A<F-H:79E`&QI;G5X`&YO87)C:``````````&````!@````:!I(&D
+M@:0``````````5&!``%1@0`!48%B,3DT-F%C.3(T.3)D,C,T-V,V,C,U8C1D
+M,C8Q,3$X-`!B,3DT-F%C.3(T.3)D,C,T-V,V,C,U8C1D,C8Q,3$X-`!B,3DT
+M-F%C.3(T.3)D,C,T-V,V,C,U8C1D,C8Q,3$X-```````````````````````
+M`')O;W0`<F]O=`!R;V]T`')O;W0`<F]O=`!R;V]T`')P;7-A;7!L92TQ+C`N
+M,"TQ+G-R8RYR<&T`________________<G!M<V%M<&QE`````0``2@$``$H!
+M``!*<G!M;&EB*$-O;7!R97-S961&:6QE3F%M97,I`')P;6QI8BA087EL;V%D
+M1FEL97-(879E4')E9FEX*0!R<&UL:6(H4&%Y;&]A9$ES0GII<#(I`#,N,"XT
+M+3$`-"XP+3$`,RXP+C4M,0`T+C<N,```````"`$```@!```(`0``*H<``"J(
+M```JB0`````````(,2XP+C`M,0````````````````!F:6QE,0!F:6QE,@!F
+M:6QE,P`O971C+P`M3S(@+6<@+6UA<F-H/6DS.#8@+6UT=6YE/6DV.#8`8W!I
+M;P!B>FEP,@`Y`&YO87)C:"UR<&TM;&EN=7@`````````````````````````
+M`0````$````!`$%30TE)('1E>'0`9&ER96-T;W)Y````````````````````
+M````````````````````/P````?___SP````$$)::#DQ05DF4UFX89DX``!=
+M?X!,$`@`*`'_X"(D%``[9(0`(`"2B/50T#0#0`](9!%(C1,0&GJ`R`M@PQRG
+M<PN0PPC]8&X[2P=KHS%0Q<^=89M6CI5L`O2\("`W!K-V.;*M63U;6ES%CQI6
+E4,1$DE)B@G&.7I5?NT46(XB0/D,B!$Z-!A_B[DBG"A(7##,G````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip.c
index 0bd8296da5e..8b19a021b0d 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,236,'c',217,'D',0,3,'3','0','7','0','7','0','4','0','0',181,'0',
@@ -36,19 +36,26 @@ DEFINE_TEST(test_read_format_cpio_svr4_gzip)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP);
- assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualInt(ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_format(a),
+ ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
new file mode 100644
index 00000000000..eb8a38d9df3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+
+/*
+Execute the following command to rebuild the data for this program:
+ tail -n +32 test_read_format_cpio_svr4_gzip_rpm.c | /bin/sh
+
+F=test_read_format_cpio_svr4_gzip_rpm.rpm
+NAME=rpmsample
+TMPRPM=/tmp/rpm
+rm -rf ${TMPRPM}
+mkdir -p ${TMPRPM}/BUILD
+mkdir -p ${TMPRPM}/RPMS
+mkdir -p ${TMPRPM}/SOURCES
+mkdir -p ${TMPRPM}/SPECS
+mkdir -p ${TMPRPM}/SRPMS
+echo "hello" > ${TMPRPM}/BUILD/file1
+echo "hello" > ${TMPRPM}/BUILD/file2
+echo "hello" > ${TMPRPM}/BUILD/file3
+cat > ${TMPRPM}/SPECS/${NAME}.spec <<END
+##
+%define _topdir ${TMPRPM}
+%define _binary_payload w9.gzdio
+
+Summary: Sample data of RPM filter of libarchive
+Name: ${NAME}
+Version: 1.0.0
+Release: 1
+License: BSD
+URL: http://code.google.com/p/libarchive
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%install
+rm -rf \$RPM_BUILD_ROOT
+
+mkdir -p \$RPM_BUILD_ROOT%{_sysconfdir}
+install -m 644 file1 \$RPM_BUILD_ROOT%{_sysconfdir}/file1
+install -m 644 file2 \$RPM_BUILD_ROOT%{_sysconfdir}/file2
+install -m 644 file3 \$RPM_BUILD_ROOT%{_sysconfdir}/file3
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file1
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file2
+TZ=utc touch -afm -t 197001020000.01 \$RPM_BUILD_ROOT%{_sysconfdir}/file3
+
+%files
+%{_sysconfdir}/file1
+%{_sysconfdir}/file2
+%{_sysconfdir}/file3
+
+%description
+Sample data.
+END
+#
+rpmbuild -bb ${TMPRPM}/SPECS/${NAME}.spec
+uuencode ${F} < ${TMPRPM}/RPMS/noarch/${NAME}-1.0.0-1.noarch.rpm > ${F}.uu
+
+rm -rf ${TMPRPM}
+exit 1
+*/
+
+DEFINE_TEST(test_read_format_cpio_svr4_gzip_rpm)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ const char *name = "test_read_format_cpio_svr4_gzip_rpm.rpm";
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_rpm(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file1", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file2", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("./etc/file3", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP);
+ assertEqualString(archive_compression_name(a), "gzip");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu
new file mode 100644
index 00000000000..54d305b7742
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu
@@ -0,0 +1,46 @@
+begin 644 test_read_format_cpio_svr4_gzip_rpm.rpm
+M[:ONVP,``````7)P;7-A;7!L92TQ+C`N,"TQ````````````````````````
+M```````````````````````````````````````````!``4`````````````
+M````````CJWH`0`````````%````5````#X````'````1````!````$-````
+M!@`````````!```#Z`````0````L`````0```^P````'````,````!````/O
+M````!````$`````!9&9E8V,W,#4T,C@X,V1D-&8P-6%E.#4Y,S<S,&1F,V)D
+M,#$Q,S0V80````````9=A5.[L^@5U91731!5GLHZC0```@@````^````!___
+M_[`````0`````(ZMZ`$`````````,0```L0````_````!P```K0````0````
+M9`````@``````````0```^@````&`````@````$```/I````!@````P````!
+M```#Z@````8````2`````0```^P````)````%`````$```/M````"0```#P`
+M```!```#[@````0```!,`````0```^\````&````4`````$```/Q````!```
+M`%P````!```#]@````8```!@`````0```_@````)````9`````$```/\````
+M!@```'`````!```#_0````8```"4`````0```_X````&````F@````$```0$
+M````!````*0````#```$!@````,```"P`````P``!`D````#````M@````,`
+M``0*````!````+P````#```$"P````@```#(`````P``!`P````(```!*P``
+M``,```0-````!````3`````#```$#P````@```$\`````P``!!`````(```!
+M2P````,```04````!@```5H````!```$%0````0```%T`````P``!!<````(
+M```!@`````$```08````!````8P````"```$&0````@```&4`````@``!!H`
+M```(```!SP````(```0H````!@```=T````!```$1P````0```'D`````P``
+M!$@````$```!\`````,```1)````"````?P````#```$6`````0```(`````
+M`0``!%D````(```"!`````$```1<````!````@P````#```$70````@```(8
+M`````P``!%X````(```"*@````$```1B````!@```C`````!```$9`````8`
+M``)/`````0``!&4````&```"5`````$```1F````!@```ED````!```$;```
+M``8```);`````0``!'0````$```";`````,```1U````!````G@````#```$
+M=@````@```*$`````P``!'<````$```"G`````,```1X````!````J@````#
+M0P!R<&US86UP;&4`,2XP+C``,0!386UP;&4@9&%T82!O9B!24$T@9FEL=&5R
+M(&]F(&QI8F%R8VAI=F4`4V%M<&QE(&1A=&$N`````$L)MAUC=64M9&5S:W1O
+M<``````20E-$`%5N<W!E8VEF:65D`&AT='`Z+R]C;V1E+F=O;V=L92YC;VTO
+M<"]L:6)A<F-H:79E`&QI;G5X`&YO87)C:``````````&````!@````:!I(&D
+M@:0``````````5&!``%1@0`!48%B,3DT-F%C.3(T.3)D,C,T-V,V,C,U8C1D
+M,C8Q,3$X-`!B,3DT-F%C.3(T.3)D,C,T-V,V,C,U8C1D,C8Q,3$X-`!B,3DT
+M-F%C.3(T.3)D,C,T-V,V,C,U8C1D,C8Q,3$X-```````````````````````
+M`')O;W0`<F]O=`!R;V]T`')O;W0`<F]O=`!R;V]T`')P;7-A;7!L92TQ+C`N
+M,"TQ+G-R8RYR<&T`________________<G!M<V%M<&QE`````0``2@$``$IR
+M<&UL:6(H0V]M<')E<W-E9$9I;&5.86UE<RD`<G!M;&EB*%!A>6QO861&:6QE
+M<TAA=F50<F5F:7@I`#,N,"XT+3$`-"XP+3$`-"XW+C``````"`$```@!```(
+M`0``*H<``"J(```JB0`````````(,2XP+C`M,0````````````````!F:6QE
+M,0!F:6QE,@!F:6QE,P`O971C+P`M3S(@+6<@+6UA<F-H/6DS.#8@+6UT=6YE
+M/6DV.#8`8W!I;P!G>FEP`#D`;F]A<F-H+7)P;2UL:6YU>```````````````
+M```````!`````0````$`05-#24D@=&5X=`!D:7)E8W1O<GD`````````````
+M```````````````````````````_````!____/`````0'XL(```````"`S,P
+M-S`W,#0``J-$"W,0;6&8:&*`'8#4&9H:6AA"^690V@))'AM(AC'T]%-+DO73
+M,G-2#1D8&#)2<W+RN1@8#)#=8$$_-QCA<H,E_=Q@C-4-1`!BU:&#)!@C),C1
+3T\<U2%%1$>@$!@"1O'?9"`(`````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4c_Z.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4c_Z.c
index d6158a8ca1f..d3f086bbd51 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4c_Z.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_svr4c_Z.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c 189381 2009-03-05 00:31:48Z kientzle $");
static unsigned char archive[] = {
31,157,144,'0','n',4,132,'!',3,6,140,26,'8','n',228,16,19,195,160,'A',26,
@@ -39,17 +39,23 @@ DEFINE_TEST(test_read_format_cpio_svr4c_Z)
struct archive *a;
/* printf("Archive address: start=%X, end=%X\n", archive, archive+sizeof(archive)); */
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assertA(0 == archive_read_next_header(a, &ae));
- assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS);
- assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_SVR4_CRC);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ failure("archive_compression_name(a)=\"%s\"",
+ archive_compression_name(a));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ failure("archive_format_name(a)=\"%s\"", archive_format_name(a));
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_CRC);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_empty.c b/archivers/libarchive/files/libarchive/test/test_read_format_empty.c
index f6f3e237842..98cfdfa26f5 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_empty.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_empty.c
@@ -23,9 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_empty.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_empty.c 189308 2009-03-03 17:02:51Z kientzle $");
-static unsigned char archive[] = { };
+static unsigned char archive[] = { 0 };
DEFINE_TEST(test_read_format_empty)
{
@@ -34,16 +34,14 @@ DEFINE_TEST(test_read_format_empty)
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_compression_all(a));
assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_memory(a, archive, sizeof(archive)));
+ assertA(0 == archive_read_open_memory(a, archive, 0));
assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE);
assertA(archive_format(a) == ARCHIVE_FORMAT_EMPTY);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
-
-
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_gz.c b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_gz.c
index 307d1d8c72d..3071b1d0b49 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_gz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_gz.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_gz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_gz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,'+','e',217,'D',0,3,211,211,'g',160,'9','0',0,2,'s','S','S',16,
@@ -36,19 +36,25 @@ DEFINE_TEST(test_read_format_gtar_gz)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP);
- assert(archive_format(a) == ARCHIVE_FORMAT_TAR_GNUTAR);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualInt(ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_lzma.c b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_lzma.c
new file mode 100644
index 00000000000..0e8ff32e57a
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_lzma.c
@@ -0,0 +1,78 @@
+/*-
+ * Copyright (c) 2008 Miklos Vajna
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_lzma.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+static unsigned char archive[] = {
+0x5d, 0x0, 0x0, 0x80, 0x0, 0x0, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+0x17, 0xb, 0xbc, 0x1c, 0x7d, 0x1, 0x95, 0xc0, 0x1d, 0x4a, 0x46, 0x9c,
+0x1c, 0xc5, 0x8, 0x82, 0x10, 0xed, 0x84, 0xf6, 0xea, 0x7a, 0xfe, 0x63,
+0x5a, 0x34, 0x5e, 0xf7, 0xc, 0x60, 0xd6, 0x8b, 0xc1, 0x47, 0xaf, 0x11,
+0x6f, 0x18, 0x94, 0x81, 0x74, 0x8a, 0xf8, 0x47, 0xcc, 0xdd, 0xc0, 0xd9,
+0x40, 0xa, 0xc3, 0xac, 0x43, 0x47, 0xb5, 0xac, 0x2b, 0x31, 0xd3, 0x6,
+0xa4, 0x2c, 0x44, 0x80, 0x24, 0x4b, 0xfe, 0x43, 0x22, 0x4e, 0x14, 0x30,
+0x7a, 0xef, 0x99, 0x6e, 0xf, 0x8b, 0xc1, 0x79, 0x93, 0x88, 0x54, 0x73,
+0x59, 0x3f, 0xc, 0xfb, 0xee, 0x9c, 0x83, 0x49, 0x93, 0x33, 0xad, 0x44,
+0xbe, 0x0};
+
+DEFINE_TEST(test_read_format_gtar_lzma)
+{
+ int r;
+
+ struct archive_entry *ae;
+ struct archive *a;
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+
+ assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ r = archive_read_open_memory2(a, archive, sizeof(archive), 3);
+ if (r != ARCHIVE_OK) {
+ skipping("Skipping LZMA compression check: %s",
+ archive_error_string(a));
+ goto finish;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+finish:
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+#endif
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
index b7efea5b82a..d055fc249a7 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.8 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse.c 189308 2009-03-03 17:02:51Z kientzle $");
struct contents {
@@ -171,13 +171,6 @@ struct archive_contents {
{ NULL, NULL }
};
-/*
- * A tricky piece of code that verifies the contents of a sparse
- * archive entry against a description as defined at the top of this
- * source file.
- */
-#define min(a,b) ((a) < (b) ? (a) : (b))
-
static void
verify_archive_file(const char *name, struct archive_contents *ac)
{
@@ -187,6 +180,7 @@ verify_archive_file(const char *name, struct archive_contents *ac)
struct contents expect;
/* data, size, offset of block read from archive. */
struct contents actual;
+ const void *p;
struct archive *a;
extract_reference_file(name);
@@ -200,16 +194,19 @@ verify_archive_file(const char *name, struct archive_contents *ac)
while (ac->filename != NULL) {
struct contents *cts = ac->contents;
- assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ if (!assertEqualIntA(a, 0, archive_read_next_header(a, &ae))) {
+ assert(0 == archive_read_finish(a));
+ return;
+ }
failure("Name mismatch in archive %s", name);
assertEqualString(ac->filename, archive_entry_pathname(ae));
expect = *cts++;
while (0 == (err = archive_read_data_block(a,
- (const void **)&actual.d,
- &actual.s, &actual.o))) {
+ &p, &actual.s, &actual.o))) {
+ actual.d = p;
while (actual.s > 0) {
- char c = *(const char *)actual.d;
+ char c = *actual.d;
if(actual.o < expect.o) {
/*
* Any byte before the expected
@@ -247,8 +244,8 @@ verify_archive_file(const char *name, struct archive_contents *ac)
failure("%s: should be end of entry", name);
assertEqualIntA(a, err, ARCHIVE_EOF);
failure("%s: Size returned at EOF must be zero", name);
- assertEqualInt(actual.s, 0);
-#if ARCHIVE_VERSION_STAMP < 1009000
+ assertEqualInt((int)actual.s, 0);
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* libarchive < 1.9 doesn't get this right */
skipping("offset of final sparse chunk");
#else
@@ -263,10 +260,10 @@ verify_archive_file(const char *name, struct archive_contents *ac)
assertEqualIntA(a, ARCHIVE_EOF, err);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
@@ -274,33 +271,33 @@ verify_archive_file(const char *name, struct archive_contents *ac)
DEFINE_TEST(test_read_format_gtar_sparse)
{
/* Two archives that use the "GNU tar sparse format". */
- verify_archive_file("test_read_format_gtar_sparse_1_13.tgz", files);
- verify_archive_file("test_read_format_gtar_sparse_1_17.tgz", files);
+ verify_archive_file("test_read_format_gtar_sparse_1_13.tar", files);
+ verify_archive_file("test_read_format_gtar_sparse_1_17.tar", files);
/*
* libarchive < 1.9 doesn't support the newer --posix sparse formats
* from GNU tar 1.15 and later.
*/
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("read support for GNUtar --posix sparse formats");
#else
/*
* An archive created by GNU tar 1.17 using --posix --sparse-format=0.1
*/
verify_archive_file(
- "test_read_format_gtar_sparse_1_17_posix00.tgz",
+ "test_read_format_gtar_sparse_1_17_posix00.tar",
files);
/*
* An archive created by GNU tar 1.17 using --posix --sparse-format=0.1
*/
verify_archive_file(
- "test_read_format_gtar_sparse_1_17_posix01.tgz",
+ "test_read_format_gtar_sparse_1_17_posix01.tar",
files);
/*
* An archive created by GNU tar 1.17 using --posix --sparse-format=1.0
*/
verify_archive_file(
- "test_read_format_gtar_sparse_1_17_posix10.tgz",
+ "test_read_format_gtar_sparse_1_17_posix10.tar",
files);
/*
* The last test archive here is a little odd. First, it's
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
new file mode 100644
index 00000000000..86a59ffa47a
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
@@ -0,0 +1,1370 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu 191183 2009-04-17 01:06:31Z kientzle $
+begin 644 test_read_format_gtar_sparse_1_13.tar
+M<W!A<G-E````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`Q,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`R,#`Q
+M`#$P-S,S,3`Q,30P`#`Q-S<V-P`@4P``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<B`@`'1I;0``
+M````````````````````````````````````=&EM````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,S8T,3`P,``P,#`P,#`P
+M,3`P,``P,#`P-S4P,C`P,``P,#`P,#`P,3`P,``P,#`Q,S<W-S<W-P`P,#`P
+M,#`P,#`P,0``````````````````````````````````,#`P,30P,#`P,#``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!S<&%R<V4R````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#$P,#8T-``P,#`Q
+M-S4P`#`P,#$W-3``,#`P,#`Q-#(S,#$`,3`W,S,Q,#$Q-#$`,#(R,3,S`"!3
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R("``=&EM````````````````````````````````
+M``````!T:6T`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````#`P,#`S-C0Q,#`P`#`P,#`P,#`Q,#`P`#`P,#`W-3`R,#`P`#`P,#`P
+M,#`Q,#`P`#`P,#$S,S0S,#`P`#`P,#`P,#`Q,#`P`#`P,#$W,C`T,#`P`#`P
+M,#`P,#`Q,#`P``$P,#4W,34Q-S,P,0```````````````````````#`P,#(S
+M,#0U,#`P`#`P,#`P,#`Q,#`P`#`P,#(V-S`V,#`P`#`P,#`P,#`Q,#`P`#`P
+M,#,R-30W,#`P`#`P,#`P,#`Q,#`P`#`P,#,V-#$Q,#`P`#`P,#`P,#`Q,#`P
+M`#`P,#0R,C4R,#`P`#`P,#`P,#`Q,#`P`#`P,#0V,3$S,#`P`#`P,#`P,#`Q
+M,#`P`#`P,#4Q-S4T,#`P`#`P,#`P,#`Q,#`P`#`P,#4U-C$U,#`P`#`P,#`P
+M,#`Q,#`P`#`P,#8Q-#4V,#`P`#`P,#`P,#`Q,#`P`#`P,#8U,S$W,#`P`#`P
+M,#`P,#`Q,#`P`#`P,#<Q,38P,#`P`#`P,#`P,#`Q,#`P`#`P,#<U,#(R,#`P
+M`#`P,#`P,#`Q,#`P`#`P,3`P-C8S,#`P`#`P,#`P,#`Q,#`P`#`P,3`T-3(T
+M,#`P`#`P,#`P,#`Q,#`P`#`P,3$P,S8U,#`P`#`P,#`P,#`Q,#`P`#`P,3$T
+M,C(V,#`P`#`P,#`P,#`Q,#`P`#`P,3(P,#8W,#`P`#`P,#`P,#`Q,#`P`#`P
+M,3(S-S,P,#`P`#`P,#`P,#`Q,#`P`#`P,3(W-3<Q,#`P`#`P,#`P,#`Q,#`P
+M`#`P,3,S-#,S,#`P`#`P,#`P,#`Q,#`P`#`P,3,W,C<T,#`P`#`P,#`P,#`Q
+M,#`P``$`````````,#`Q-#,Q,S4P,#``,#`P,#`P,#$P,#``,#`Q-#8W-S8P
+M,#``,#`P,#`P,#$P,#``,#`Q-3(V,S<P,#``,#`P,#`P,#$P,#``,#`Q-38U
+M,#`P,#``,#`P,#`P,#$P,#``,#`Q-C(S-#$P,#``,#`P,#`P,#$P,#``,#`Q
+M-C8R,#(P,#``,#`P,#`P,#$P,#``,#`Q-S(P-#0P,#``,#`P,#`P,#$P,#``
+M,#`Q-S4W,#4P,#``,#`P,#`P,#$P,#``,#`R,#$U-#8P,#``,#`P,#`P,#$P
+M,#``,#`R,#4T,#<P,#``,#`P,#`P,#$P,#``,#`R,3$R-3`P,#``,#`P,#`P
+M,#$P,#``,#`R,34Q,3$P,#``,#`P,#`P,#$P,#``,#`R,C`W-3(P,#``,#`P
+M,#`P,#$P,#``,#`R,C0V,3,P,#``,#`P,#`P,#$P,#``,#`R,S`T-34P,#``
+M,#`P,#`P,#$P,#``,#`R,S0S,38P,#``,#`P,#`P,#$P,#``,#`R-#`Q-3<P
+M,#``,#`P,#`P,#$P,#``,#`R-#0P,C`P,#``,#`P,#`P,#$P,#``,#`R-#<V
+M-C$P,#``,#`P,#`P,#$P,#``,#`R-3,U,C(P,#``,#`P,#`P,#$P,#``,#`R
+M-3<S-C,P,#``,#`P,#`P,#$P,#```0`````````P,#(V,S(R-#`P,``P,#`P
+M,#`P,3`P,``P,#(V-S`V-C`P,``P,#`P,#`P,3`P,``P,#(W,C<R-S`P,``P
+M,#`P,#`P,3`P,``P,#(W-C4W,#`P,``P,#`P,#`P,3`P,``P,#,P,C0S,3`P
+M,``P,#`P,#`P,3`P,``P,#,P-C(W,C`P,``P,#`P,#`P,3`P,``P,#,Q,C$S
+M,S`P,``P,#`P,#`P,3`P,``P,#,Q-3<W-#`P,``P,#`P,#`P,3`P,``P,#,R
+M,38S-3`P,``P,#`P,#`P,3`P,``P,#,R-30W-S`P,``P,#`P,#`P,3`P,``P
+M,#,S,3,T,#`P,``P,#`P,#`P,3`P,``P,#,S-3(P,3`P,``P,#`P,#`P,3`P
+M,``P,#,T,3`T,C`P,``P,#`P,#`P,3`P,``P,#,T-#<P,S`P,``P,#`P,#`P
+M,3`P,``P,#,U,#4T-#`P,``P,#`P,#`P,3`P,``P,#,U-#0P-3`P,``P,#`P
+M,#`P,3`P,``P,#,V,#(T-C`P,``P,#`P,#`P,3`P,``P,#,V-#$Q,#`P,``P
+M,#`P,#`P,3`P,``P,#,V-S<U,3`P,``P,#`P,#`P,3`P,``P,#,W,S8Q,C`P
+M,``P,#`P,#`P,3`P,``P,#,W-S0U,S`P,``P,#`P,#`P,3`P,``!````````
+M`#`P-#`S,S$T,#`P`#`P,#`P,#`Q,#`P`#`P-#`W,34U,#`P`#`P,#`P,#`Q
+M,#`P`#`P-#$S,#$V,#`P`#`P,#`P,#`Q,#`P`#`P-#$V-C4W,#`P`#`P,#`P
+M,#`Q,#`P`#`P-#(R-3(Q,#`P`#`P,#`P,#`Q,#`P`#`P-#(V,S8R,#`P`#`P
+M,#`P,#`Q,#`P`#`P-#,R,C(S,#`P`#`P,#`P,#`Q,#`P`#`P-#,V,#8T,#`P
+M`#`P,#`P,#`Q,#`P`#`P-#0Q-S(U,#`P`#`P,#`P,#`Q,#`P`#`P-#0U-38V
+M,#`P`#`P,#`P,#`Q,#`P`#`P-#4Q-#(W,#`P`#`P,#`P,#`Q,#`P`#`P-#4U
+M,C<P,#`P`#`P,#`P,#`Q,#`P`#`P-#8Q,3,R,#`P`#`P,#`P,#`Q,#`P`#`P
+M-#8T-S<S,#`P`#`P,#`P,#`Q,#`P`#`P-#<P-C,T,#`P`#`P,#`P,#`Q,#`P
+M`#`P-#<T-#<U,#`P`#`P,#`P,#`Q,#`P`#`P-3`P,S,V,#`P`#`P,#`P,#`Q
+M,#`P`#`P-3`T,3<W,#`P`#`P,#`P,#`Q,#`P`#`P-3$P,#0P,#`P`#`P,#`P
+M,#`Q,#`P`#`P-3$S-S`Q,#`P`#`P,#`P,#`Q,#`P`#`P-3$W-30S,#`P`#`P
+M,#`P,#`Q,#`P``$`````````,#`U,C,T,#0P,#``,#`P,#`P,#$P,#``,#`U
+M,C<R-#4P,#``,#`P,#`P,#$P,#``,#`U,S,Q,#8P,#``,#`P,#`P,#$P,#``
+M,#`U,S8W-#<P,#``,#`P,#`P,#$P,#``,#`U-#(V,3`P,#``,#`P,#`P,#$P
+M,#``,#`U-#8T-3$P,#``,#`P,#`P,#$P,#``,#`U-3(S,3(P,#``,#`P,#`P
+M,#$P,#``,#`U-38Q-30P,#``,#`P,#`P,#$P,#``,#`U-C(P,34P,#``,#`P
+M,#`P,#$P,#``,#`U-C4V-38P,#``,#`P,#`P,#$P,#``,#`U-S$U,3<P,#``
+M,#`P,#`P,#`S,#$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!N;VXM<W!A<G-E````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````,#$P,#8T-``P,#`Q-S4P`#`P,#$W-3``,#`P
+M,#`P,#`P,#``,3`W,S,Q,#$Q-#$`,#$Q,C$P`"`P````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````'5S=&%R
+M("``=&EM``````````````````````````````````````!T:6T`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+/````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu
new file mode 100644
index 00000000000..c801db84073
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu
@@ -0,0 +1,1370 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
+begin 644 test_read_format_gtar_sparse_1_17.tar
+M<W!A<G-E````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`R,#`P
+M`#$P-S,S,3`Q,30P`#`Q-S<Q,P`@4P``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<B`@`'1I;0``
+M````````````````````````````````````=&EM````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,S8T,3`P,``P,#`P,#`P
+M,3`P,``P,#`P-S4P,C`P,``P,#`P,#`P,3`P,``P,#`Q-#`P,#`P,``P,#`P
+M,#`P,#`P,```````````````````````````````````,#`P,30P,#`P,#``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````<W!A<G-E,@``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P
+M,30R,S`Q`#$P-S,S,3`Q,30Q`#`R,C$S,@`@4P``````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<B`@
+M`'1I;0``````````````````````````````````````=&EM````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````P,#`P,S8T,3`P,``P
+M,#`P,#`P,3`P,``P,#`P-S4P,C`P,``P,#`P,#`P,3`P,``P,#`Q,S,T,S`P
+M,``P,#`P,#`P,3`P,``P,#`Q-S(P-#`P,``P,#`P,#`P,3`P,``!,#`U-S$U
+M,3<S,#$````````````````````````P,#`R,S`T-3`P,``P,#`P,#`P,3`P
+M,``P,#`R-C<P-C`P,``P,#`P,#`P,3`P,``P,#`S,C4T-S`P,``P,#`P,#`P
+M,3`P,``P,#`S-C0Q,3`P,``P,#`P,#`P,3`P,``P,#`T,C(U,C`P,``P,#`P
+M,#`P,3`P,``P,#`T-C$Q,S`P,``P,#`P,#`P,3`P,``P,#`U,3<U-#`P,``P
+M,#`P,#`P,3`P,``P,#`U-38Q-3`P,``P,#`P,#`P,3`P,``P,#`V,30U-C`P
+M,``P,#`P,#`P,3`P,``P,#`V-3,Q-S`P,``P,#`P,#`P,3`P,``P,#`W,3$V
+M,#`P,``P,#`P,#`P,3`P,``P,#`W-3`R,C`P,``P,#`P,#`P,3`P,``P,#$P
+M,#8V,S`P,``P,#`P,#`P,3`P,``P,#$P-#4R-#`P,``P,#`P,#`P,3`P,``P
+M,#$Q,#,V-3`P,``P,#`P,#`P,3`P,``P,#$Q-#(R-C`P,``P,#`P,#`P,3`P
+M,``P,#$R,#`V-S`P,``P,#`P,#`P,3`P,``P,#$R,S<S,#`P,``P,#`P,#`P
+M,3`P,``P,#$R-S4W,3`P,``P,#`P,#`P,3`P,``P,#$S,S0S,S`P,``P,#`P
+M,#`P,3`P,``P,#$S-S(W-#`P,``P,#`P,#`P,3`P,``!`````````#`P,30S
+M,3,U,#`P`#`P,#`P,#`Q,#`P`#`P,30V-S<V,#`P`#`P,#`P,#`Q,#`P`#`P
+M,34R-C,W,#`P`#`P,#`P,#`Q,#`P`#`P,34V-3`P,#`P`#`P,#`P,#`Q,#`P
+M`#`P,38R,S0Q,#`P`#`P,#`P,#`Q,#`P`#`P,38V,C`R,#`P`#`P,#`P,#`Q
+M,#`P`#`P,3<R,#0T,#`P`#`P,#`P,#`Q,#`P`#`P,3<U-S`U,#`P`#`P,#`P
+M,#`Q,#`P`#`P,C`Q-30V,#`P`#`P,#`P,#`Q,#`P`#`P,C`U-#`W,#`P`#`P
+M,#`P,#`Q,#`P`#`P,C$Q,C4P,#`P`#`P,#`P,#`Q,#`P`#`P,C$U,3$Q,#`P
+M`#`P,#`P,#`Q,#`P`#`P,C(P-S4R,#`P`#`P,#`P,#`Q,#`P`#`P,C(T-C$S
+M,#`P`#`P,#`P,#`Q,#`P`#`P,C,P-#4U,#`P`#`P,#`P,#`Q,#`P`#`P,C,T
+M,S$V,#`P`#`P,#`P,#`Q,#`P`#`P,C0P,34W,#`P`#`P,#`P,#`Q,#`P`#`P
+M,C0T,#(P,#`P`#`P,#`P,#`Q,#`P`#`P,C0W-C8Q,#`P`#`P,#`P,#`Q,#`P
+M`#`P,C4S-3(R,#`P`#`P,#`P,#`Q,#`P`#`P,C4W,S8S,#`P`#`P,#`P,#`Q
+M,#`P``$`````````,#`R-C,R,C0P,#``,#`P,#`P,#$P,#``,#`R-C<P-C8P
+M,#``,#`P,#`P,#$P,#``,#`R-S(W,C<P,#``,#`P,#`P,#$P,#``,#`R-S8U
+M-S`P,#``,#`P,#`P,#$P,#``,#`S,#(T,S$P,#``,#`P,#`P,#$P,#``,#`S
+M,#8R-S(P,#``,#`P,#`P,#$P,#``,#`S,3(Q,S,P,#``,#`P,#`P,#$P,#``
+M,#`S,34W-S0P,#``,#`P,#`P,#$P,#``,#`S,C$V,S4P,#``,#`P,#`P,#$P
+M,#``,#`S,C4T-S<P,#``,#`P,#`P,#$P,#``,#`S,S$S-#`P,#``,#`P,#`P
+M,#$P,#``,#`S,S4R,#$P,#``,#`P,#`P,#$P,#``,#`S-#$P-#(P,#``,#`P
+M,#`P,#$P,#``,#`S-#0W,#,P,#``,#`P,#`P,#$P,#``,#`S-3`U-#0P,#``
+M,#`P,#`P,#$P,#``,#`S-30T,#4P,#``,#`P,#`P,#$P,#``,#`S-C`R-#8P
+M,#``,#`P,#`P,#$P,#``,#`S-C0Q,3`P,#``,#`P,#`P,#$P,#``,#`S-C<W
+M-3$P,#``,#`P,#`P,#$P,#``,#`S-S,V,3(P,#``,#`P,#`P,#$P,#``,#`S
+M-S<T-3,P,#``,#`P,#`P,#$P,#```0`````````P,#0P,S,Q-#`P,``P,#`P
+M,#`P,3`P,``P,#0P-S$U-3`P,``P,#`P,#`P,3`P,``P,#0Q,S`Q-C`P,``P
+M,#`P,#`P,3`P,``P,#0Q-C8U-S`P,``P,#`P,#`P,3`P,``P,#0R,C4R,3`P
+M,``P,#`P,#`P,3`P,``P,#0R-C,V,C`P,``P,#`P,#`P,3`P,``P,#0S,C(R
+M,S`P,``P,#`P,#`P,3`P,``P,#0S-C`V-#`P,``P,#`P,#`P,3`P,``P,#0T
+M,3<R-3`P,``P,#`P,#`P,3`P,``P,#0T-34V-C`P,``P,#`P,#`P,3`P,``P
+M,#0U,30R-S`P,``P,#`P,#`P,3`P,``P,#0U-3(W,#`P,``P,#`P,#`P,3`P
+M,``P,#0V,3$S,C`P,``P,#`P,#`P,3`P,``P,#0V-#<W,S`P,``P,#`P,#`P
+M,3`P,``P,#0W,#8S-#`P,``P,#`P,#`P,3`P,``P,#0W-#0W-3`P,``P,#`P
+M,#`P,3`P,``P,#4P,#,S-C`P,``P,#`P,#`P,3`P,``P,#4P-#$W-S`P,``P
+M,#`P,#`P,3`P,``P,#4Q,#`T,#`P,``P,#`P,#`P,3`P,``P,#4Q,S<P,3`P
+M,``P,#`P,#`P,3`P,``P,#4Q-S4T,S`P,``P,#`P,#`P,3`P,``!````````
+M`#`P-3(S-#`T,#`P`#`P,#`P,#`Q,#`P`#`P-3(W,C0U,#`P`#`P,#`P,#`Q
+M,#`P`#`P-3,S,3`V,#`P`#`P,#`P,#`Q,#`P`#`P-3,V-S0W,#`P`#`P,#`P
+M,#`Q,#`P`#`P-30R-C$P,#`P`#`P,#`P,#`Q,#`P`#`P-30V-#4Q,#`P`#`P
+M,#`P,#`Q,#`P`#`P-34R,S$R,#`P`#`P,#`P,#`Q,#`P`#`P-34V,34T,#`P
+M`#`P,#`P,#`Q,#`P`#`P-38R,#$U,#`P`#`P,#`P,#`Q,#`P`#`P-38U-C4V
+M,#`P`#`P,#`P,#`Q,#`P`#`P-3<Q-3$W,#`P`#`P,#`P,#`P,S`Q````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````;F]N+7-P87)S
+M90``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,#`P`#$P-S,S,3`Q
+M,30Q`#`Q,3(P-P`@,```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!U<W1A<B`@`'1I;0``````````````
+M````````````````````````=&EM````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+/````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu
new file mode 100644
index 00000000000..6001635f6ad
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu
@@ -0,0 +1,1597 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
+begin 644 test_read_format_gtar_sparse_1_17_posix00.tar
+M+B]087A(96%D97)S+C,X-C4Y+W-P87)S90``````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P-#`R
+M`#$P-S,S,3`Q,30R`#`Q,S0W,``@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`P`#`P,#`P,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````R-R!'3E4N<W!A<G-E+G-I>F4],S$T-3<R.`HR
+M-B!'3E4N<W!A<G-E+FYU;6)L;V-K<STS"C(X($=.52YS<&%R<V4N;V9F<V5T
+M/3DY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HR.2!'3E4N<W!A
+M<G-E+F]F9G-E=#TQ.3DY.#<R"C(W($=.52YS<&%R<V4N;G5M8GET97,]-3$R
+M"C(Y($=.52YS<&%R<V4N;V9F<V5T/3,Q-#4W,C@*,C4@1TY5+G-P87)S92YN
+M=6UB>71E<STP"C(P(&%T:6UE/3$Q.3@R.3,V,#$*,C`@8W1I;64],3$Y.#(Y
+M,S8P,`H`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````'-P87)S90``````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,C`P,``Q,#<S,S$P,3$T
+M,``P,3$W,C``(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````"XO4&%X
+M2&5A9&5R<RXS.#8U.2]S<&%R<V4R````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`Q,S$S-P`Q,#<S
+M,S$P,3$T,@`P,3,U-C,`('@`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P,#`P,``P,#`P,#`P````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````,C@@1TY5+G-P87)S92YS:7IE/3DY,#`P,#`Q"C(W($=.
+M52YS<&%R<V4N;G5M8FQO8VMS/3DY"C(X($=.52YS<&%R<V4N;V9F<V5T/3DY
+M.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HR.2!'3E4N<W!A<G-E
+M+F]F9G-E=#TQ.3DY.#<R"C(W($=.52YS<&%R<V4N;G5M8GET97,]-3$R"C(Y
+M($=.52YS<&%R<V4N;V9F<V5T/3(Y.3DX,#@*,C<@1TY5+G-P87)S92YN=6UB
+M>71E<STU,3(*,CD@1TY5+G-P87)S92YO9F9S970],SDY.3<T-`HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HR.2!'3E4N<W!A<G-E+F]F9G-E=#TT.3DY
+M-C@P"C(W($=.52YS<&%R<V4N;G5M8GET97,]-3$R"C(Y($=.52YS<&%R<V4N
+M;V9F<V5T/34Y.3DV,38*,C<@1TY5+G-P87)S92YN=6UB>71E<STU,3(*,CD@
+M1TY5+G-P87)S92YO9F9S970]-CDY.34U,@HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HR.2!'3E4N<W!A<G-E+F]F9G-E=#TX,#`P,#`P"C(W($=.52YS
+M<&%R<V4N;G5M8GET97,]-3$R"C(Y($=.52YS<&%R<V4N;V9F<V5T/3@Y.3DY
+M,S8*,C<@1TY5+G-P87)S92YN=6UB>71E<STU,3(*,CD@1TY5+G-P87)S92YO
+M9F9S970].3DY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TQ,#DY.3@P.`HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ,3DY.3<T-`HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ,CDY
+M.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TQ,SDY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TQ-#DY.34U,@HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ-C`P,#`P,`HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ
+M-CDY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TQ-SDY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ.#DY.3@P.`HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TQ.3DY.3<T-`HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TR,#DY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TR,3DY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TR,CDY.34U,@HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TR-#`P,#`P
+M,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F
+M9G-E=#TR-#DY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TR-3DY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TR-CDY.3@P.`HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TR-SDY
+M.3<T-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TR.#DY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TR.3DY.38Q-@HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS,#DY.34U,@HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS
+M,C`P,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TS,CDY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS,SDY.3@W,@HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS-#DY.3@P.`HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TS-3DY.3<T-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TS-CDY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS-SDY.38Q-@HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TS.#DY.34U
+M,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F
+M9G-E=#TT,#`P,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TT,#DY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT,3DY.3@W,@HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT,CDY
+M.3@P.`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TT,SDY.3<T-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TT-#DY.38X,`HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT-3DY.38Q-@HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT
+M-CDY.34U,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TT.#`P,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT.#DY.3DS-@HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TT.3DY.3@W,@HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TU,#DY.3@P.`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TU,3DY.3<T-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TU,CDY.38X,`HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TU,SDY.38Q
+M-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F
+M9G-E=#TU-#DY.34U,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TU-C`P,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TU-CDY.3DS-@HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TU-SDY
+M.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TU.#DY.3@P.`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TU.3DY.3<T-`HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV,#DY.38X,`HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV
+M,3DY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TV,CDY.34U,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV-#`P,#`P,`HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV-#DY.3DS-@HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TV-3DY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TV-CDY.3@P.`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV-SDY.3<T-`HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TV.#DY.38X
+M,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F
+M9G-E=#TV.3DY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TW,#DY.34U,@HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TW,C`P,#`P,`HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TW,CDY
+M.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TW,SDY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TW-#DY.3@P.`HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TW-3DY.3<T-`HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TW
+M-CDY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TW-SDY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TW.#DY.34U,@HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TX,#`P,#`P,`HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TX,#DY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TX,3DY.3@W,@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TX,CDY.3@P.`HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TX,SDY.3<T
+M-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F
+M9G-E=#TX-#DY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'
+M3E4N<W!A<G-E+F]F9G-E=#TX-3DY.38Q-@HR-R!'3E4N<W!A<G-E+FYU;6)Y
+M=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TX-CDY.34U,@HR-R!'3E4N
+M<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TX.#`P
+M,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E
+M+F]F9G-E=#TX.#DY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS
+M,"!'3E4N<W!A<G-E+F]F9G-E=#TX.3DY.3@W,@HR-R!'3E4N<W!A<G-E+FYU
+M;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY,#DY.3@P.`HR-R!'
+M3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY
+M,3DY.3<T-`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A
+M<G-E+F]F9G-E=#TY,CDY.38X,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q
+M,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY,SDY.38Q-@HR-R!'3E4N<W!A<G-E
+M+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY-#DY.34U,@HR
+M-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E
+M=#TY-C`P,#`P,`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N
+M<W!A<G-E+F]F9G-E=#TY-CDY.3DS-@HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S
+M/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY-SDY.3@W,@HR-R!'3E4N<W!A
+M<G-E+FYU;6)Y=&5S/34Q,@HS,"!'3E4N<W!A<G-E+F]F9G-E=#TY.#DY.3@P
+M.`HR-R!'3E4N<W!A<G-E+FYU;6)Y=&5S/3$Y,PHR,"!A=&EM93TQ,3DX,CDS
+M-C`R"C(P(&-T:6UE/3$Q.3@R.3,V,#$*````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````<W!A<G-E,@``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,30R,S`Q`#$P-S,S,3`Q
+M,30Q`#`Q,C`Q-``@,```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!U<W1A<@`P,'1I;0``````````````
+M````````````````````````=&EM````````````````````````````````
+M```````P,#`P,#`P`#`P,#`P,#``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````N+U!A>$AE861E<G,N,S@V-3DO
+M;F]N+7-P87)S90``````````````````````````````````````````````
+M````````````````````````````````````````````````,#`P,#8T-``P
+M,#`Q-S4P`#`P,#$W-3``,#`P,#`P,#`P-3``,3`W,S,Q,#$Q-#(`,#$T,C4W
+M`"!X````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````'5S=&%R`#`P````````````````````````````````
+M`````````````````````````````````````````````````````#`P,#`P
+M,#``,#`P,#`P,```````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````#(P
+M(&%T:6UE/3$Q.3@R.3,V,#$*,C`@8W1I;64],3$Y.#(Y,S8P,0H`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````;F]N+7-P87)S90``````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q
+M-S4P`#`P,#`P,#`P,#`P`#$P-S,S,3`Q,30Q`#`Q,C4P-P`@,```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!U<W1A<@`P,'1I;0``````````````````````````````````````=&EM
+M```````````````````````````````````````P,#`P,#`P`#`P,#`P,#``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+H````````````````````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu
new file mode 100644
index 00000000000..6a2ad83c4d3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu
@@ -0,0 +1,1370 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
+begin 644 test_read_format_gtar_sparse_1_17_posix01.tar
+M+B]087A(96%D97)S+C,X-C8Q+W-P87)S90``````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,C4R
+M`#$P-S,S,3`Q,30R`#`Q,S0V-``@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`P`#`P,#`P,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````R-R!'3E4N<W!A<G-E+G-I>F4],S$T-3<R.`HR
+M-B!'3E4N<W!A<G-E+FYU;6)L;V-K<STS"C(V($=.52YS<&%R<V4N;F%M93US
+M<&%R<V4*-3$@1TY5+G-P87)S92YM87`].3DY.3,V+#4Q,BPQ.3DY.#<R+#4Q
+M,BPS,30U-S(X+#`*,C`@871I;64],3$Y.#(Y,S8P,@HR,"!C=&EM93TQ,3DX
+M,CDS-C`P"@``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO1TY54W!A<G-E
+M1FEL92XS.#8V,2]S<&%R<V4`````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,C`P,``Q,#<S,S$P,3$T
+M,``P,34Q-3(`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````"XO4&%X
+M2&5A9&5R<RXS.#8V,2]S<&%R<V4R````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,C8Q,@`Q,#<S
+M,S$P,3$T,P`P,3,U-3$`('@`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P,#`P,``P,#`P,#`P````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````,C@@1TY5+G-P87)S92YS:7IE/3DY,#`P,#`Q"C(W($=.
+M52YS<&%R<V4N;G5M8FQO8VMS/3DY"C(W($=.52YS<&%R<V4N;F%M93US<&%R
+M<V4R"C$R.38@1TY5+G-P87)S92YM87`].3DY.3,V+#4Q,BPQ.3DY.#<R+#4Q
+M,BPR.3DY.#`X+#4Q,BPS.3DY-S0T+#4Q,BPT.3DY-C@P+#4Q,BPU.3DY-C$V
+M+#4Q,BPV.3DY-34R+#4Q,BPX,#`P,#`P+#4Q,BPX.3DY.3,V+#4Q,BPY.3DY
+M.#<R+#4Q,BPQ,#DY.3@P."PU,3(L,3$Y.3DW-#0L-3$R+#$R.3DY-C@P+#4Q
+M,BPQ,SDY.38Q-BPU,3(L,30Y.3DU-3(L-3$R+#$V,#`P,#`P+#4Q,BPQ-CDY
+M.3DS-BPU,3(L,3<Y.3DX-S(L-3$R+#$X.3DY.#`X+#4Q,BPQ.3DY.3<T-"PU
+M,3(L,C`Y.3DV.#`L-3$R+#(Q.3DY-C$V+#4Q,BPR,CDY.34U,BPU,3(L,C0P
+M,#`P,#`L-3$R+#(T.3DY.3,V+#4Q,BPR-3DY.3@W,BPU,3(L,C8Y.3DX,#@L
+M-3$R+#(W.3DY-S0T+#4Q,BPR.#DY.38X,"PU,3(L,CDY.3DV,38L-3$R+#,P
+M.3DY-34R+#4Q,BPS,C`P,#`P,"PU,3(L,S(Y.3DY,S8L-3$R+#,S.3DY.#<R
+M+#4Q,BPS-#DY.3@P."PU,3(L,S4Y.3DW-#0L-3$R+#,V.3DY-C@P+#4Q,BPS
+M-SDY.38Q-BPU,3(L,S@Y.3DU-3(L-3$R+#0P,#`P,#`P+#4Q,BPT,#DY.3DS
+M-BPU,3(L-#$Y.3DX-S(L-3$R+#0R.3DY.#`X+#4Q,BPT,SDY.3<T-"PU,3(L
+M-#0Y.3DV.#`L-3$R+#0U.3DY-C$V+#4Q,BPT-CDY.34U,BPU,3(L-#@P,#`P
+M,#`L-3$R+#0X.3DY.3,V+#4Q,BPT.3DY.3@W,BPU,3(L-3`Y.3DX,#@L-3$R
+M+#4Q.3DY-S0T+#4Q,BPU,CDY.38X,"PU,3(L-3,Y.3DV,38L-3$R+#4T.3DY
+M-34R+#4Q,BPU-C`P,#`P,"PU,3(L-38Y.3DY,S8L-3$R+#4W.3DY.#<R+#4Q
+M,BPU.#DY.3@P."PU,3(L-3DY.3DW-#0L-3$R+#8P.3DY-C@P+#4Q,BPV,3DY
+M.38Q-BPU,3(L-C(Y.3DU-3(L-3$R+#8T,#`P,#`P+#4Q,BPV-#DY.3DS-BPU
+M,3(L-C4Y.3DX-S(L-3$R+#8V.3DY.#`X+#4Q,BPV-SDY.3<T-"PU,3(L-C@Y
+M.3DV.#`L-3$R+#8Y.3DY-C$V+#4Q,BPW,#DY.34U,BPU,3(L-S(P,#`P,#`L
+M-3$R+#<R.3DY.3,V+#4Q,BPW,SDY.3@W,BPU,3(L-S0Y.3DX,#@L-3$R+#<U
+M.3DY-S0T+#4Q,BPW-CDY.38X,"PU,3(L-S<Y.3DV,38L-3$R+#<X.3DY-34R
+M+#4Q,BPX,#`P,#`P,"PU,3(L.#`Y.3DY,S8L-3$R+#@Q.3DY.#<R+#4Q,BPX
+M,CDY.3@P."PU,3(L.#,Y.3DW-#0L-3$R+#@T.3DY-C@P+#4Q,BPX-3DY.38Q
+M-BPU,3(L.#8Y.3DU-3(L-3$R+#@X,#`P,#`P+#4Q,BPX.#DY.3DS-BPU,3(L
+M.#DY.3DX-S(L-3$R+#DP.3DY.#`X+#4Q,BPY,3DY.3<T-"PU,3(L.3(Y.3DV
+M.#`L-3$R+#DS.3DY-C$V+#4Q,BPY-#DY.34U,BPU,3(L.38P,#`P,#`L-3$R
+M+#DV.3DY.3,V+#4Q,BPY-SDY.3@W,BPU,3(L.3@Y.3DX,#@L,3DS"C(P(&%T
+M:6UE/3$Q.3@R.3,V,#(*,C`@8W1I;64],3$Y.#(Y,S8P,0H`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````+B]'3E53<&%R<V5&:6QE+C,X-C8Q+W-P87)S
+M93(`````````````````````````````````````````````````````````
+M`````````````````````````````````````#`P,#`V-#0`,#`P,3<U,``P
+M,#`Q-S4P`#`P,#`P,30R,S`Q`#$P-S,S,3`Q,30Q`#`Q-3(T-@`@,```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!U<W1A<@`P,'1I;0``````````````````````````````````````
+M=&EM```````````````````````````````````````P,#`P,#`P`#`P,#`P
+M,#``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````N+U!A>$AE861E<G,N,S@V-C$O;F]N+7-P87)S90``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````,#`P,#8T-``P,#`Q-S4P`#`P,#$W-3``,#`P
+M,#`P,#`P-3``,3`W,S,Q,#$Q-#,`,#$T,C4Q`"!X````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````'5S=&%R
+M`#`P````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#`P,#``,#`P,#`P,```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````#(P(&%T:6UE/3$Q.3@R.3,V,#$*
+M,C`@8W1I;64],3$Y.#(Y,S8P,0H`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````;F]N
+M+7-P87)S90``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,#`P`#$P
+M-S,S,3`Q,30Q`#`Q,C4P-P`@,```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!U<W1A<@`P,'1I;0``````
+M````````````````````````````````=&EM````````````````````````
+M```````````````P,#`P,#`P`#`P,#`P,#``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+/````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu
new file mode 100644
index 00000000000..80e802a46b3
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu
@@ -0,0 +1,1370 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
+begin 644 test_read_format_gtar_sparse_1_17_posix10.tar
+M+B]087A(96%D97)S+C,X-C8S+W-P87)S90``````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,C$U
+M`#$P-S,S,3`Q,30S`#`Q,S0V-@`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`P`#`P,#`P,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````R,B!'3E4N<W!A<G-E+FUA:F]R/3$*,C(@1TY5
+M+G-P87)S92YM:6YO<CTP"C(V($=.52YS<&%R<V4N;F%M93US<&%R<V4*,S$@
+M1TY5+G-P87)S92YR96%L<VEZ93TS,30U-S(X"C(P(&%T:6UE/3$Q.3@R.3,V
+M,#(*,C`@8W1I;64],3$Y.#(Y,S8P,`H`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO1TY54W!A<G-E
+M1FEL92XS.#8V,R]S<&%R<V4`````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,S`P,``Q,#<S,S$P,3$T
+M,``P,34Q-34`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````,PHY.3DY,S8*-3$R"C$Y.3DX-S(*-3$R"C,Q-#4W,C@*,`H`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````+B]087A(96%D97)S+C,X-C8S+W-P87)S93(`````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P
+M`#`P,#`P,#`P,C$W`#$P-S,S,3`Q,30S`#`Q,S4U,@`@>```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`P`#`P,#`P,#``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````R,B!'3E4N<W!A<G-E+FUA
+M:F]R/3$*,C(@1TY5+G-P87)S92YM:6YO<CTP"C(W($=.52YS<&%R<V4N;F%M
+M93US<&%R<V4R"C,R($=.52YS<&%R<V4N<F5A;'-I>F4].3DP,#`P,#$*,C`@
+M871I;64],3$Y.#(Y,S8P,PHR,"!C=&EM93TQ,3DX,CDS-C`Q"@``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`"XO1TY54W!A<G-E1FEL92XS.#8V,R]S<&%R<V4R````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#$T-3,P
+M,0`Q,#<S,S$P,3$T,0`P,34R-3,`(#``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#!T:6T`
+M`````````````````````````````````````'1I;0``````````````````
+M````````````````````,#`P,#`P,``P,#`P,#`P````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````.3D*.3DY.3,V"C4Q,@HQ.3DY.#<R"C4Q,@HR
+M.3DY.#`X"C4Q,@HS.3DY-S0T"C4Q,@HT.3DY-C@P"C4Q,@HU.3DY-C$V"C4Q
+M,@HV.3DY-34R"C4Q,@HX,#`P,#`P"C4Q,@HX.3DY.3,V"C4Q,@HY.3DY.#<R
+M"C4Q,@HQ,#DY.3@P.`HU,3(*,3$Y.3DW-#0*-3$R"C$R.3DY-C@P"C4Q,@HQ
+M,SDY.38Q-@HU,3(*,30Y.3DU-3(*-3$R"C$V,#`P,#`P"C4Q,@HQ-CDY.3DS
+M-@HU,3(*,3<Y.3DX-S(*-3$R"C$X.3DY.#`X"C4Q,@HQ.3DY.3<T-`HU,3(*
+M,C`Y.3DV.#`*-3$R"C(Q.3DY-C$V"C4Q,@HR,CDY.34U,@HU,3(*,C0P,#`P
+M,#`*-3$R"C(T.3DY.3,V"C4Q,@HR-3DY.3@W,@HU,3(*,C8Y.3DX,#@*-3$R
+M"C(W.3DY-S0T"C4Q,@HR.#DY.38X,`HU,3(*,CDY.3DV,38*-3$R"C,P.3DY
+M-34R"C4Q,@HS,C`P,#`P,`HU,3(*,S(Y.3DY,S8*-3$R"C,S.3DY.#<R"C4Q
+M,@HS-#DY.3@P.`HU,3(*,S4Y.3DW-#0*-3$R"C,V.3DY-C@P"C4Q,@HS-SDY
+M.38Q-@HU,3(*,S@Y.3DU-3(*-3$R"C0P,#`P,#`P"C4Q,@HT,#DY.3DS-@HU
+M,3(*-#$Y.3DX-S(*-3$R"C0R.3DY.#`X"C4Q,@HT,SDY.3<T-`HU,3(*-#0Y
+M.3DV.#`*-3$R"C0U.3DY-C$V"C4Q,@HT-CDY.34U,@HU,3(*-#@P,#`P,#`*
+M-3$R"C0X.3DY.3,V"C4Q,@HT.3DY.3@W,@HU,3(*-3`Y.3DX,#@*-3$R"C4Q
+M.3DY-S0T"C4Q,@HU,CDY.38X,`HU,3(*-3,Y.3DV,38*-3$R"C4T.3DY-34R
+M"C4Q,@HU-C`P,#`P,`HU,3(*-38Y.3DY,S8*-3$R"C4W.3DY.#<R"C4Q,@HU
+M.#DY.3@P.`HU,3(*-3DY.3DW-#0*-3$R"C8P.3DY-C@P"C4Q,@HV,3DY.38Q
+M-@HU,3(*-C(Y.3DU-3(*-3$R"C8T,#`P,#`P"C4Q,@HV-#DY.3DS-@HU,3(*
+M-C4Y.3DX-S(*-3$R"C8V.3DY.#`X"C4Q,@HV-SDY.3<T-`HU,3(*-C@Y.3DV
+M.#`*-3$R"C8Y.3DY-C$V"C4Q,@HW,#DY.34U,@HU,3(*-S(P,#`P,#`*-3$R
+M"C<R.3DY.3,V"C4Q,@HW,SDY.3@W,@HU,3(*-S0Y.3DX,#@*-3$R"C<U.3DY
+M-S0T"C4Q,@HW-CDY.38X,`HU,3(*-S<Y.3DV,38*-3$R"C<X.3DY-34R"C4Q
+M,@HX,#`P,#`P,`HU,3(*.#`Y.3DY,S8*-3$R"C@Q.3DY.#<R"C4Q,@HX,CDY
+M.3@P.`HU,3(*.#,Y.3DW-#0*-3$R"C@T.3DY-C@P"C4Q,@HX-3DY.38Q-@HU
+M,3(*.#8Y.3DU-3(*-3$R"C@X,#`P,#`P"C4Q,@HX.#DY.3DS-@HU,3(*.#DY
+M.3DX-S(*-3$R"CDP.3DY.#`X"C4Q,@HY,3DY.3<T-`HU,3(*.3(Y.3DV.#`*
+M-3$R"CDS.3DY-C$V"C4Q,@HY-#DY.34U,@HU,3(*.38P,#`P,#`*-3$R"CDV
+M.3DY.3,V"C4Q,@HY-SDY.3@W,@HU,3(*.3@Y.3DX,#@*,3DS"@``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````+B]0
+M87A(96%D97)S+C,X-C8S+VYO;BUS<&%R<V4`````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,#4P`#$P
+M-S,S,3`Q,30S`#`Q-#(U,P`@>```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!U<W1A<@`P,```````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P,#`P`#`P,#`P,#``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````R,"!A=&EM93TQ,3DX,CDS-C`Q"C(P(&-T:6UE/3$Q
+M.3@R.3,V,#$*````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&YO;BUS<&%R<V4`````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````P,#`P
+M-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,#`P,``Q,#<S,S$P,3$T,0`P
+M,3(U,#<`(#``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````=7-T87(`,#!T:6T`````````````````````
+M`````````````````'1I;0``````````````````````````````````````
+M,#`P,#`P,``P,#`P,#`P````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+/````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
index cf8fd77cc0c..a9120a21af2 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
@@ -1,3 +1,4 @@
+$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu,v 1.2 2008/07/03 03:26:30 peter Exp $
begin 644 test_read_format_gtar_sparse_1_17_posix10_modified.tar
M+B]087A(96%D97)S+C,X-C8S+W-P87)S90``````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso.iso.Z.uu
new file mode 100644
index 00000000000..989c11251ba
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso.iso.Z.uu
@@ -0,0 +1,26 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1G@0#`6!Z-&!``1`XH$((`"``@4I,$%"%0PD`@`7%%2C
+MB@*IF,8"!UR``0O@"!#0B0=V:.212":IY)),-NGDDU!&*>645%9IY952-K%$
+M$E,\8<04('#Y!`@YV&`##"\@\24(1B3!1!%39#$%%45H*$05;A)1A!0@F`#"
+MA44,\804#PK8@A0O$&%%H5(4$005@X*`PA`I@!!##CG,`$(1+F3Q1!5.'$%$
+M$&]*2JFEF-X`@A(N0.&H%%TZ\0*K4PR!A)M,)!$JEKSVRJL,!-800PPPW"##
+M##+04,,-!((#+`S"$FLLLLHR"P,X!&:K[;8$`O!LM,4>F^RRS1;IZ[GHIJON
+MNNRVZ^Z[\,8K+Y/_U;O8/P(2:*"]_/;K[[\`!UR=EDF`T,0;;H#@Q!MV0*CJ
+ML3HDJ\.R('RK0!MKI#''&V;,4;$+,+B@:0MO@$!'&7/0T8*"89#QA1EOR-%&
+M&'2XH'')80BL\\X\]^SSSV<=6..00!=M]-%()ZWTTDPW[?334$?=&XD!U4BU
+MU%AGK?767'?M]==@ARWVV%K/./1`-PZD(X\^`BEDB4,>:+:-`.`8T-H]_A@D
+MT26:2/;?@`<N^."$%V[XX8@GKOCBC#?N^..01R[YY)17;OGEF&>N^>:<=^[Y
+MYZ"'+OKHI)=N^NFHIZ[ZZJRW[OKKL,<N^^RTUV[[[;CGKOONO/?N^^_`!R_\
+M\,07;_SQR">O_/+,-^_\\]!'+_WTU%=O_?789Z_]]MQW[_WWX(<O_OCDEV_^
+L^>BGK_[Z[+?O_OOPQR___/37;__]^.>O__[\]^___P`,H``'2,`"&O"`]`,`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_gz.c b/archivers/libarchive/files/libarchive/test/test_read_format_iso_gz.c
index 92ada131d2c..822b969e335 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_iso_gz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_gz.c
@@ -23,51 +23,30 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_iso_gz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
-
-static unsigned char archive[] = {
-31,139,8,8,201,'R','p','C',0,3,'t','e','s','t','-','r','e','a','d','_','f',
-'o','r','m','a','t','.','i','s','o',0,237,219,223,'k',211,'@',28,0,240,212,
-23,'K','}',20,169,143,135,15,162,224,218,180,']','W',186,183,173,'I',183,
-206,254,144,'d',19,246,'$',5,';',24,'2',11,235,240,239,221,127,162,233,'f',
-17,29,219,24,12,'\'',243,243,'!',185,187,220,']',146,';',8,9,223,131,'D',
-17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'P',234,
-'%','q',220,'(','E',253,211,217,'l',';','O',194,'u','z','I','6',25,']',219,
-26,194,234,'z',241,'o',217,13,247,'-',182,229,30,149,203,'Q',229,178,170,
-242,252,'W',243,139,'e',242,'*',170,'^',30,'U',163,242,'2','+','G',199,207,
-158,'V','_',190,';',127,178,':',255,134,1,241,23,140,222,15,242,'I','?',15,
-'E',26,186,27,27,'q','}',183,'8',232,15,134,'i','~',152,239,167,163,176,'}',
-'0',24,'&','i',22,'^','/',159,159,180,'7',201,146,162,176,150,213,147,143,
-'E','!','K',183,246,'\'','Y','x',211,'{',27,26,221,'n','+',164,181,195,201,
-193,'x','\'',217,26,166,171,202,'N',216,171,'}','H',183,178,'|','2',174,239,
-213,242,222,238,'`','8',28,140,'w',30,'j',186,205,'8','n','7',26,'q',167,
-217,'j',174,183,';','q','|','~',165,'"',254,'C','t',165,'G',')','z',168,209,
-243,'o',184,143,215,'6',220,139,239,'?',191,255,0,192,255,163,136,224,194,
-'h',254,'5',140,231,223,'B',232,132,'f','k',179,185,190,217,238,'\\',132,
-':',149,147,'/',199,139,249,209,'"','4','k','q',173,21,214,230,225,'l',182,
-'8','[',';',157,'M','?',127,':',154,159,158,'L',207,'j','E','{',152,'>',244,
-28,0,128,187,')',']',172,177,139,255,1,0,0,224,'1',187,136,252,171,22,0,0,
-0,0,224,'1',187,253,31,187,'[','{','X',';',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,206,
-'~',0,137,'#',195,182,0,128,1,0};
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_iso_gz.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_read_format_iso_gz)
{
struct archive_entry *ae;
struct archive *a;
+ const char *name = "test_read_format_iso.iso.Z";
+
+ extract_reference_file(name);
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP);
- assert(archive_format(a) == ARCHIVE_FORMAT_ISO9660);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, name, 512));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
new file mode 100644
index 00000000000..4642fece1b7
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
@@ -0,0 +1,66 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_joliet.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$PDX4056(#@X(,01BBA
+MA`)*\403$V:HX8,'X5*0AQX="$``(AZ(``(`6%"0!10DI*)`(@#`04$SHB@0
+MBD8$(,"!`1`@0$`E'KCAD$06:>212":IY)),-NGDDU!&*>645#YY1!%.)#'%
+M$TDT$<25(&CY!`@YV&`##"\@8<04(!B1!!-%3)'%%%04@>$04A01!!5/2`$"
+M"D.D`$(,.>0P`PA%N)#%$U4X<0010<#Y9Z"#%GI#"S(0:`,(2K@`A9Y2;.G$
+M"YU.,002;R;HZ*2"9@J##9@2>`,(%2Z1!!4@U!D$AE7VZJN3KN8`0Z8TR!!#
+M#3+,0`.!!`0[+`S%'IOLLC`00."UV&9+(`#.$FLLLLHR*^2OY)9K[KGHIJON
+MNNRVZ^Z[2?XG[V(""$B@@0$Q`4`2`#@!0!4`8`$`"`,73/#!!B=,\!``$`&`
+M%``\`4`3"E>,\,4=?EC""T5P%"20`)P(``8%84`R0AH,%*,'!;%L8T`XZLBC
+MCR"/*"+&.%NL<\X\[^QSST#_+'301`]M=-%('ZUTTDPO[7334#\M-<9'`-"Q
+MO_Q.$?&^$P,0!`!5=TQPUEL3G`,`-J`-``P`?`$`$@`8`8#6!,O-K[X=:YW%
+MW`!08777"S_\]]=^2PPQP2@`P'`*!<<`P-EGSU!PQRX`L+?$`/M;M<-?XSVU
+MT9\7';K0W4+[[;3,EAXMN-1:J^WKVZI^>KC5C@OO[;CGKOONO/?N^^]'SBO\
+M8?_86Z"(PR>O_/+,-^_\\]!'+_WTU%=O?50'SE@S``,`T(%`!Q*1!,37EV_^
+M^>BGK_[Z[+?O_OOPQT\8\C*.&%#W`GT?@/CDR^___P`,H``'2,`"&O"`"$Q@
+M>P[$LNT9```?`%]`R`"`-`!`#@K,H`8WR,$.>O"#(`RA"$=(PJ'0CV4B>J!`
+M(G@@"EH0@R6,H0QG2,,:VO"&.,RA#G<('D34CR`U&DC,=C0BFMG/9G.#P@$"
+MX(MW/$P*!0A`(*"`!1($H!U?$T@0VH&_@0R`?D#Z$4$$0`4C:"``#L@1$7ND
+MQIFU00`$J``-1$"`(12!`P$@&$'T6)!V]-$,/QQ($&\4-YD548Q!"H`4H"A%
+M*EH1BP/98A<%\L6"Z*@@9#0C&MM81$[VZ(UQG",!```'[Q7D>R\+62'7:,02
+M#8!_BXQB(IS0!`2T,`UR<.05LQB0+8IQ($0DR"7'6,8SIM&0;$0F`4`I1SH"
+M@`\`"$%!0J#"@1@@1Y6$HP1'M``D!$$*1%#5$ERP@QC$,@"S;$(##H2&,,B!
+M#&Q(@QO6H$M2!&(@@2#%+P42S($,$YC%W&0`LDD`;!X(CLP4I26B.<UJ"N2:
+M`SWH*&N&1B8\P5%?4,(3F."".F&AG$^4)2U'<"`VO,$-9VB!&MX0SS+0H05F
+M2`,;RM`"-X2A#65P`1W*@`<ZQ'2F];RG0/*YSX#T$WQ%!4`FC6E0I18THDY-
+M*!U!`8`8$<2J!6FJ-BFJ`#DU09SD=-PY&T%+!AQH#GEH0SSGJ<M_A&(@H?@'
+M&)$HS*0*8`I,*(&(/&!2E*J4I6EP*4QE2E.;XE2G//4I80/J`*DN$X[-?&PH
+MG<G#REH6?8#\'D%0*<15S@R10#K0.:=8Q5U&LAUVG>L_^<E83SZ5E8X%`""U
+M)TA5$M*UH+69(AE)VD?RTFM<+$@EZXK)UBK3M;&]K'*7R]SFWF9E+;,MS#Q[
+M2(H>"+H$<5EG<6O=`"0N@@2)8"J'^%F*/M"%%^060PE"S8)`E*#;#``$`(`&
+M`(0AO11D0P4!X`8`K`$`7ECO0-I+D/=*-+X\`(!^W\!?`)P!`"T`@!H`P&#]
+M6K`,`*`#A&6[7_UB.,+]O6\;`(#ARFD8PWC(,(<MZ.&U5;4@6"6(5B=Z1#0"
+M8`X`R`,`1FSA!O_7N4`.LI"'[),8@7<@XMVN,G-+HA<W<"#:O>V2NTOD*EOY
+MREB67A&DT(X`*(`*A]AM$J#P!4+E(`9[0D(10&"A(2R!S4D@`I@45"<IG"H(
+MCEHS%"S$IR%L%`1[?H(5XAPG$$RA"E"`0I]P980^`?H)4TA"@]PD*3G1R4Z&
+MMA.>J9"$(4P!"G`*PA36[&<G4"$(0\"5^$P%Z"H((4%34+.?&NVG3Q=A"$EP
+MTQ#VE(2+&II1=DZ4@T:M9U?#6M9A(@*6..VF+8?)"8"60I>^F0406&&C56C"
+MFI5M*FE#@4^S=G2I3YWJ9]/:2YR^:.6RS.YVN_O=2D%#&=A@4@7`^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+(&(_R.(_T:!4`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
new file mode 100644
index 00000000000..030dd3cb268
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
@@ -0,0 +1,71 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_joliet_long.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GA0+@6!Z-&!``1`XH$((`"`!@5I0$%"%@PD`@`<%%2C
+MB@*I:$0``B10(@D"!'3B@1T6:>212":IY)),-NGDDU!&*>645%9I991-+)'$
+M%$\8,04(6SX!0@XVV`##"TAX"8(123!1Q!193$%%$1H*446;1!0A!0@F@'!A
+M$4,\(<6#`K8@Q0M$6$&H%$4$086@(*`P1`H@Q)!##C.`4(0+63Q1A1-'$!&$
+MFY%.6NFE-X"@A`M0-"H%ETZ\L.H40R#1)A-)@'KEKKSN*@.!.<1`(`XPX!!#
+M##7D0"`)O\(0[+#%'IOLL@16:^VU!`+0[+/%1HNLLC"00&2OY)9K[KGHIJON
+MNNRVZ^Z[2_XG[V(""$B@@0$9`8`<`)31+P!"`#`%`$0``(+!"!^L<,((#T$P
+M`%(`\`0`33"\\,46(VR0B`/E4L(+17`TI)``I`@`.`6!@T%"+`HTXP<%P8QC
+M0#KRZ&,`0))<(HD8]YRQST#_+'301`]M=-%('ZUTTDPO[7334#\M==143VUU
+MU557O`0`20@L,8)>']SUP!,?G`,`-J`-``P`?`$`$F`/?+"^73,!0,@#9^$U
+M%7=3C'#`57`-@-T%AQSQP28T_'#$(3L\<<0%'^QPP2U`W/;#5CPLN>4A!W&U
+MU)\W';K3VPK;K;'?+ELZM*A/&RZVL%>K+;"F$]LZN.(:#._NO/?N^^_`!R_\
+M\$K.:_QA_]A;((G'-^_\\]!'+WUQ628!`A5HU`'"$V/0`2$.(!2KP[$Z)`O"
+MM@K(X$*!Z\<0A@V9MJ`$""VH\08;:91!1PMLO.'&&?2K0QK(4"GZG6&`YP.!
+M"Q;X@C3,X0W3BZ`$)TC!"EK0*;B8P8%JI+.2`<`#`CE0#&0P`QK4P`8WP,$%
+M5\C"%KKPA3",H0QG2,,:VO"&CF$>C4I$LX&`,``C+.$)4XC#(AKQB$A,HA*7
+MR,0F.O&)4+S/@6#606=HC(<`B(&V`#`#`-```#50VPT`H,*SL4V+,N"B%\$H
+M1C("P(Q9W&(7OQC&M(VQC&N+8QKGR$8[NA&.:%0C'=N(QS/*<8UU!,`=WYC'
+M0/(QD8L$Y"$'Z<="ZE&0?53D'QLYR4Q&,H]D`$`:]A7%4IKRE*A,I2I7R<I6
+MNO*5P=$AS$AD18$<3(2=A.0F#;E'1!*2D;S$I"XMZ4A?5A*8EWSD+R792TIJ
+MDIBY7"8GF^G)72;3F,]$9C&=^4FVA7*4_(*E.,=)SG*:\YSH3*<ZU\E.F$!B
+MAP2YT4!JUJ,?!0F+)A(8%`X0`%^\`V)2*$```@$%++`@`.WPG$""T(X!%&0`
+M.A32/0<B``X.A`-4,((&`N"`'=439VU00(H6L`,2A'2D)1U"$3@0@!`4Q*4&
+M:4=!VN$&>%[4@SE"D,WLJ3,3!4`*`1UH00^:T($PU*$$@6A!>%20BMHHHQOM
+MZ$Y!*E($D-2D5;TJ`'#QP8*`<&8>].C-<H9/!`31A"A4(5`%F@@G-($-(B0A
+M6E.HK+,.$0=UE>M=\RK$M/)UKG@MD%[]*MB^TK6P@/WK7A&[6#*D00XJ96D'
+M"C)9@^B+(/K2!0!F1!`1&*`@!A#KCT(HI`78-:TNV$$,UAJ`MKXUKH8-[&D/
+M.UO9#I:VM[5M;!5+V-KR%K>[+6QD`U#9@73@L@,Q`G(%HB]";+8@G@6M:'%&
+MVA(M``E!&!2NG+"$U*XVJ*YMP('0$`8YD`%_;EC#4`-`BD`,)!"DF*A`!!#1
+M$LDW(`+@K(R@RM'IDL"_)[5J2=M)X`*+<[U%76@[[@L`^BZ5P0(`(4$\P%^I
+M?O2_4\4J2DFPWO:^-[Y-K2]3"9)?Z%;8OP#.ZH`-S.(6N_C%\JJIA'V(TQ[Z
+M]YXC8RU!#8I0A0:$H1`6,81G+!`*:[2_&0[P594\X)I:5"#RS.F->VHB'2/8
+MQP`XZD.%W-0G!P2C1[;P6)FL80&3`,9H3K.:UYR9E\6LQF'-,(Z%="`W$T1F
+M\]3IA>>\LP#`X[F=_2Q!0IOAZ@;`BMNL)C2I.4QM1O.8S!2F-(.I3$A/4]*6
+MIC0VNWE-;EHST8V.=*6S*6H`_/E@!#D86.DY5CX?NM.*=C2C)PWK4%]ZU)P&
+M-:UUG>E:[_K1I+[UIC\-;$Y_DY1IU*_+!#T00E_8T!```!H`$`92AI(-H@1`
+M3=?`YFY[^]M<F1&J!Z+J/$\9GW4&`!4'@F<IRYG*]06WO.=-[WKW1T_M"(`"
+MJ'"(GTHA"5#X@J6"Y2@D%`$$&!K"$A">!"(<X>"YFI,4:A4$4!T<"AAZ5*"8
+M``*,/\$*#7\3"*90!2A`05!46!.D3CZ%)&!A36TZ.)SD1*>1TZGB5$C"$*8`
+M!3<%80H'#Y03J!"$(:2<"%L:0L>K(`1<3<'@>S("I'@.J"2P:0B.2L(3G#!R
+M3TU\4Q`"^L69[G2H@RE/0[=Z$O0$)JYC/`E-R&X60&"%)S"A"DTX>)YH]6\H
+M/"KJD!(ZT8W>=JE+(>XYW[H+[,WXQCO^\4%!0QG8T#\%0/[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+M^9`0&9$2.9$469$6>9$8F9$:N9$<V9$>^9$@&9(B.9(D69(F>9(HF9(JN9(L
+MV9(N^9(P&9,R.9,T69,V>9,XF9,ZN9,\V9,^^9-`&91".91$691&>91(F91*
+MN91,V91.^910&952.9546956>958F95:N95<V95>^95@&99B.99D699F>99H
+MF99JN99LV99N^99P&9=R.9=T69=V>9=XF9=ZN9=\V9=^^9>`&9B".9B$69B&
+4>9B(F9B*N9B,V9B.^9B0&9F2J90`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
new file mode 100644
index 00000000000..9f1dd09c70f
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
@@ -0,0 +1,68 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_joliet_rockridge.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1G@0+@6!Z-&!``1`XH$((`"`!0590$%"+`HD`@`<%%2C
+MB@*I:$0``B10(@D"!'3B@1T6:>212":IY)),-NGDDU!&*>645%9I991-+)'$
+M%$\8,04(6SX!0@XVV`##"TAX"8(123!1Q!193$%%$1H*446;1!0A!0@F@'!A
+M$4,\(<6#`K8@Q0M$6$&H%$4$086@(*`P1`H@Q)!##C.`4(0+63Q1A1-'$!&$
+MFY%.6NFE-X"@A`M0-"H%ETZ\L.H40R#1)A-)@'KEKKSN*@.!.<1`(`XQU""#
+M##340"`)O\(0[+#%'IOLL@16:^VU!`+0[+,P$&LLLLK"0`*1O99K[KGHIJON
+MNNRVZ^Z[\"[YW[R+"2`@@08&9`0`<@!0AK\`"`'`%``0`0`(!R>,\,(*)SQ$
+MP0!(`<`3`#31,,,87YRP02(.A$L)+Q3!T9!"`I`B`!@4A$'*"&DPT(P>%!0S
+MC@'IR*./`0!9<HDD9NRSQC\'#?300A=-]-%&)XWTTDHWS?333D<-]=125TWU
+MU59;;?$2`"0Q\,0(?HVPUP13C'`.`-B0-@`P`/`%`$B$33#"^WK-!``B$YS%
+MUU3@77'"`E?1-0!W&RRRQ`B;X##$$HO\,,42&XSPPP:W$+';$%L!\>27BQP$
+MUE.#[K3H3V\K;+?1@KNLZ=!^.ZVXV,9>K;;`GNZMM.&.>W"\O/?N^^_`!R_\
+M\,0K2>_QA_US;X$D(N_\\]!'+_WTQ669!`A4H%$'"$^,00>$.%1:@P['ZI`L
+M"-LJ((,+!;(?0Q@V9-J"$B"T4$<:9%1:_QGXHP^""P!\01KF\`;J&?"`"$R@
+M`A>X%5QHX$`UVAD`!@"`#@CD0$1(@L08R,$.>O"#(`RA"$=(PA*:\(0HE$SS
+M:%2B@%!0(!8,0`8WF,(:VO"&.,RA#G?(PQ[Z\(=`U,^!8B9!`P#@`Q<,"!D`
+MD`9^!?&)4(RB%*=(Q2I:\8I8S*(6H;+"F)'(B`)!XH&6V,1^;?&,:$RC&M?(
+MQC:Z\8UPC"-[(,%"@MQH(#;KT8^"U$*>#0P*!PB`+]X1,2D4(`"!@`(66!"`
+M=GQ.($%HQPL',H`5"HF/`Q%`!`?"`2H8X8$.V)$><]8&!2#@`19H`0E*><I4
+MDF`(1>!``!!&$%H6I!VW=$,=.6DR/"+H9GO<F8D"(`5#(E*1C'3D0"(Y28%4
+MLB`\*H@F;>1)4(H29ZLT)2I5R<IMD@``>*A@02Q(LUY>,YA]#,``9EC,0R;"
+M"4U`P!C3(`=D-O*1`8DD)@4B`$N6:)\!$8`%"=*!:@8@E,#,V3E)J4U7`H`0
+M``A!04(`QH$88*'?%.8"D!"$0>'*"4MPP0YBT,X`O+,)#3@0&L(@!S*P(0UN
+M6(,]21&(@02"%``%0#^AF5,!2)0@(3`H0D=)`HQVTY6>B.A$*RJ0BR8TH^ET
+M`!.>`*HO*.$)3'#!G+`PTD*Z$YXC.!`;WN"&,[1`#6]X:1GHT`(SI($-96B!
+M&\+0AC*X@`YEP`,=W`K7F=94(#?MJ3^C21"?3E2H&#5J0U6)"@#`XQ^0C2P\
+M#H+1))9(`7!JPD=#VM62-@*>##C0'/+0AI?&U)[M",5`0M&.P0ZVIX^-+&3A
+M,04FE(!$'AAK6<^:UC2LM:UOC>M<ZWK7O.XUN(A5IX\$4%3EZC2;K52E'*=+
+M7?7H<J`#(:<O,<I'DI4TD8N\YS+;(5B>2A.[,$PN48_*S<5^4Y>;%,@=<_1+
+MHG972";Z+FKQ"0!F%N29!"%L)N,;D$Y^\J"*C2YTO5G=!COXP1!N#<QDUDOZ
+M<E>8!YHP06:VW:?>EV<!0,$1"X+$<N81FQ\.@!')Z$09*!6H3`V(4XEJV0!`
+M``!H`$`8G+A$-C`1`+I<`P"\\.*!4+0@,\9FC7D``!\74)=G`(#EU`"``OJX
+MB?^B@Y0!8(8?^_A?EM/ECML`,!<`0,O_"J>6N]S$+[/-L;*=+66?6F,'`&`.
+M`,@#`,A\92`#0,@1#K2@!TWHH<P(B00I<8?MBV$`:'@@'+:PAS'LST);^M*8
+MSO0!]=1:!5#A$,240A*@\`5+!<M12"@""#`TA"6L.@E$.(*J<S4G*=0J"*!2
+M-10P]*A`,0$$NWZ"%6#])A!,H0I0@(*@J+`F2"E["DG`PIK:I&HXR8E.QJ83
+MKJF0A"%,`0IN"L(45!TH)U`A"$-@=@9I!>PJ"`%74TCUGHP`J6\#*@EL&H*C
+MDD!58WO*UIN"T+AU[6YXRQM,>3(WOI.@)S`Y`=BB;D)'LP`"*V"U"DU0=9YH
+M)6HH/&K>D"KWN=/M<'I+0>+<IJJ9-<WREKO\Y4]!0QG8,%8%P/SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+M^9`0&9$2.9$469$6>9$8F9$:N9$<V9$>^9$@&9(B.9(D69(F>9(HF9(JN9(L
+.V9(N^9(P&9,R.9,T^8(`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.c b/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.c
new file mode 100644
index 00000000000..3ec472dab2b
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.c
@@ -0,0 +1,94 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_iso_multi_extent.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+DEFINE_TEST(test_read_format_iso_multi_extent)
+{
+ const char *refname = "test_read_format_iso_multi_extent.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Retrieve each of the 2 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 2; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString("file", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(262280, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "head--head--head", 16);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
new file mode 100644
index 00000000000..79100f077c9
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
@@ -0,0 +1,67 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_multi_extent.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GB0#0<*%(`-'X48@(D`((````H4I``%"5DPD`@`<%"0
+MC2L*M*(1`0B0```!D"!`0"8>V.&12":IY)),-NGDDU!&*>645%9IY9583LE$
+M$D($(<402"1A11$@)#'%$R#D8(,-,(!@1!),%#%%%E-0482&5TB1A)U29.GG
+MGX`&*FB2,A"80PP%WD!@#&PJ"@,)A<)P:**+-DH@"01FJNFF!`(0Z:0Q.,HH
+M#(Z28.2@J*:JZJJLMNKJJ[#&*FN5_]6ZF``"+AJB$0#(`4`9OP(@!`!3`$`$
+M`"`@JVRRS"ZK[!#&`B`%`$\`T(2SS6:+K;(&@3C0B"6\4`1'11*9XHHM$J0`
+M!@EI,",`'104;XX![=CCCT$."221(6KK[[;_!@SPP`(73/#!!B>,\,(*-\SP
+MPPY'#/'$$E=,\<466\P$`$D("T`0T@(`+1(<`V`%`.,FVW&QU2:;`P`DD@B#
+MLKQVO/&XQ69!+`!4H&RMLE>$W''/XTZ;,<9('ZUMT@\SK?"GB(9:*:F70DUI
+M@98^RNG6F7IJ:-2B9FTJLK.6;?;9:*>M]MILIVWKVX?]DVN!(<)M]]UXYZWW
+MWL4EX801:$X1!AT@/#$&X:&"0*`.C.I`*@B?*L!&&F*$(<<8:*1A1QF0NW"#
+M"SD0&`8(:<SQ1@MLE+$Y&SW,P,(;=[A1AAP]Q*"##'SGKOONO/?NNU4'VFCN
+M[\07;_SQR">O_/+,-^_\\]"#5G>-^T9O_?789Z_]]MQW[_WWX(>O]X'Q#B_^
+M^>BGK_[Z[+?O_OOPQR__5]/'._W\^.>O__[\]^___P`,H`#S`PGJ$01'`[&7
+MCX`DI.&=B%A0.$``?/$.:4FA``$(!!2PP((`M`%D`@E"&_0U$`'<#T@D%(@`
+MA#<0#E#!"!H(@`-XM,`@T1!?)&B#`B(```@<@`1#*`('`N"!@A31(.TH2#O<
+M8,`6IBB!"+H7`_55I`!(X8(9W&`'/S@0$:8P("8L2(\*LL(;O3"&,Y2B#=68
+MPQWV\(<`X`,`/E`0.N+#1/B(8@U)``@''N!-<7+!#F)P10PFP@E-2,"!S)"&
+MU&DQ2($82"#&1I`'5O*+`!``'0GR@3/*\(8,!&60=,A#'Y)`CEXH2"KO2*0\
+MBI*/?@1D$01)2"P>,I&+;&09'DF"2`IDDB>TY+<P*8!4$L0+GDSC'E])RC>>
+M$@"=*$@G$`&!@4``$:\4$9'^"*=9#K*0`;BE(@'`2$=R$)*2I.2W@DG,:!*D
+M$\E\)3/=:,H!VO.>^'P+C<HWD'E!\954Y!<`]BFO)^I(CS@,*)!.I((YUA$`
+MK`22*]G8Q^H%8$5F`$`:`,"&8#74F`-9)1X1RL"*F@BC&N6H1Z$I36I:$YML
+MU":04+K1C@(KGSC-J4YW&IPB2*$=`5``%0YA13U!X0LQR,&A@D`%))`)0T-8
+M`@CT1(0CD,EO?`)3$)Q@51!``4-4>,(0GL`$KV+("DD@@IQ`,(4J0`$*3Y`"
+M%=P45Z\^80I)P(*;NLE6.ME)0U.XTU:ID(0A3`$*<0I"8$$P5B=0(0A#F"L1
+MS#0$KU9!"%N:@E/[!+@^';8(0TC"FX;`U"0\P0EL?4(5OC1+"`663%"X;&8W
+M6R:U.E:T2?!IF5#[U20TP4M9`($5R%J%)I!)K5,8@E'#RMFZ-O:QD=UM9W]+
+MV-.Z@*?8S:YVM]L7-)0A#&1H00N\"U[QDC>\X_TN>L]K7O6&X;WPC:]\YTO?
+M^7+WOOC-KW[WR]_^^O>_``ZP@`=,X`(;^,`(3K""%\S@!COXP1".L(0G3.$*
+M6_C"&,ZPAC?,X0Y[^,,@#K&(1TSB$IOXQ"A.L8I7S.(6N_C%,(ZQC&=,XQK;
+M^,8XSK&.=\SC'OOXQT`.LI"'3.0B&_G(2$ZRDI?,Y"8[^<E0CK*4ITSE*EOY
+MREC.LI:WS.4N>_G+8`ZSF,=,YC*;^<QH3K.:U\SF-KOYS7".LYSG3.<ZV_G.
+M>,ZSGO?,YS[[^<^`#K2@!TWH0AOZT(A.M*(7S>A&._K1D(ZTI"=-Z4I;^M*8
+MSK2F-\WI3GOZTZ`.M:A'3>I2F_K4J$ZUJE?-ZE:[^M6PCK6L9TWK6MOZUKC.
+MM:YWS>M>^_K7P`ZVL(=-[&(;^]C(3K:RE\WL9CO[V=".MK2G3>UJ6_O:V,ZV
+MMK?-[6Y[^]O@#K>XQTWN<IO[W.A.M[K7S>YVN_O=\(ZWO.=-[WK;^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/?FOJ2_SBTY<.86BD>)&O_!8PGPW+3S[TG2_]Z#=2^-C/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+0^9`0&9$2.9$469$6>9%O"```
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
new file mode 100644
index 00000000000..5f06cb3ab44
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
@@ -0,0 +1,206 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_rockridge.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GA0#Q@,A$$/'QT(0``F'H@``@!84)`%$R14P4`B`'!!
+M03>R*!"+1@0@0`(GDB!`0"D>V.&12":IY)),-NGDDU!&*>645%9IY9583MG$
+M$DE,\8014X#0Y1,@Y&"##3"\@`28(!B1!!-%3)'%%%04H:$05;Q)1!%2@&`"
+M"!<6,<034CPH8`M2O$"$%89*44005!`*`@I#I`!"##GD,`,(1;B0Q1-5.'$$
+M$4'`.6FEEV9Z`PA*N`#%HU)XZ<0+K4XQ!!)O,I&$J%GVZFNO,A"8`PPYR'`#
+MIC'4,$.P,)#`[+#%'IM#LLL22`*!V&:K+8$`/$NLL<@JRRP)1OYJ[KGHIJON
+MNNRVZ^Z[\,;;Y'_T+O:/@`0:6.^^_/;K[[\`5[=E$B!,48<;!9<!!PC&IJI#
+MLCHLR["P"K2Q1AISO&'&'`R[4"`(B()<1QID7`KR&20S#((+++^`\1L!QRSS
+MS#37;'-:!]Y(I$`#`!#BSD0D(<7-1!=M]-%()ZWTTDPW[?334+]F8D`WFMBS
+M0"$&$/3047?M]==@ARWVV&27;?;9:">-B(TX`J!C0#SZ"&0`0NY\XH%30'%`
+M`+Z\`X`44A000"!08$%N.T$,%$0[5P\TP-0"^5B0`%08H4$`#O3X8Y!M)+#!
+M!`^`0$+GGX=.PA!%<!!`!@6Q;E`[!;5C!ML$Y3A0W)O3/>2)1*((N."$&QX`
+MXHHS7M#C!4E.$.668Z[YW*-[#KKHI$]/`@!P^%Q0B&^[C:#<0>Z>X@!;_QY`
+M(DXT@<"!9*0A1^&')R[0XKL/)`#D1-8O$/.79PX^W<_CG/1,!P`Z`$`#!=$`
+M%<+`BX#P(@R5^]_U[!:``[@)3B[800S,A[XF).!`9D@#&\H`OP"0(A`#"00I
+M]!>0^R6/A0#@G_,D&$"Z5<]T?#A@`A?80``\,(*YFR#O3K0`)`2A4+IRPA(R
+MN,'`G2]]#3@0&L(@!S*P(0UN6$,)3YC"%4X.?R>"H0S]%\0:1J]THC,$`$ZA
+M,ZJ=XB!FC!R1%""G)B1QB1K\FQ,;D3X&'&@.>6C#%;-8PG:$8B"A:`<84?3"
+MR4V!"0LP$0%".,+*]:]'`P"2`$B`24V>T7IK8^-`+O!&@]Q0='(D8AWO*`,F
+MFH^/38@B```I2"RN00:%/*1`$KG(18KQD7[T'@`&0(<VP,&2F#OE)TVG3$6L
+ML8TV*F5!.H<!!Q3@!$),T0)6N:LES,"5>X3B'P,YR#7,()>(5&3R?.E()CA`
+M10$AIC$)``!D.D"9^!R@Z!CQS%%*DR#*3&4`MID%.W:3!N`4'"QE2<MRT@"=
+MNU0G01@YT5\R`0('HN>0Z#G,8AZS>??4YS*I)U)']%,@I(2C!`5*4(,JL08)
+M#<!"QUG++-8`H@'AY3H;N;Q'1N!`0V*1CB8IPC+8LY,QY&0`,IG4@/)3E"C]
+MYT"H:4ULLI2;2K1!3&<Z2W+:T@8X!8!.)\K.GEX4GATU)HOH:<]\HG&D0DR;
+M7#,RNY^)2)AP^UX0Q=<[/0*OD/(+"/V^R%/['56";K4>`&8'3:KAU7MFY.O=
+M`F"^X,6O>(WC65D-"U(S)I:`<PVM:$=+VM):A$^*5``5#D%9*20!"E_`U+0@
+MA80B@`!#0UC";9-`A"/8=E=UDL*M@B`JVT(!0Y$:%!-`<-PG6(&W<2I8%:``
+M!4)1H4V2JNX4DH"%-KW)MG*BDYT*9B?B4B$)0\@;G((P!=L.R@E4",(0KALT
+M6S&W"D+0U11JVR<C2"IO@DJ"FX8`J20\P0D%`Y5P.P6A]AH7O_KEKYCV!%\!
+M)X%/8D+P<9/0A"-F`016>`(3JM`$V^[)5JZ%0J3Z*ZGWQG>^&?:O%#I\W@.[
+MP+0XSK&.=QPS-)2!#6QX@P)X3.0B&_G(2$ZRDI?,Y"8[^<E0CK*4ITSE*EOY
+MREC.LI:WS.4N>_G+8`ZSF,=,YC*;^<QH3K.:U\SF-KOYS7".LYSG3.<ZV_G.
+M>,ZSGO?,YS[[^<^`#K2@!TWH0AOZT(A.M*(7S>A&._K1D(ZTI"=-Z4I;^M*8
+MSK2F-\WI3GOZTZ`.M:A'3>I2F_K4J$ZUJE?-ZE:[^M6PCK6L9TWK6MOZUKC.
+MM:YWS>M>^_K7P`ZVL(=-[&(;^]C(3K:RE\WL9CO[V=".MK2G3>UJ6_O:V,ZV
+MMK?-[6Y[^]O@#K>XQTWN<IO[W.A.M[K7S>YVN_O=\(ZWO.=-[WK;^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+M^9`0&9$2.9$469$6>9$8F9$:N9$<V9$>^9$@&9(B.9(D69(F>9(HF9(JN9(L
+MV9(N^9(P&9,R.9,T69,V>9,XF9,ZN9,\V9,^^9-`&91".91$691&>91(F91*
+MN91,V91.^910&952.9546956>958F95:N95<V95>^95@&99B.99D699F>99H
+MF99JN99LV99N^99P&9=R.9=T69=V>9=XF9=ZN9=\V9=^^9>`&9B".9B$69B&
+M>9B(F9B*N9B,V9B.^9B0&9F2.9F469F6>9F8F9F:N9F<V9F>^9F@&9JB.9JD
+M69JF>9JHF9JJN9JLV9JN^9JP&9NR.9NT69NV>9NXF9NZN9N\V9N^^9O`&9S"
+M.9S$69S&>9S(F9S*N9S,V9S.^9S0&9W2.9W469W6>9W8F9W:N9W<V9W>^9W@
+M&9[B.9[D69[F>9[HF9[JN9[LV9[N^9[P&9_R.9_T69_V>9_XF9_ZN9_\V9_^
+M^9\`&J`".J`$6J`&>J`(FJ`*NJ`,VJ`.^J`0&J$2.J$46J$6>J$8FJ$:NJ$<
+MVJ$>^J$@&J(B.J(D6J(F>J(HFJ(JNJ(LVJ(N^J(P&J,R.J,T6J,V>J,XFJ,Z
+MNJ,\VJ,^^J-`&J1".J1$6J1&>J1(FJ1*NJ1,VJ1.^J10&J52.J546J56>J58
+MFJ5:NJ5<VJ5>^J5@&J9B.J9D6J9F>J9HFJ9JNJ9LVJ9N^J9P&J=R.J=T6J=V
+M>J=XFJ=ZNJ=\VJ=^^J>`&JB".JB$6JB&>JB(FJB*NJB,VJB.^JB0&JF2.JF4
+M6JF6>JF8FJF:NJF<VJF>^JF@&JJB.JJD6JJF>JJHFJJJNJJLVJJN^JJP&JNR
+M.JNT6JNV>JNXFJNZNJN\VJN^^JO`&JS".JS$6JS&>JS(FJS*NJS,VJS.^JS0
+M&JW2.JW46JW6>JW8FJW:NJW<VJW>^JW@&J[B.J[D6J[F>J[HFJ[JNJ[LVJ[N
+M^J[P&J_R.J_T6J_V>J_XFJ_ZNJ_\VJ_^^J\`&[`".[`$6[`&>[`(F[`*N[`,
+MV[`.^[`0&[$2.[$46[$6>[$8F[$:N[$<V[$>^[$@&[(B.[(D6[(F>[(HF[(J
+MN[(LV[(N^[(P&[,R.[,T6[,V>[,XF[,ZN[,\V[,^^[-`&[1".[1$6[1&>[1(
+MF[1*N[1,V[1.^[10&[52.[546[56>[58F[5:N[5<V[5>^[5@&[9B.[9D6[9F
+M>[9HF[9JN[9LV[9N^[9P&[=R.[=T6[=V>[=XF[=ZN[=\V[=^^[>`&[B".[B$
+M6[B&>[B(F[B*N[B,V[B.^[B0&[F2.[F46[F6>[F8F[F:N[F<V[F>^[F@&[JB
+M.[JD6[JF>[JHF[JJN[JLV[JN^[JP&[NR.[NT6[NV>[NXF[NZN[N\V[N^^[O`
+M&[S".[S$6[S&>[S(F[S*N[S,V[S.^[S0&[W2.[W46[W6>[W8F[W:N[W<V[W>
+M^[W@&[[B.[[D6[[F>[[HF[[JN[[LV[[N^[[P&[_R.[_T6[_V>[_XF[_ZN[_\
+MV[_^^[\`',`"/,`$7,`&?,`(G,`*O,`,W,`._,`0',$2/,$47,$6?,$8G,$:
+MO,$<W,$>_,$@',(B/,(D7,(F?,(HG,(JO,(LW,(N_,(P',,R/,,T7,,V?,,X
+MG,,ZO,,\W,,^_,-`',1"/,1$7,1&?,1(G,1*O,1,W,1._,10',52/,547,56
+M?,58G,5:O,5<W,5>_,5@',9B/,9D7,9F?,9HG,9JO,9LW,9N_,9P',=R/,=T
+M7,=V?,=XG,=ZO,=\W,=^_,>`',B"/,B$7,B&?,B(G,B*O,B,W,B._,B0',F2
+M/,F47,F6?,F8G,F:O,F<W,F>_,F@',JB/,JD7,JF?,JHG,JJO,JLW,JN_,JP
+M',NR/,NT7,NV?,NXG,NZO,N\W,N^_,O`',S"/,S$7,S&?,S(G,S*O,S,W,S.
+M_,S0',W2/,W47,W6?,W8G,W:O,W<W,W>_,W@',[B/,[D7,[F?,[HG,[JO,[L
+MW,[N_,[P',_R/,_T7,_V?,_XG,_ZO,_\W,_^_,\`'=`"/=`$7=`&?=`(G=`*
+MO=`,W=`._=`0'=$2/=$47=$6?=$8G=$:O=$<W=$>_=$@'=(B/=(D7=(F?=(H
+MG=(JO=(LW=(N_=(P'=,R/=,T7=,V?=,XG=,ZO=,\W=,^_=-`'=1"/=1$7=1&
+M?=1(G=1*O=1,W=1._=10'=52/=547=56?=58G=5:O=5<W=5>_=5@'=9B/=9D
+M7=9F?=9HG=9JO=9LW=9N_=9P'==R/==T7==V?==XG==ZO==\W==^_=>`'=B"
+M/=B$7=B&?=B(G=B*O=B,W=B._=B0'=F2/=F47=F6?=F8G=F:O=F<W=F>_=F@
+M'=JB/=JD7=JF?=JHG=JJO=JLW=JN_=JP'=NR/=NT7=NV?=NXG=NZO=N\W=N^
+M_=O`'=S"/=S$7=S&?=S(G=S*O=S,W=S._=S0'=W2/=W47=W6?=W8G=W:O=W<
+MW=W>_=W@'=[B/=[D7=[F?=[HG=[JO=[LW=[N_=[P'=_R/=_T7=_V?=_XG=_Z
+MO=_\W=_^_=\`'N`"/N`$7N`&?N`(GN`*ON`,WN`._N`0'N$2/N$47N$6?N$8
+MGN$:ON$<WN$>_N$@'N(B/N(D7N(F?N(HGN(JON(LWN(N_N(P'N,R/N,T7N,V
+M?N,XGN,ZON,\WN,^_N-`'N1"/N1$7N1&?N1(GN1*ON1,WN1._N10'N52/N54
+M7N56?N58GN5:ON5<WN5>_N5@'N9B/N9D7N9F?N9HGN9JON9LWN9N_N9P'N=R
+M/N=T7N=V?N=XGN=ZON=\WN=^_N>`'NB"/NB$7NB&?NB(GNB*ONB,WNB._NB0
+M'NF2/NF47NF6?NF8GNF:ONF<WNF>_NF@'NJB/NJD7NJF?NJHGNJJONJLWNJN
+M_NJP'NNR/NNT7NNV?NNXGNNZONN\WNN^_NO`'NS"/NS$7NS&?NS(GNS*ONS,
+MWNS._NS0'NW2/NW47NW6?NW8GNW:ONW<WNW>_NW@'N[B/N[D7N[F?N[HGN[J
+MON[LWN[N_N[P'N_R/N_T7N_V?N_XGN_ZON_\WN_^_N\`'_`"/_`$7_`&?_`(
+MG_`*O_`,W_`.__`0'_$2/_$47_$6?_$8G_$:O_$<W_$>__$@'_(B/_(D7_(F
+M?_(HG_(JO_(LW_(N__(P'_,R/_,T7_,V?_,XG_,ZO_,\W_,^__-`'_1"/_1$
+M7_1&?_1(G_1*O_1,W_1.__10'_52/_547_56?_58G_5:O_5<W_5>__5@'_9B
+M/_9D7_9F?_9HG_9JO_9LW_9N__9P'_=R/_=T7_=V?_=XG_=ZO_=\W_=^__>`
+M'_B"/_B$7_B&?_B(G_B*O_B,W_B.__B0'_F2/_F47_F6?_F8G_F:O_F<W_F>
+M__F@'_JB/_JD7_JF?_JHG_JJO_JLW_JN__JP'_NR/_NT7_NV?_NXG_NZO_N\
+MW_N^__O`'_S"/_S$7_S&?_S(G_S*O_S,W_S.__S0'_W2/_W47_W6?_W8G_W:
+MO_W<W_W>__W@'_[B/_[D7_[F?_[HG_[JO_[LW_[N__[P'__R/__T7__V?__X
+MG__ZO__\W__^__\`,``*P`%(``N@`3R`"#`!*L`%R``;H`-\@!`P`DK`"4@!
+M*Z`%O(`8,`-JP`W(`3N@!_R`(#`$BL`12`)+H`D\@2@P!:K`%<@"6Z`+?($P
+M,`;*P!E(`VN@#;R!.#`'ZL`=R`-[H`_\@4`P"`K!(4@$BZ`1/()(,`DJP27(
+M!)N@$WR"4#`*2L$I2`6KH!6\@E@P"VK!+<@%NZ`7_()@,`R*P3%(!LN@&3R#
+M:#`-JL$UR`;;H!M\@W`P#LK!.4@'ZZ`=O(-X,`_JP3W(!_N@'_R#@#`0"L)!
+M2`@+H2$\A(@P$2K"1<@(&Z$C?(20,!)*PDE("2NA);R$F#`3:L)-R`D[H2?\
+MA*`P%(K"44@*2Z$I/(6H,!6JPE7("ENA*WR%L#`6RL)92`MKH2V\A;@P%^K"
+M7<@+>Z$O_(7`,!@*PV%(#(NA,3R&R#`9*L-ER`R;H3-\AM`P&DK#:4@-JZ$U
+MO(;8,!MJPVW(#;NA-_R&X#`<BL-Q2`[+H3D\A^@P':K#=<@.VZ$[?(?P,![*
+MPWE(#^NA/;R'^#`?ZL-]R`_[H3_\AP`Q(`K$@4@0"Z)!/(@(,2$JQ(7($!NB
+M0WR($#$B2L2)2!$KHD6\B!@Q(VK$C<@1.Z)'_(@@,22*Q)%($DNB23R)*#$E
+MJL25R!);HDM\B3`Q)LK$F4@3:Z)-O(DX,2?JQ)W($WNB3_R)0#$H"L6A2!2+
+MHE$\BD@Q*2K%I<@4FZ)3?(I0,2I*Q:E(%:NB5;R*6#$K:L6MR!6[HE?\BF`Q
+M+(K%L4@6RZ)9/(MH,2VJQ;7(%MNB6WR+<#$NRL6Y2!?KHEV\BW@Q+^K%O<@7
+M^Z)?_(N`,3`*QL%(&`NC83R,B#$Q*L;%R!@;HV-\C)`Q,DK&R4@9*Z-EO(R8
+M,3-JQLW(&3NC9_R,H#$TBL;12!I+HVD\C:@Q-:K&U<@:6Z-K?(VP,3;*QME(
+M&VNC;;R-N#$WZL;=R!M[HV_\C<`Q.`K'X4@<BZ-Q/([(,3DJQ^7(')NC<WR.
+MT#$Z2L?I2!VKHW6\CM@Q.VK'[<@=NZ-W_([@,3R*Q_%('LNC>3R/Z#$]JL?U
+MR![;HWM\C_`Q/LK'^4@?ZZ-]O(_X,3_JQ_W('_NC?_R/`#)`"L@!22`+I($\
+MD`@R02K(!<D@&Z2#?)`0,D)*R`E)(2NDA;R0&#)#:L@-R2$[I(?\D"`R1(K(
+M$4DB2Z2)/)$H,D6JR!7)(ENDBWR1,#)&RL@922-KI(V\D3@R1^K('<DC>Z2/
+M_)%`,D@*R2%))(NDD3R22#))*LDER22;I)-\DE`R2DK)*4DEJZ25O))8,DMJ
+MR2W));NDE_R28#),BLDQ22;+I)D\DV@R3:K)-<DFVZ2;?)-P,D[*R3E))^ND
+MG;R3>#)/ZLD]R2?[I)_\DX`R4`K*04DH"Z6A/)2(,E$JRD7)*!NEHWR4D#)2
+M2LI)22DKI:6\E)@R4VK*3<DI.Z6G_)2@,E2*RE%)*DNEJ3R5J#)5JLI5R2I;
+MI:M\E;`R5LK*64DK:Z6MO)6X,E?JREW)*WNEK_R5P#)8"LMA22R+I;$\EL@R
+M62K+9<DLFZ6S?);0,EI*RVE)+:NEM;R6V#);:LMMR2V[I;?\EN`R7(K+<4DN
+MRZ6Y/)?H,EVJRW7)+MNENWR7\#)>RLMY22_KI;V\E_@R7^K+?<DO^Z6__)<`
+M,V`*S(%),`NFP3R8"#-A*LR%R3`;IL-\F!`S8DK,B4DQ*Z;%O)@8,V-JS(W)
+M,3NFQ_R8(#-DBLR123)+ILD\F2@S9:K,E<DR6Z;+?)DP,V;*S)E),VNFS;R9
+M.#-GZLR=R3-[IL_\F4`S:`K-H4DTBZ;1/)I(,VDJS:7)-)NFTWR:4#-J2LVI
+M236KIM6\FE@S:VK-K<DUNZ;7_)I@,VR*S;%)-LNFV3R;:#-MJLVUR3;;IMM\
+MFW`S;LK-N4DWZZ;=O)MX,V_JS;W)-_NFW_R;@#-P"L[!23@+I^$\G(@S<2K.
+MQ<DX&Z?C?)R0,W)*SLE).2NGY;R<F#-S:L[-R3D[I^?\G*`S=(K.T4DZ2Z?I
+M/)VH,W6JSM7).ENGZWR=L#-VRL[923MKI^V\G;@S=^K.W<D[>Z?O_)W`,W@*
+MS^%)/(NG\3R>R#-Y*L_ER3R;I_-\GM`S>DK/Z4D]JZ?UO)[8,WMJS^W)/;NG
+M]_R>X#-\BL_Q23[+I_D\G^@S?:K/]<D^VZ?[?)_P,W[*S_E)/^NG_;R?^#-_
+MZL_]R3_[I__\GP`T@`K0`4I`"Z@!/:`(-($JT`7*0!NH`WV@$#2"2M`)2D$K
+MJ`6]H!@T@VK0#<I!.Z@'_:`@-(2*T!%*0DNH"3VA*#2%JM`5RD);J`M]H3`T
+MALK0&4I#:Z@-O:$X-(?JT!W*0WNH#_VA0#2("M$A2D2+J!$]HD@TB2K1)<I$
+MFZ@3?:)0-(I*T2E*1:NH%;VB6#2+:M$MRD6[J!?]HF`TC(K1,4I&RZ@9/:-H
+M-(VJT37*1MNH&WVC<#2.RM$Y2D?KJ!V]HW@TC^K1/<I'^Z@?_:.`-)`*TD%*
+M2`NI(3VDB#21*M)%RD@;J2-]I)`TDDK224I)*ZDEO:28-)-JTDW*23NI)_VD
+MH#24BM)12DI+J2D]I:@TE:K25<I*6ZDK?:6P-);*TEE*2VNI+;VEN#27ZM)=
+MRDM[J2_]I<`TF`K384I,BZDQ/:;(-)DJTV7*3)NI,WVFT#2:2M-I2DVKJ36]
+MIM@TFVK3;<I-NZDW_:;@-)R*TW%*3LNI.3VGZ#2=JM-URD[;J3M]I_`TGLK3
+M>4I/ZZD]O:?X-)_JTWW*3_NI/_VG`#6@"M2!2E`+JD$]J`@UH2K4A<I0&ZI#
+M?:@0-:)*U(E*42NJ1;VH&#6C:M2-RE$[JD?]J"`UI(K4D4I22ZI)/:DH-:6J
+MU)7*4ENJ2WVI,#6FRM292E-KJDV]J3@UI^K4G<I3>ZI/_:E`-:@*U:%*5(NJ
+M43VJ2#6I*M6ERE2;JE-]JE`UJDK5J4I5JZI5O:I8-:MJU:W*5;NJ5_VJ8#6L
+MBM6Q2E;+JED]JV@UK:K5M<I6VZI;?:MP-:[*U;E*5^NJ7;VK>#6OZM6]RE?[
+MJE_]JX`UL`K6P4I8"ZMA/:R(-;$JUL7*6!NK8WVLD#6R2M;)2EDKJV6]K)@U
+MLVK6S<I9.ZMG_:R@-;2*UM%*6DNK:3VMJ#6UJM;5REI;JVM]K;`UMLK6V4I;
+M:ZMMO:VX-;?JUMW*6WNK;_VMP#6X"M?A2ER+JW$]KL@UN2K7Y<I<FZMS?:[0
+M-;I*U^E*7:NK=;VNV#6[:M?MREV[JW?]KN`UO(K7\4I>RZMY/:_H-;VJU_7*
+M7MNK>WVO\#6^RM?Y2E_KJWV]K_@UO^K7_<I?^ZM__:\`-L`*V`%+8`NL@3VP
+M"#;!*M@%RV`;K(-]L!`VPDK8"4MA*ZR%O;`8-L-JV`W+83NLA_VP(#;$BM@1
+M2V)+K(D]L2@VQ:K8%<MB6ZR+?;$P-L;*V!E+8VNLC;VQ.#;'ZM@=RV-[K(_]
+ML4`VR`K9(4MDBZR1/;)(-LDJV27+9)NLDWVR4#;*2MDI2V6KK)6]LE@VRVK9
+M+<MENZR7_;)@-LR*V3%+9LNLF3VS:#;-JMDURV;;K)M]LW`VSLK9.4MGZZR=
+MO;-X-L_JV3W+9_NLG_VS@#;0"MI!2V@+K:$]M(@VT2K:1<MH&ZVC?;20-M)*
+MVDE+:2NMI;VTF#;3:MI-RVD[K:?]M*`VU(K:44MJ2ZVI/;6H-M6JVE7+:ENM
+MJWVUL#;6RMI92VMKK:V]M;@VU^K:7<MK>ZVO_;7`-M@*VV%+;(NML3VVR#;9
+M*MMERVR;K;-]MM`VVDK;:4MMJZVUO;;8-MMJVVW+;;NMM_VVX#;<BMMQ2V[+
+MK;D]M^@VW:K;=<MNVZV[?;?P-M[*VWE+;^NMO;VW^#;?ZMM]RV_[K;_]MP`W
+MX`K<@4MP"Z[!/;@(-^$JW(7+<!NNPWVX$#?B2MR)2W$KKL6]N!@WXVK<C<MQ
+M.Z['_;@@-^2*W)%+<DNNR3VY*#?EJMR5RW);KLM]N3`WYLK<F4MS:Z[-O;DX
+M-^?JW)W+<WNNS_VY0#?H"MVA2W2+KM$]ND@WZ2K=I<MTFZ[3?;I0-^I*W:E+
+M=:NNU;VZ6#?K:MVMRW6[KM?]NF`W[(K=L4MVRZ[9/;MH-^VJW;7+=MNNVWV[
+M<#?NRMVY2W?KKMV]NW@W[^K=O<MW^Z[?_;N`-_`*WL%+>`NOX3V\B#?Q*M[%
+MRW@;K^-]O)`W\DK>R4MY*Z_EO;R8-_-JWLW+>3NOY_V\H#?TBM[12WI+K^D]
+MO:@W]:K>U<MZ6Z_K?;VP-_;*WME+>VNO[;V]N#?WZM[=RWM[K^_]O<`W^`K?
+MX4M\BZ_Q/;[(-_DJW^7+?)NO\WV^T#?Z2M_I2WVKK_6]OM@W^VK?[<M]NZ_W
+M_;[@-_R*W_%+?LNO^3V_Z#?]JM_URW[;K_M]O_`W_LK?^4M_ZZ_]O;_X-__J
+MW_W+?_NO__V_`#@`"^`!3(`+L`$^P`@X`2O@!<R`&[`#?L`0.`)+X`E,@2NP
+M!;[`&#@#:^`-S($[L`?^P"`X!(O@$4R"2[`)/L$H.`6KX!7,@ENP"W[!,#@&
+MR^`93(-KL`V^P3@X!^O@'<R#>[`/_L%`.`@+X2%,A(NP$3["2#@)*^$ES(2;
+ML!-^PE`X"DOA*4R%J[`5OL)8.`MKX2W,A;NP%_["8#@,B^$Q3(;+L!D^PV@X
+M#:OA-<R&V[`;?L-P.`[+X3E,A^NP';[#>#@/Z^$]S(?[L!_^PX`X$`OB04R(
+M"[$A/L2(.!$KXD7,B!NQ(W[$D#@22^))3(DKL26^Q)@X$VOB3<R).[$G_L2@
+M.!2+XE%,BDNQ*3[%J#@5J^)5S(I;L2M^Q;`X%LOB64R+:[$MOL6X.!?KXO`+
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
new file mode 100644
index 00000000000..00848957056
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
@@ -0,0 +1,63 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_rockridge_ce.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GC0+06!Z-&!``1`XH$((`"`!059,$%"%0PD`@`7%%2C
+MB@*I:$0``B10(@D"!'3B@1T6:>212":IY)),-NGDDU!&*>645%9I991-+)'$
+M%$\8,04(6SX!0@XVV`##"TAX"8(123!1Q!193$%%$1H*446;1!0A!0@F@'!A
+M$4,\(<6#`K8@Q0M$6$&H%$4$086@(*`P1`H@Q)!##C.`4(0+63Q1A1-'$!&$
+MFY%.6NFE-X"@A`M0-"H%ETZ\L.H40R#1)A-)@'KEKKSN*@.!.<10H`PQR%##
+MKV;"0,*O,`0[;+''PI`L"016:^VU!`+`K+/%0HLL@200V>NXY)9K[KGHIJON
+MNNRVZ^Z2_\6[V#\"$FB@O/CFJ^^^_/9;799)@-#$&VZ`\,08=%0J@\(Z'*N#
+MM"!LJX`,+A18<0QAV)"IH2"T4$<:9%3:\1D@1PR""RB_D,8<;_CK\LLPQRSS
+MS&G=0L^!-0HIT```9"#0@40D(07-1!=M]-%()ZWTTDPW[?334+]&8D`UDLBS
+M0#X'$/3047?M]==@ARWVV&27;?;9:"<-"8TV`H!C0#KRZ&,`0.I<XH%30'%`
+M`+Z\`X`44A000"!08,%"`.T$,5`0[5P]T`!3_QPD00+D/-`%5!BA00`.[-CC
+MCVTHP``#-!A`0NBCET["$$5P$(`&!<%N4#L%M>,&VP3=.%#<G],]^9`!`"XX
+MX88CKKA`C#N^<^1"3CY0Y39FOGGG<H,N.NFFHXX]"0"0`\`&!6V@SP,#/:"/
+MYW-S;W<`"P3AOOO5NK!##,('D(@335QB8AC\]^___P`,H``'2,`"&O"`"$R@
+M`@G(.M=AH"`/-`C7!B(%[W6@(!T87_G.5SVZ_4Q([7M?$.PE/_H%SG[XTU\`
+M%LC"%KKPA3",(0`;&(`(#@0#$Q2(%*)0D"AX[P,%^8`&!6(^]/WH@R4*H0C=
+M5\+ZW2]_^Y.A%*=(Q2HFD(8V%`@&2%$04D"A(%#`0\\*XK.WN0U!':Q;B80T
+M@*TY$7\(.!`9TB"'PATN<8MKA_,$(@#FE6B/`1&`SPB2`>EQSHAT0^3IKJ<Z
+M`(`#`/#XAR0G"8^#*!*)`3@`G)H0@R:>L!'X2\"!YI"'-L3`CH@+Q4!"T0X_
+MFJ@@/"J(`"(Y24G"8PI,$(.)`K`%*_KREV'`(@3I41!Z=*$@77CD.VHI2;\9
+MY)+KTV06FD"Q^=4/E$T0)0!(V089H+(=JA0(*UWI2D`"0`#+9.8[<*E+$_42
+MF/"4HC`)@L/(!<\+!?'"(]W!S'^XPY)IQ*0TFS`#3PH.F]KDY@R^&<Z`C!.6
+MY90E/YGI#G;N\IWQS*@+YWE#6-@3%E\H2$C3%A'\,>!``40E*0(QD$"0@IRP
+M-*<`P$>0#1B2>KTC@2*UISK\+0"E_U,I2P7B4I@2)):4NR!!.G!31>Z4D:8#
+M`/X4`-3^";6E+X5H3&4)1()\H*EI?&KJ3(?+(9"(!QJ5(5@'X",!+'*L;]T>
+M`'!)!!+U(*UJU=PA`\#6<\95=3PEJYM(Y`.\YG5Z.^JK6P/[UZB2]+&0C:QD
+M$W*[00ZDC+M#8TY_)Z0#U8]X=SQ>0!@GTXA2SK)8`VM.&<M8`-S.<@+178XT
+MFS[.WBUX)P2M\?*HO(!`;JN4@RW55)L^UD)5?9--KG*7RURQZ:F5"J#"(7";
+M!"A\P5+!<A02B@`"#`UA"=U-`A&.P-U<S4D*M0H"J+@+!0P]*E!,`$%[GV`%
+M\;X)!%.H`A2@("@JK`E2_)U"$K"PIC9Q%TYRHA-^Z:1>*B1A"'ES4Q"FP-U`
+M.8$*01B"?X-&*_E600BXFL)V]V0$2.4-4$E@TQ`<E80G.`&_GD+OIB!$8?9^
+M.,0C!E.>+ISB).@)3"]N;Q*:$`0I9`$$5G@"$ZK0!.[FB592J.ZC2`PI"V-8
+MPT`NL12([&`7NZ"Y8`ZSF,>L'S24@0UL>$.E:C`#!9#YS7".LYSG3.<ZV_G.
+M>,[S>\R,9C7'X%ANUK.@!TWH0AOZT(A.M*(7S6BO\#G-:XY!H!M-Z4I;^M*8
+MSK2F-\WI3GOZTZ`.M:A'3>I2F_K4J$ZUJE?-ZE:[^M6PCK6L9TWK6MOZUKC.
+MM:YWS>M>^_K7P`ZVL(=-[&(;^]C(3K:RE\WL9CO[V=".MK2G3>UJ6_O:V,ZV
+MMK?-[6Y[^]O@#K>XQTWN<IO[W.A.M[K7S>YVN_O=\(ZWO.=-[WK;^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+(>(F8F(F:^!,`
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
new file mode 100644
index 00000000000..3ef253b5b1c
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
@@ -0,0 +1,208 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_rockridge_new.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GA0#Q@,A$$/'QT(0``F'H@``@!84)`%$R14P4`B`'!!
+M03>R*!"+1@0@0`(GDB!`0"D>V.&12":IY)),-NGDDU!&*>645%9IY9583MG$
+M$DE,\8014X#0Y1,@Y&"##3"\@`28(!B1!!-%3)'%%%04H:$05;Q)1!%2@&`"
+M"!<6,<034CPH8`M2O$"$%89*44005!`*`@I#I`!"##GD,`,(1;B0Q1-5.'$$
+M$4'`.6FEEV9Z`PA*N`#%HU)XZ<0+K4XQ!!)O,I&$J%GVZFNO,A"8`PPYR'"#
+M##/$,,.R!)(0++'$&HNLLLS"0`*!V&:K+8$`/#MLL<<FN^P,S1KYZ[GHIJON
+MNNRVZ^Z[\,8K;Y/_U;O8/P(2:*"]_/;K[[\`!US=EDF`,$4=;AA<!AP@&-OP
+M##HHJ\.R#0NK@`PN%)AQ#&'8L"FB(+101QID7!KR&20W#((+++^0QAQO""SS
+MS#37;//-:=URQ8$W$BG0``"$Z#,124B!\]%()ZWTTDPW[?334$<M]=2OF1C0
+MC28"+5"(`1!M--5@ARWVV&27;?;9:*>M]MI,0V(CC@#H&!"//@(9@)`^GWC@
+M%%`<$(`O[P`@A10%!!`(%%BP$$`[00P41#M:#S2`U0+Y6)``/0]T`15&:!"`
+M`SW^&&0;"6QP00,AD$"ZZ:B3,$01'`2004&S&]1.0>VX\39!.0Y$M^AW#WDB
+MD2@.7OCAB2_>N$"/1_XSY40*/Q#F.'+N.>AUCU[ZZ:FOSCT)`.`1=$$ARATW
+M@MD'GW<``WAM?`").-$$`@>2D88<B"O.N./M2"^0`-`[D?\"(@"AB<AZGPN=
+MW4B@0.VQ+G4`X`,`-%`0#5`A#+P(""_"P+GT@6]]!W`3G%RP@QB\+WY-2,"!
+MS)`&-I0A?P$@12`&$@A2#!```"R(Y0@B``H2Q(*=2Z`'&W@W[[6.$!.LX`4S
+M"(`-=A!X'QS>B1:`A"`42E=.6`()34@X^,FO`0="0QCD0`8VI,$-:X"A#&EH
+MP\L%<(?3\^%`@'@](C+0@T9,G2,``(]_^/&/\#B('2M')`7(J0E8U&()!=?%
+M1LB/`0>:0Q[:8$8TPK`=H1A(*-KQQC?>4`!]_*,?X3$%)BS`1`1@H0L1B+T!
+M`$D`=W0E#E6WO=9)`@#O$*4?`V<0(X(@BBE:P"$3B;$2OL^130`C`"1)R3.N
+M00:7S*1`-ME)'7XRE[I\1RD=H**`#(`.;8!#0%B91UH^T)S?HP0`W*'+?[CC
+M(*3#@`,*<`)@$DF864#DKI8P@RT>\XN1G&0EUS"#:&J2DSKTY.78J4MWE!("
+MW03`-\-)`(&0LY;=PR@Z6V<)`+2CG;?K92U_2<@I#G.?-/!G(P&Z3($ZDP8&
+MG29""8(B:U[NH[IL1RDE<*"*#JFB$@6G.`%PT7.6LYP=94<[V2%(#Y8T`/C4
+M9Q9KH-+"(5.9S!QH#6(:$&HFU*8\5*HNV5'*"!SHAJEL81E8V2-9PK*MK]PH
+M!#NZCG:N`YX)D"<][6G2?";2!E4-P%4#VDPTVH"K`/`J317*P[KJ<AT[C>A$
+MAPI4H@;1`4?5:#G9AA[=&7!KY]L1^J`HO"(Q\GB77%Y`'O=)QD[OLP'!`%OQ
+MJ%F-`D!WF1-([T1KQ](2+P#O0Y[^5`N`YA5D<F"=7FZO-ELH9O:<G(VN=*=+
+MW>HVA$^<5``5#@%<*20!"E_`5`YB`"DD%`$$&!K"$M";!"(<X;R[JI,4;A4$
+M49T7"AB*U*"8``+\/L$*[8V3P:H`!2@0B@IMDI2!IY`$++3I3>>5$YWL9#`[
+MU9<*21@"W^`4A"F<=U!.H$(0AH!@HMFJOU40@JZF8-X^&4%2?!-4$MPT!$@E
+MX0E.,!BHYMLI"'GXOBE><8O%M*<0SS@)?!)3CO&;A"98,0L@L,(3F%"%)IQW
+M3[;R+A0BY6))@5C$)%;RBZ7@9`SCV`763;.:U\SFFZ&A#&Q@PQL4T.8ZV_G.
+M>,ZSGO?,YS[[^<^`#K2@!TWH0AOZT(A.M*(7S>A&._K1D(ZTI"=-Z4I;^M*8
+MSK2F-\WI3GOZTZ`.M:A'3>I2F_K4J$ZUJE?-ZE:[^M6PCK6L9TWK6MOZUKC.
+MM:YWS>M>^_K7P`ZVL(=-[&(;^]C(3K:RE\WL9CO[V=".MK2G3>UJ6_O:V,ZV
+MMK?-[6Y[^]O@#K>XQTWN<IO[W.A.M[K7S>YVN_O=\(ZWO.=-[WK;^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+M>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN(JLV(JN^(JP&(NR.(NT
+M6(NV>(NXF(NZN(N\V(N^^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+M^9`0&9$2.9$469$6>9$8F9$:N9$<V9$>^9$@&9(B.9(D69(F>9(HF9(JN9(L
+MV9(N^9(P&9,R.9,T69,V>9,XF9,ZN9,\V9,^^9-`&91".91$691&>91(F91*
+MN91,V91.^910&952.9546956>958F95:N95<V95>^95@&99B.99D699F>99H
+MF99JN99LV99N^99P&9=R.9=T69=V>9=XF9=ZN9=\V9=^^9>`&9B".9B$69B&
+M>9B(F9B*N9B,V9B.^9B0&9F2.9F469F6>9F8F9F:N9F<V9F>^9F@&9JB.9JD
+M69JF>9JHF9JJN9JLV9JN^9JP&9NR.9NT69NV>9NXF9NZN9N\V9N^^9O`&9S"
+M.9S$69S&>9S(F9S*N9S,V9S.^9S0&9W2.9W469W6>9W8F9W:N9W<V9W>^9W@
+M&9[B.9[D69[F>9[HF9[JN9[LV9[N^9[P&9_R.9_T69_V>9_XF9_ZN9_\V9_^
+M^9\`&J`".J`$6J`&>J`(FJ`*NJ`,VJ`.^J`0&J$2.J$46J$6>J$8FJ$:NJ$<
+MVJ$>^J$@&J(B.J(D6J(F>J(HFJ(JNJ(LVJ(N^J(P&J,R.J,T6J,V>J,XFJ,Z
+MNJ,\VJ,^^J-`&J1".J1$6J1&>J1(FJ1*NJ1,VJ1.^J10&J52.J546J56>J58
+MFJ5:NJ5<VJ5>^J5@&J9B.J9D6J9F>J9HFJ9JNJ9LVJ9N^J9P&J=R.J=T6J=V
+M>J=XFJ=ZNJ=\VJ=^^J>`&JB".JB$6JB&>JB(FJB*NJB,VJB.^JB0&JF2.JF4
+M6JF6>JF8FJF:NJF<VJF>^JF@&JJB.JJD6JJF>JJHFJJJNJJLVJJN^JJP&JNR
+M.JNT6JNV>JNXFJNZNJN\VJN^^JO`&JS".JS$6JS&>JS(FJS*NJS,VJS.^JS0
+M&JW2.JW46JW6>JW8FJW:NJW<VJW>^JW@&J[B.J[D6J[F>J[HFJ[JNJ[LVJ[N
+M^J[P&J_R.J_T6J_V>J_XFJ_ZNJ_\VJ_^^J\`&[`".[`$6[`&>[`(F[`*N[`,
+MV[`.^[`0&[$2.[$46[$6>[$8F[$:N[$<V[$>^[$@&[(B.[(D6[(F>[(HF[(J
+MN[(LV[(N^[(P&[,R.[,T6[,V>[,XF[,ZN[,\V[,^^[-`&[1".[1$6[1&>[1(
+MF[1*N[1,V[1.^[10&[52.[546[56>[58F[5:N[5<V[5>^[5@&[9B.[9D6[9F
+M>[9HF[9JN[9LV[9N^[9P&[=R.[=T6[=V>[=XF[=ZN[=\V[=^^[>`&[B".[B$
+M6[B&>[B(F[B*N[B,V[B.^[B0&[F2.[F46[F6>[F8F[F:N[F<V[F>^[F@&[JB
+M.[JD6[JF>[JHF[JJN[JLV[JN^[JP&[NR.[NT6[NV>[NXF[NZN[N\V[N^^[O`
+M&[S".[S$6[S&>[S(F[S*N[S,V[S.^[S0&[W2.[W46[W6>[W8F[W:N[W<V[W>
+M^[W@&[[B.[[D6[[F>[[HF[[JN[[LV[[N^[[P&[_R.[_T6[_V>[_XF[_ZN[_\
+MV[_^^[\`',`"/,`$7,`&?,`(G,`*O,`,W,`._,`0',$2/,$47,$6?,$8G,$:
+MO,$<W,$>_,$@',(B/,(D7,(F?,(HG,(JO,(LW,(N_,(P',,R/,,T7,,V?,,X
+MG,,ZO,,\W,,^_,-`',1"/,1$7,1&?,1(G,1*O,1,W,1._,10',52/,547,56
+M?,58G,5:O,5<W,5>_,5@',9B/,9D7,9F?,9HG,9JO,9LW,9N_,9P',=R/,=T
+M7,=V?,=XG,=ZO,=\W,=^_,>`',B"/,B$7,B&?,B(G,B*O,B,W,B._,B0',F2
+M/,F47,F6?,F8G,F:O,F<W,F>_,F@',JB/,JD7,JF?,JHG,JJO,JLW,JN_,JP
+M',NR/,NT7,NV?,NXG,NZO,N\W,N^_,O`',S"/,S$7,S&?,S(G,S*O,S,W,S.
+M_,S0',W2/,W47,W6?,W8G,W:O,W<W,W>_,W@',[B/,[D7,[F?,[HG,[JO,[L
+MW,[N_,[P',_R/,_T7,_V?,_XG,_ZO,_\W,_^_,\`'=`"/=`$7=`&?=`(G=`*
+MO=`,W=`._=`0'=$2/=$47=$6?=$8G=$:O=$<W=$>_=$@'=(B/=(D7=(F?=(H
+MG=(JO=(LW=(N_=(P'=,R/=,T7=,V?=,XG=,ZO=,\W=,^_=-`'=1"/=1$7=1&
+M?=1(G=1*O=1,W=1._=10'=52/=547=56?=58G=5:O=5<W=5>_=5@'=9B/=9D
+M7=9F?=9HG=9JO=9LW=9N_=9P'==R/==T7==V?==XG==ZO==\W==^_=>`'=B"
+M/=B$7=B&?=B(G=B*O=B,W=B._=B0'=F2/=F47=F6?=F8G=F:O=F<W=F>_=F@
+M'=JB/=JD7=JF?=JHG=JJO=JLW=JN_=JP'=NR/=NT7=NV?=NXG=NZO=N\W=N^
+M_=O`'=S"/=S$7=S&?=S(G=S*O=S,W=S._=S0'=W2/=W47=W6?=W8G=W:O=W<
+MW=W>_=W@'=[B/=[D7=[F?=[HG=[JO=[LW=[N_=[P'=_R/=_T7=_V?=_XG=_Z
+MO=_\W=_^_=\`'N`"/N`$7N`&?N`(GN`*ON`,WN`._N`0'N$2/N$47N$6?N$8
+MGN$:ON$<WN$>_N$@'N(B/N(D7N(F?N(HGN(JON(LWN(N_N(P'N,R/N,T7N,V
+M?N,XGN,ZON,\WN,^_N-`'N1"/N1$7N1&?N1(GN1*ON1,WN1._N10'N52/N54
+M7N56?N58GN5:ON5<WN5>_N5@'N9B/N9D7N9F?N9HGN9JON9LWN9N_N9P'N=R
+M/N=T7N=V?N=XGN=ZON=\WN=^_N>`'NB"/NB$7NB&?NB(GNB*ONB,WNB._NB0
+M'NF2/NF47NF6?NF8GNF:ONF<WNF>_NF@'NJB/NJD7NJF?NJHGNJJONJLWNJN
+M_NJP'NNR/NNT7NNV?NNXGNNZONN\WNN^_NO`'NS"/NS$7NS&?NS(GNS*ONS,
+MWNS._NS0'NW2/NW47NW6?NW8GNW:ONW<WNW>_NW@'N[B/N[D7N[F?N[HGN[J
+MON[LWN[N_N[P'N_R/N_T7N_V?N_XGN_ZON_\WN_^_N\`'_`"/_`$7_`&?_`(
+MG_`*O_`,W_`.__`0'_$2/_$47_$6?_$8G_$:O_$<W_$>__$@'_(B/_(D7_(F
+M?_(HG_(JO_(LW_(N__(P'_,R/_,T7_,V?_,XG_,ZO_,\W_,^__-`'_1"/_1$
+M7_1&?_1(G_1*O_1,W_1.__10'_52/_547_56?_58G_5:O_5<W_5>__5@'_9B
+M/_9D7_9F?_9HG_9JO_9LW_9N__9P'_=R/_=T7_=V?_=XG_=ZO_=\W_=^__>`
+M'_B"/_B$7_B&?_B(G_B*O_B,W_B.__B0'_F2/_F47_F6?_F8G_F:O_F<W_F>
+M__F@'_JB/_JD7_JF?_JHG_JJO_JLW_JN__JP'_NR/_NT7_NV?_NXG_NZO_N\
+MW_N^__O`'_S"/_S$7_S&?_S(G_S*O_S,W_S.__S0'_W2/_W47_W6?_W8G_W:
+MO_W<W_W>__W@'_[B/_[D7_[F?_[HG_[JO_[LW_[N__[P'__R/__T7__V?__X
+MG__ZO__\W__^__\`,``*P`%(``N@`3R`"#`!*L`%R``;H`-\@!`P`DK`"4@!
+M*Z`%O(`8,`-JP`W(`3N@!_R`(#`$BL`12`)+H`D\@2@P!:K`%<@"6Z`+?($P
+M,`;*P!E(`VN@#;R!.#`'ZL`=R`-[H`_\@4`P"`K!(4@$BZ`1/()(,`DJP27(
+M!)N@$WR"4#`*2L$I2`6KH!6\@E@P"VK!+<@%NZ`7_()@,`R*P3%(!LN@&3R#
+M:#`-JL$UR`;;H!M\@W`P#LK!.4@'ZZ`=O(-X,`_JP3W(!_N@'_R#@#`0"L)!
+M2`@+H2$\A(@P$2K"1<@(&Z$C?(20,!)*PDE("2NA);R$F#`3:L)-R`D[H2?\
+MA*`P%(K"44@*2Z$I/(6H,!6JPE7("ENA*WR%L#`6RL)92`MKH2V\A;@P%^K"
+M7<@+>Z$O_(7`,!@*PV%(#(NA,3R&R#`9*L-ER`R;H3-\AM`P&DK#:4@-JZ$U
+MO(;8,!MJPVW(#;NA-_R&X#`<BL-Q2`[+H3D\A^@P':K#=<@.VZ$[?(?P,![*
+MPWE(#^NA/;R'^#`?ZL-]R`_[H3_\AP`Q(`K$@4@0"Z)!/(@(,2$JQ(7($!NB
+M0WR($#$B2L2)2!$KHD6\B!@Q(VK$C<@1.Z)'_(@@,22*Q)%($DNB23R)*#$E
+MJL25R!);HDM\B3`Q)LK$F4@3:Z)-O(DX,2?JQ)W($WNB3_R)0#$H"L6A2!2+
+MHE$\BD@Q*2K%I<@4FZ)3?(I0,2I*Q:E(%:NB5;R*6#$K:L6MR!6[HE?\BF`Q
+M+(K%L4@6RZ)9/(MH,2VJQ;7(%MNB6WR+<#$NRL6Y2!?KHEV\BW@Q+^K%O<@7
+M^Z)?_(N`,3`*QL%(&`NC83R,B#$Q*L;%R!@;HV-\C)`Q,DK&R4@9*Z-EO(R8
+M,3-JQLW(&3NC9_R,H#$TBL;12!I+HVD\C:@Q-:K&U<@:6Z-K?(VP,3;*QME(
+M&VNC;;R-N#$WZL;=R!M[HV_\C<`Q.`K'X4@<BZ-Q/([(,3DJQ^7(')NC<WR.
+MT#$Z2L?I2!VKHW6\CM@Q.VK'[<@=NZ-W_([@,3R*Q_%('LNC>3R/Z#$]JL?U
+MR![;HWM\C_`Q/LK'^4@?ZZ-]O(_X,3_JQ_W('_NC?_R/`#)`"L@!22`+I($\
+MD`@R02K(!<D@&Z2#?)`0,D)*R`E)(2NDA;R0&#)#:L@-R2$[I(?\D"`R1(K(
+M$4DB2Z2)/)$H,D6JR!7)(ENDBWR1,#)&RL@922-KI(V\D3@R1^K('<DC>Z2/
+M_)%`,D@*R2%))(NDD3R22#))*LDER22;I)-\DE`R2DK)*4DEJZ25O))8,DMJ
+MR2W));NDE_R28#),BLDQ22;+I)D\DV@R3:K)-<DFVZ2;?)-P,D[*R3E))^ND
+MG;R3>#)/ZLD]R2?[I)_\DX`R4`K*04DH"Z6A/)2(,E$JRD7)*!NEHWR4D#)2
+M2LI)22DKI:6\E)@R4VK*3<DI.Z6G_)2@,E2*RE%)*DNEJ3R5J#)5JLI5R2I;
+MI:M\E;`R5LK*64DK:Z6MO)6X,E?JREW)*WNEK_R5P#)8"LMA22R+I;$\EL@R
+M62K+9<DLFZ6S?);0,EI*RVE)+:NEM;R6V#);:LMMR2V[I;?\EN`R7(K+<4DN
+MRZ6Y/)?H,EVJRW7)+MNENWR7\#)>RLMY22_KI;V\E_@R7^K+?<DO^Z6__)<`
+M,V`*S(%),`NFP3R8"#-A*LR%R3`;IL-\F!`S8DK,B4DQ*Z;%O)@8,V-JS(W)
+M,3NFQ_R8(#-DBLR123)+ILD\F2@S9:K,E<DR6Z;+?)DP,V;*S)E),VNFS;R9
+M.#-GZLR=R3-[IL_\F4`S:`K-H4DTBZ;1/)I(,VDJS:7)-)NFTWR:4#-J2LVI
+M236KIM6\FE@S:VK-K<DUNZ;7_)I@,VR*S;%)-LNFV3R;:#-MJLVUR3;;IMM\
+MFW`S;LK-N4DWZZ;=O)MX,V_JS;W)-_NFW_R;@#-P"L[!23@+I^$\G(@S<2K.
+MQ<DX&Z?C?)R0,W)*SLE).2NGY;R<F#-S:L[-R3D[I^?\G*`S=(K.T4DZ2Z?I
+M/)VH,W6JSM7).ENGZWR=L#-VRL[923MKI^V\G;@S=^K.W<D[>Z?O_)W`,W@*
+MS^%)/(NG\3R>R#-Y*L_ER3R;I_-\GM`S>DK/Z4D]JZ?UO)[8,WMJS^W)/;NG
+M]_R>X#-\BL_Q23[+I_D\G^@S?:K/]<D^VZ?[?)_P,W[*S_E)/^NG_;R?^#-_
+MZL_]R3_[I__\GP`T@`K0`4I`"Z@!/:`(-($JT`7*0!NH`WV@$#2"2M`)2D$K
+MJ`6]H!@T@VK0#<I!.Z@'_:`@-(2*T!%*0DNH"3VA*#2%JM`5RD);J`M]H3`T
+MALK0&4I#:Z@-O:$X-(?JT!W*0WNH#_VA0#2("M$A2D2+J!$]HD@TB2K1)<I$
+MFZ@3?:)0-(I*T2E*1:NH%;VB6#2+:M$MRD6[J!?]HF`TC(K1,4I&RZ@9/:-H
+M-(VJT37*1MNH&WVC<#2.RM$Y2D?KJ!V]HW@TC^K1/<I'^Z@?_:.`-)`*TD%*
+M2`NI(3VDB#21*M)%RD@;J2-]I)`TDDK224I)*ZDEO:28-)-JTDW*23NI)_VD
+MH#24BM)12DI+J2D]I:@TE:K25<I*6ZDK?:6P-);*TEE*2VNI+;VEN#27ZM)=
+MRDM[J2_]I<`TF`K384I,BZDQ/:;(-)DJTV7*3)NI,WVFT#2:2M-I2DVKJ36]
+MIM@TFVK3;<I-NZDW_:;@-)R*TW%*3LNI.3VGZ#2=JM-URD[;J3M]I_`TGLK3
+M>4I/ZZD]O:?X-)_JTWW*3_NI/_VG`#6@"M2!2E`+JD$]J`@UH2K4A<I0&ZI#
+M?:@0-:)*U(E*42NJ1;VH&#6C:M2-RE$[JD?]J"`UI(K4D4I22ZI)/:DH-:6J
+MU)7*4ENJ2WVI,#6FRM292E-KJDV]J3@UI^K4G<I3>ZI/_:E`-:@*U:%*5(NJ
+M43VJ2#6I*M6ERE2;JE-]JE`UJDK5J4I5JZI5O:I8-:MJU:W*5;NJ5_VJ8#6L
+MBM6Q2E;+JED]JV@UK:K5M<I6VZI;?:MP-:[*U;E*5^NJ7;VK>#6OZM6]RE?[
+MJE_]JX`UL`K6P4I8"ZMA/:R(-;$JUL7*6!NK8WVLD#6R2M;)2EDKJV6]K)@U
+MLVK6S<I9.ZMG_:R@-;2*UM%*6DNK:3VMJ#6UJM;5REI;JVM]K;`UMLK6V4I;
+M:ZMMO:VX-;?JUMW*6WNK;_VMP#6X"M?A2ER+JW$]KL@UN2K7Y<I<FZMS?:[0
+M-;I*U^E*7:NK=;VNV#6[:M?MREV[JW?]KN`UO(K7\4I>RZMY/:_H-;VJU_7*
+M7MNK>WVO\#6^RM?Y2E_KJWV]K_@UO^K7_<I?^ZM__:\`-L`*V`%+8`NL@3VP
+M"#;!*M@%RV`;K(-]L!`VPDK8"4MA*ZR%O;`8-L-JV`W+83NLA_VP(#;$BM@1
+M2V)+K(D]L2@VQ:K8%<MB6ZR+?;$P-L;*V!E+8VNLC;VQ.#;'ZM@=RV-[K(_]
+ML4`VR`K9(4MDBZR1/;)(-LDJV27+9)NLDWVR4#;*2MDI2V6KK)6]LE@VRVK9
+M+<MENZR7_;)@-LR*V3%+9LNLF3VS:#;-JMDURV;;K)M]LW`VSLK9.4MGZZR=
+MO;-X-L_JV3W+9_NLG_VS@#;0"MI!2V@+K:$]M(@VT2K:1<MH&ZVC?;20-M)*
+MVDE+:2NMI;VTF#;3:MI-RVD[K:?]M*`VU(K:44MJ2ZVI/;6H-M6JVE7+:ENM
+MJWVUL#;6RMI92VMKK:V]M;@VU^K:7<MK>ZVO_;7`-M@*VV%+;(NML3VVR#;9
+M*MMERVR;K;-]MM`VVDK;:4MMJZVUO;;8-MMJVVW+;;NMM_VVX#;<BMMQ2V[+
+MK;D]M^@VW:K;=<MNVZV[?;?P-M[*VWE+;^NMO;VW^#;?ZMM]RV_[K;_]MP`W
+MX`K<@4MP"Z[!/;@(-^$JW(7+<!NNPWVX$#?B2MR)2W$KKL6]N!@WXVK<C<MQ
+M.Z['_;@@-^2*W)%+<DNNR3VY*#?EJMR5RW);KLM]N3`WYLK<F4MS:Z[-O;DX
+M-^?JW)W+<WNNS_VY0#?H"MVA2W2+KM$]ND@WZ2K=I<MTFZ[3?;I0-^I*W:E+
+M=:NNU;VZ6#?K:MVMRW6[KM?]NF`W[(K=L4MVRZ[9/;MH-^VJW;7+=MNNVWV[
+M<#?NRMVY2W?KKMV]NW@W[^K=O<MW^Z[?_;N`-_`*WL%+>`NOX3V\B#?Q*M[%
+MRW@;K^-]O)`W\DK>R4MY*Z_EO;R8-_-JWLW+>3NOY_V\H#?TBM[12WI+K^D]
+MO:@W]:K>U<MZ6Z_K?;VP-_;*WME+>VNO[;V]N#?WZM[=RWM[K^_]O<`W^`K?
+MX4M\BZ_Q/;[(-_DJW^7+?)NO\WV^T#?Z2M_I2WVKK_6]OM@W^VK?[<M]NZ_W
+M_;[@-_R*W_%+?LNO^3V_Z#?]JM_URW[;K_M]O_`W_LK?^4M_ZZ_]O;_X-__J
+MW_W+?_NO__V_`#@`"^`!3(`+L`$^P`@X`2O@!<R`&[`#?L`0.`)+X`E,@2NP
+M!;[`&#@#:^`-S($[L`?^P"`X!(O@$4R"2[`)/L$H.`6KX!7,@ENP"W[!,#@&
+MR^`93(-KL`V^P3@X!^O@'<R#>[`/_L%`.`@+X2%,A(NP$3["2#@)*^$ES(2;
+ML!-^PE`X"DOA*4R%J[`5OL)8.`MKX2W,A;NP%_["8#@,B^$Q3(;+L!D^PV@X
+M#:OA-<R&V[`;?L-P.`[+X3E,A^NP';[#>#@/Z^$]S(?[L!_^PX`X$`OB04R(
+M"[$A/L2(.!$KXD7,B!NQ(W[$D#@22^))3(DKL26^Q)@X$VOB3<R).[$G_L2@
+M.!2+XE%,BDNQ*3[%J#@5J^)5S(I;L2M^Q;`X%LOB64R+:[$MOL6X.!?KXEW,
+MBWNQ+_[%P#@8"^-A3(R+L3$^QL@X&2OC9<R,F[$S?L;0.!I+XVE,C:NQ-;[&
+DV#@;:^-MS(V[L3?^QN`X'(OC<4R.R[$Y/L?H.!VKXW7,CKDM
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
new file mode 100644
index 00000000000..8ec91cc2d90
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
@@ -0,0 +1,304 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_rockridge_rr_moved.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1G@0-2\,]`(U'QT(0``F'H@``@!04A`E$R14P4`B`'!!
+M03>R*!"+1@0@0`(GDB!`0"D>V.&12":IY)),-NGDDU!&*>645%9IY9583MG$
+M$DE,\8014X#0Y1,@Y&"##3"\@`28(!B1!!-%3)'%%%04H:$05;Q)1!%2@&`"
+M"!<6,<034CPH8`M2O$"$%89*44005!`*`@I#I`!"##GD,`,(1;B0Q1-5.'$$
+M$4'`.6FEEV9Z`PA*N`#%HU)XZ<0+K4XQ!!)O,I&$J%GVZFNO,A"80PP%RA`#
+M#C/0(`,-!)(0+`S#%GMLLLLV2^"UV&9+(`#/1AN#L<@JRRP,)!CYZ[GHIJON
+MNNRVZ^Z[\,8K;Y/_U;O8/P(2:*"]_/;K[[\`!US=EDF`T,0;;H#PQ!AT7"K#
+MI3CHD*P.RX+0K0(RN%"@QC&$8<.FB(+00AUID'&IR&>4;#$(+K3\0AISO"'P
+MS#37;//-.*>5BR8'WDBD0`0`P(%`!Q*1A!0QL(@!T0!((<4733QA11%$!-V!
+M0$,:+84,06<@T```:(U#T!X`'?;1,P2M@4`%G"U%#D%_()`!;M/0]@8"'>`V
+ML0`$#<*.;M<0=`@"*>"V#4'7&-`";M^0\^.01R[YY)17;OGEF&>N^>8PF1C0
+MC28&+=#0`6B=]$!+!^`TU%)3+7I`5PN@-=<#>3V`V*\#4#8!6J<]T-H%:`WW
+M0'(;H+7=`^%]@.DP]#W0WPAH+?A`A"N@->(T`K"`UHYS[OWWX(<O_OCDEV_^
+M^>BG;QDD-N((@(X!\>@CD`$(^?.)!TX!Q0$!^/).TU(H0``"`04LL"``[0C"
+M0(+0#K`19`">(]J0""(`GPWD`E0P@@8"X(`>_2A(;5```R0@`@R0((0C+"$)
+MAE`$#@1@!`6!H4':49!VN*%]!,G10.3WP?I-L$BJ"^``"WC`!"ZP@06!8$%\
+M5)`*XBB#&^S@_$`H0A*:$(56)`$`]""T@@P-?N]#T!1]>+\`\.YH,0"@`!/A
+MA"8DX$!D2(,<8D!$!"I0(`QTX$"42!`F4G!H!.$`%#GH0?J1H)!43*$)^0``
+M+1*$!%0(`R\"PHLP9'",CCP1D0[@)CBY8`<Q<-H:V_A&`)@A#6PH0QU)$8B!
+M!((4$212+$\TP8$((),"@:0&"8E)1-8/BRHT!`"61I"E@9%%P#3A#XF$@-5%
+M;6I$4&,`DM'&!AQ(#G+X0AO>8(<RD*&.;;AC0(+0!CU^;99^M"4Q43=(!R3S
+MA%54X3L=18!9JN^>^,QG<VZX3H$8<X<`>.<R\2=-`AHP`.%<8#F3B,Y:8JV?
+M`<%`.]])T7B:$``WM*!`=`@X7]I/D_@+H@`-6D1Q`H"!N0M(/9?HT(`X,8?M
+M]&A%%:E%/P#`:P3QVC$#:M&/INB,4L"!-*GI1CC*$0=U-"(>D?C`AC81I[6+
+M:2\Q.<\BK%2?6,VJ5K?ZFAM"52`Z!:A'!XJB@B;5I'ED*$N?6I`,2+6'\*3I
+M.[<XS(+\LZ.8)"N*1!F`4)SUB.8,"!\'DLZ'VO6MAIQI%J'`!`8$0''9X^+:
+M"+*VG8ZUC$#-@3396%0`Q%$..?CK4@,+@,%*L(F3_1UB@R33GG+UM;"-K6P?
+M<\/4"J2R8LUK&0_$5Y+:$;!J[6-+`2``VP9$`ZO]94_GZM6VAA&O<-6K2(=X
+M4*6.DZE[="H%OQH0M^Y2BG!5K`H!P$B\$01OEM4M2`,0/#3"@*^<58!1YP@#
+MT5YWN`+0KBW-F[SD'I*JKIVM@`=,X`(#YH;\%0AZ<QO=W9JUNFAM!W[UB[4$
+M!V0#_A7O16M;$-Q"UY#2[:U]3XK=<ZZ5@L8%`'*_VUJYNI:1L=#H!6(1R4D"
+MH)*7A"O33K2\(A0!"I\,I1`Y6THR+`@.JVRE0%Z)3@J[-,87I#&+IQK>`!OX
+MREC.LI;+<D-`#N2+#`:Q@T4,8>`V]<2V]/+H,KQ<UV;4?>EM\'KW*D3?6I?$
+M*>V;DXFKT<^QV<4TI>O5"'*U.(MYO4"5P69).5\9C#BM9Q9N$P<]D`[XM\59
+MW+*F-\WI3D/EAI062*'#'"2]/KBD9LXNFK$6:MC].8O,[6(@GQL_,<H9B&1&
+M]6B#2UC\JCD@@IQRE0&=:2Z6C2!E,W2I,=N[17?VLS-X=(D%NV<!''L@'K@T
+M@`/MZ6Y[^]O@MLD-KRV09).:C',^]6]W'>E>-Y'<`<FVL!/;YD"#NB"C_O"R
+MYSQ=.T>8M*8E$GY;#0!+SSN1L'8M%^5&$+DI&]T_/9ZSBRQ'&D@;X-5F./&T
+M/>Q,A_OC(`^YR#MR0XT+Q.'G]JDLU7UG2*M:TA0T>4`^\&IYNEEW!3&WOB$N
+MRWY?G->GI2"\=5?S*RH<`'\C"/123E:@UF#B\ZW!S]L==%LF_7D<IS>W1\[U
+MKGO]ZP.YX=4%LO2=JYR@N5[W=3&^:I>./2`@*'I<,UWR@J#<["&N\]1?[NZ8
+MVUWN<^4BX0A"N(>?W8S7@[IGY6B#O9L8YK8<//6RCO#Q@OWRF,]\IV\H>8$4
+MGNECUGN9V<WWJF.M\P$)`>!O_G:DTSJ,E^5WVEL^[=)6N_5Q/[ARB3U>+D)6
+M(#4R?-.YI_C/WL#QU&X[<7\?$!%0?O<>U[STIT]]V-Z0^0`(/NC3/?M_`UW@
+M3<2^\W4_=YO;&P"H1__K>7AH7(M>UVO_/BV;F'[5DU_#6A0F//[!__[#XR`>
+MM6.(=S1"Q5>9P&B+)P=(-7KQ1W7@1T'[UW_\!P_/5WXF-`2-%0#<=5/5UX$>
+M^(&:PR?M$``*0`6'$$1)``5?@"G#`BE(4`0@@"%#L`0QF`1$<`0PN"MU(@6W
+M$@2B`H-0@"&1,BA,``)!*#4V&"<@,`55``500"A4T":2\H13D`18T"9O`H-R
+M0B=VLH1VXH-4D`1#H#]P$@13`(.#X@14$`1#$(5&8RM&6`5"H"M3\()]8@22
+MHC^"D@1N,@20D@1/X`1+""H\V"D0<H9`*(=T:(=BLB=JR(=)P"=B(HA!F`1-
+M$`12D`4@8`5/P`15T`0PN">V(@4I&"EW*"EIN(9M.(EX*`67&(:!Z`(@.(NT
+M6(NVF!%H4`9LP`9O8#BW^(O`&(S".(S$6(S&>(S(F(S*N(S,V(S.^(S0&(W2
+M.(W46(W6>(W8F(W:N(W<V(W>^(W@&([B.([D6([F>([HF([JN([LV([N^([P
+M&(_R.(_T6(_V>(_XF(_ZN(_\V(_^^(\`&9`".9`$69`&>9`(F9`*N9`,V9`.
+M^9`0&9$2.9$469$6>9$8F9$:N9$<V9$>^9$@&9(B.9(D69(F>9(HF9(JN9(L
+MV9(N^9(P&9,R.9,T69,V>9,XF9,ZN9,\V9,^^9-`&91".91$691&>91(F91*
+MN91,V91.^910&952.9546956>958F95:N95<V95>^95@&99B.99D699F>99H
+MF99JN99LV99N^99P&9=R.9=T69=V>9=XF9=ZN9=\V9=^^9>`&9B".9B$69B&
+M>9B(F9B*N9B,V9B.^9B0&9F2.9F469F6>9F8F9F:N9F<V9F>^9F@&9JB.9JD
+M69JF>9JHF9JJN9JLV9JN^9JP&9NR.9NT69NV>9NXF9NZN9N\V9N^^9O`&9S"
+M.9S$69S&>9S(F9S*N9S,V9S.^9S0&9W2.9W469W6>9W8F9W:N9W<V9W>^9W@
+M&9[B.9[D69[F>9[HF9[JN9[LV9[N^9[P&9_R.9_T69_V>9_XF9_ZN9_\V9_^
+M^9\`&J`".J`$6J`&>J`(FJ`*NJ`,VJ`.^J`0&J$2.J$46J$6>J$8FJ$:NJ$<
+MVJ$>^J$@&J(B.J(D6J(F>J(HFJ(JNJ(LVJ(N^J(P&J,R.J,T6J,V>J,XFJ,Z
+MNJ,\VJ,^^J-`&J1".J1$6J1&>J1(FJ1*NJ1,VJ1.^J10&J52.J546J56>J58
+MFJ5:NJ5<VJ5>^J5@&J9B.J9D6J9F>J9HFJ9JNJ9LVJ9N^J9P&J=R.J=T6J=V
+M>J=XFJ=ZNJ=\VJ=^^J>`&JB".JB$6JB&>JB(FJB*NJB,VJB.^JB0&JF2.JF4
+M6JF6>JF8FJF:NJF<VJF>^JF@&JJB.JJD6JJF>JJHFJJJNJJLVJJN^JJP&JNR
+M.JNT6JNV>JNXFJNZNJN\VJN^^JO`&JS".JS$6JS&>JS(FJS*NJS,VJS.^JS0
+M&JW2.JW46JW6>JW8FJW:NJW<VJW>^JW@&J[B.J[D6J[F>J[HFJ[JNJ[LVJ[N
+M^J[P&J_R.J_T6J_V>J_XFJ_ZNJ_\VJ_^^J\`&[`".[`$6[`&>[`(F[`*N[`,
+MV[`.^[`0&[$2.[$46[$6>[$8F[$:N[$<V[$>^[$@&[(B.[(D6[(F>[(HF[(J
+MN[(LV[(N^[(P&[,R.[,T6[,V>[,XF[,ZN[,\V[,^^[-`&[1".[1$6[1&>[1(
+MF[1*N[1,V[1.^[10&[52.[546[56>[58F[5:N[5<V[5>^[5@&[9B.[9D6[9F
+M>[9HF[9JN[9LV[9N^[9P&[=R.[=T6[=V>[=XF[=ZN[=\V[=^^[>`&[B".[B$
+M6[B&>[B(F[B*N[B,V[B.^[B0&[F2.[F46[F6>[F8F[F:N[F<V[F>^[F@&[JB
+M.[JD6[JF>[JHF[JJN[JLV[JN^[JP&[NR.[NT6[NV>[NXF[NZN[N\V[N^^[O`
+M&[S".[S$6[S&>[S(F[S*N[S,V[S.^[S0&[W2.[W46[W6>[W8F[W:N[W<V[W>
+M^[W@&[[B.[[D6[[F>[[HF[[JN[[LV[[N^[[P&[_R.[_T6[_V>[_XF[_ZN[_\
+MV[_^^[\`',`"/,`$7,`&?,`(G,`*O,`,W,`._,`0',$2/,$47,$6?,$8G,$:
+MO,$<W,$>_,$@',(B/,(D7,(F?,(HG,(JO,(LW,(N_,(P',,R/,,T7,,V?,,X
+MG,,ZO,,\W,,^_,-`',1"/,1$7,1&?,1(G,1*O,1,W,1._,10',52/,547,56
+M?,58G,5:O,5<W,5>_,5@',9B/,9D7,9F?,9HG,9JO,9LW,9N_,9P',=R/,=T
+M7,=V?,=XG,=ZO,=\W,=^_,>`',B"/,B$7,B&?,B(G,B*O,B,W,B._,B0',F2
+M/,F47,F6?,F8G,F:O,F<W,F>_,F@',JB/,JD7,JF?,JHG,JJO,JLW,JN_,JP
+M',NR/,NT7,NV?,NXG,NZO,N\W,N^_,O`',S"/,S$7,S&?,S(G,S*O,S,W,S.
+M_,S0',W2/,W47,W6?,W8G,W:O,W<W,W>_,W@',[B/,[D7,[F?,[HG,[JO,[L
+MW,[N_,[P',_R/,_T7,_V?,_XG,_ZO,_\W,_^_,\`'=`"/=`$7=`&?=`(G=`*
+MO=`,W=`._=`0'=$2/=$47=$6?=$8G=$:O=$<W=$>_=$@'=(B/=(D7=(F?=(H
+MG=(JO=(LW=(N_=(P'=,R/=,T7=,V?=,XG=,ZO=,\W=,^_=-`'=1"/=1$7=1&
+M?=1(G=1*O=1,W=1._=10'=52/=547=56?=58G=5:O=5<W=5>_=5@'=9B/=9D
+M7=9F?=9HG=9JO=9LW=9N_=9P'==R/==T7==V?==XG==ZO==\W==^_=>`'=B"
+M/=B$7=B&?=B(G=B*O=B,W=B._=B0'=F2/=F47=F6?=F8G=F:O=F<W=F>_=F@
+M'=JB/=JD7=JF?=JHG=JJO=JLW=JN_=JP'=NR/=NT7=NV?=NXG=NZO=N\W=N^
+M_=O`'=S"/=S$7=S&?=S(G=S*O=S,W=S._=S0'=W2/=W47=W6?=W8G=W:O=W<
+MW=W>_=W@'=[B/=[D7=[F?=[HG=[JO=[LW=[N_=[P'=_R/=_T7=_V?=_XG=_Z
+MO=_\W=_^_=\`'N`"/N`$7N`&?N`(GN`*ON`,WN`._N`0'N$2/N$47N$6?N$8
+MGN$:ON$<WN$>_N$@'N(B/N(D7N(F?N(HGN(JON(LWN(N_N(P'N,R/N,T7N,V
+M?N,XGN,ZON,\WN,^_N-`'N1"/N1$7N1&?N1(GN1*ON1,WN1._N10'N52/N54
+M7N56?N58GN5:ON5<WN5>_N5@'N9B/N9D7N9F?N9HGN9JON9LWN9N_N9P'N=R
+M/N=T7N=V?N=XGN=ZON=\WN=^_N>`'NB"/NB$7NB&?NB(GNB*ONB,WNB._NB0
+M'NF2/NF47NF6?NF8GNF:ONF<WNF>_NF@'NJB/NJD7NJF?NJHGNJJONJLWNJN
+M_NJP'NNR/NNT7NNV?NNXGNNZONN\WNN^_NO`'NS"/NS$7NS&?NS(GNS*ONS,
+MWNS._NS0'NW2/NW47NW6?NW8GNW:ONW<WNW>_NW@'N[B/N[D7N[F?N[HGN[J
+MON[LWN[N_N[P'N_R/N_T7N_V?N_XGN_ZON_\WN_^_N\`'_`"/_`$7_`&?_`(
+MG_`*O_`,W_`.__`0'_$2/_$47_$6?_$8G_$:O_$<W_$>__$@'_(B/_(D7_(F
+M?_(HG_(JO_(LW_(N__(P'_,R/_,T7_,V?_,XG_,ZO_,\W_,^__-`'_1"/_1$
+M7_1&?_1(G_1*O_1,W_1.__10'_52/_547_56?_58G_5:O_5<W_5>__5@'_9B
+M/_9D7_9F?_9HG_9JO_9LW_9N__9P'_=R/_=T7_=V?_=XG_=ZO_=\W_=^__>`
+M'_B"/_B$7_B&?_B(G_B*O_B,W_B.__B0'_F2/_F47_F6?_F8G_F:O_F<W_F>
+M__F@'_JB/_JD7_JF?_JHG_JJO_JLW_JN__JP'_NR/_NT7_NV?_NXG_NZO_N\
+MW_N^__O`'_S"/_S$7_S&?_S(G_S*O_S,W_S.__S0'_W2/_W47_W6?_W8G_W:
+MO_W<W_W>__W@'_[B/_[D7_[F?_[HG_[JO_[LW_[N__[P'__R/__T7__V?__X
+MG__ZO__\W__^__\`,``*P`%(``N@`3R`"#`!*L`%R``;H`-\@!`P`DK`"4@!
+M*Z`%O(`8,`-JP`W(`3N@!_R`(#`$BL`12`)+H`D\@2@P!:K`%<@"6Z`+?($P
+M,`;*P!E(`VN@#;R!.#`'ZL`=R`-[H`_\@4`P"`K!(4@$BZ`1/()(,`DJP27(
+M!)N@$WR"4#`*2L$I2`6KH!6\@E@P"VK!+<@%NZ`7_()@,`R*P3%(!LN@&3R#
+M:#`-JL$UR`;;H!M\@W`P#LK!.4@'ZZ`=O(-X,`_JP3W(!_N@'_R#@#`0"L)!
+M2`@+H2$\A(@P$2K"1<@(&Z$C?(20,!)*PDE("2NA);R$F#`3:L)-R`D[H2?\
+MA*`P%(K"44@*2Z$I/(6H,!6JPE7("ENA*WR%L#`6RL)92`MKH2V\A;@P%^K"
+M7<@+>Z$O_(7`,!@*PV%(#(NA,3R&R#`9*L-ER`R;H3-\AM`P&DK#:4@-JZ$U
+MO(;8,!MJPVW(#;NA-_R&X#`<BL-Q2`[+H3D\A^@P':K#=<@.VZ$[?(?P,![*
+MPWE(#^NA/;R'^#`?ZL-]R`_[H3_\AP`Q(`K$@4@0"Z)!/(@(,2$JQ(7($!NB
+M0WR($#$B2L2)2!$KHD6\B!@Q(VK$C<@1.Z)'_(@@,22*Q)%($DNB23R)*#$E
+MJL25R!);HDM\B3`Q)LK$F4@3:Z)-O(DX,2?JQ)W($WNB3_R)0#$H"L6A2!2+
+MHE$\BD@Q*2K%I<@4FZ)3?(I0,2I*Q:E(%:NB5;R*6#$K:L6MR!6[HE?\BF`Q
+M+(K%L4@6RZ)9/(MH,2VJQ;7(%MNB6WR+<#$NRL6Y2!?KHEV\BW@Q+^K%O<@7
+M^Z)?_(N`,3`*QL%(&`NC83R,B#$Q*L;%R!@;HV-\C)`Q,DK&R4@9*Z-EO(R8
+M,3-JQLW(&3NC9_R,H#$TBL;12!I+HVD\C:@Q-:K&U<@:6Z-K?(VP,3;*QME(
+M&VNC;;R-N#$WZL;=R!M[HV_\C<`Q.`K'X4@<BZ-Q/([(,3DJQ^7(')NC<WR.
+MT#$Z2L?I2!VKHW6\CM@Q.VK'[<@=NZ-W_([@,3R*Q_%('LNC>3R/Z#$]JL?U
+MR![;HWM\C_`Q/LK'^4@?ZZ-]O(_X,3_JQ_W('_NC?_R/`#)`"L@!22`+I($\
+MD`@R02K(!<D@&Z2#?)`0,D)*R`E)(2NDA;R0&#)#:L@-R2$[I(?\D"`R1(K(
+M$4DB2Z2)/)$H,D6JR!7)(ENDBWR1,#)&RL@922-KI(V\D3@R1^K('<DC>Z2/
+M_)%`,D@*R2%))(NDD3R22#))*LDER22;I)-\DE`R2DK)*4DEJZ25O))8,DMJ
+MR2W));NDE_R28#),BLDQ22;+I)D\DV@R3:K)-<DFVZ2;?)-P,D[*R3E))^ND
+MG;R3>#)/ZLD]R2?[I)_\DX`R4`K*04DH"Z6A/)2(,E$JRD7)*!NEHWR4D#)2
+M2LI)22DKI:6\E)@R4VK*3<DI.Z6G_)2@,E2*RE%)*DNEJ3R5J#)5JLI5R2I;
+MI:M\E;`R5LK*64DK:Z6MO)6X,E?JREW)*WNEK_R5P#)8"LMA22R+I;$\EL@R
+M62K+9<DLFZ6S?);0,EI*RVE)+:NEM;R6V#);:LMMR2V[I;?\EN`R7(K+<4DN
+MRZ6Y/)?H,EVJRW7)+MNENWR7\#)>RLMY22_KI;V\E_@R7^K+?<DO^Z6__)<`
+M,V`*S(%),`NFP3R8"#-A*LR%R3`;IL-\F!`S8DK,B4DQ*Z;%O)@8,V-JS(W)
+M,3NFQ_R8(#-DBLR123)+ILD\F2@S9:K,E<DR6Z;+?)DP,V;*S)E),VNFS;R9
+M.#-GZLR=R3-[IL_\F4`S:`K-H4DTBZ;1/)I(,VDJS:7)-)NFTWR:4#-J2LVI
+M236KIM6\FE@S:VK-K<DUNZ;7_)I@,VR*S;%)-LNFV3R;:#-MJLVUR3;;IMM\
+MFW`S;LK-N4DWZZ;=O)MX,V_JS;W)-_NFW_R;@#-P"L[!23@+I^$\G(@S<2K.
+MQ<DX&Z?C?)R0,W)*SLE).2NGY;R<F#-S:L[-R3D[I^?\G*`S=(K.T4DZ2Z?I
+M/)VH,W6JSM7).ENGZWR=L#-VRL[923MKI^V\G;@S=^K.W<D[>Z?O_)W`,W@*
+MS^%)/(NG\3R>R#-Y*L_ER3R;I_-\GM`S>DK/Z4D]JZ?UO)[8,WMJS^W)/;NG
+M]_R>X#-\BL_Q23[+I_D\G^@S?:K/]<D^VZ?[?)_P,W[*S_E)/^NG_;R?^#-_
+MZL_]R3_[I__\GP`T@`K0`4I`"Z@!/:`(-($JT`7*0!NH`WV@$#2"2M`)2D$K
+MJ`6]H!@T@VK0#<I!.Z@'_:`@-(2*T!%*0DNH"3VA*#2%JM`5RD);J`M]H3`T
+MALK0&4I#:Z@-O:$X-(?JT!W*0WNH#_VA0#2("M$A2D2+J!$]HD@TB2K1)<I$
+MFZ@3?:)0-(I*T2E*1:NH%;VB6#2+:M$MRD6[J!?]HF`TC(K1,4I&RZ@9/:-H
+M-(VJT37*1MNH&WVC<#2.RM$Y2D?KJ!V]HW@TC^K1/<I'^Z@?_:.`-)`*TD%*
+M2`NI(3VDB#21*M)%RD@;J2-]I)`TDDK224I)*ZDEO:28-)-JTDW*23NI)_VD
+MH#24BM)12DI+J2D]I:@TE:K25<I*6ZDK?:6P-);*TEE*2VNI+;VEN#27ZM)=
+MRDM[J2_]I<`TF`K384I,BZDQ/:;(-)DJTV7*3)NI,WVFT#2:2M-I2DVKJ36]
+MIM@TFVK3;<I-NZDW_:;@-)R*TW%*3LNI.3VGZ#2=JM-URD[;J3M]I_`TGLK3
+M>4I/ZZD]O:?X-)_JTWW*3_NI/_VG`#6@"M2!2E`+JD$]J`@UH2K4A<I0&ZI#
+M?:@0-:)*U(E*42NJ1;VH&#6C:M2-RE$[JD?]J"`UI(K4D4I22ZI)/:DH-:6J
+MU)7*4ENJ2WVI,#6FRM292E-KJDV]J3@UI^K4G<I3>ZI/_:E`-:@*U:%*5(NJ
+M43VJ2#6I*M6ERE2;JE-]JE`UJDK5J4I5JZI5O:I8-:MJU:W*5;NJ5_VJ8#6L
+MBM6Q2E;+JED]JV@UK:K5M<I6VZI;?:MP-:[*U;E*5^NJ7;VK>#6OZM6]RE?[
+MJE_]JX`UL`K6P4I8"ZMA/:R(-;$JUL7*6!NK8WVLD#6R2M;)2EDKJV6]K)@U
+MLVK6S<I9.ZMG_:R@-;2*UM%*6DNK:3VMJ#6UJM;5REI;JVM]K;`UMLK6V4I;
+M:ZMMO:VX-;?JUMW*6WNK;_VMP#6X"M?A2ER+JW$]KL@UN2K7Y<I<FZMS?:[0
+M-;I*U^E*7:NK=;VNV#6[:M?MREV[JW?]KN`UO(K7\4I>RZMY/:_H-;VJU_7*
+M7MNK>WVO\#6^RM?Y2E_KJWV]K_@UO^K7_<I?^ZM__:\`-L`*V`%+8`NL@3VP
+M"#;!*M@%RV`;K(-]L!`VPDK8"4MA*ZR%O;`8-L-JV`W+83NLA_VP(#;$BM@1
+M2V)+K(D]L2@VQ:K8%<MB6ZR+?;$P-L;*V!E+8VNLC;VQ.#;'ZM@=RV-[K(_]
+ML4`VR`K9(4MDBZR1/;)(-LDJV27+9)NLDWVR4#;*2MDI2V6KK)6]LE@VRVK9
+M+<MENZR7_;)@-LR*V3%+9LNLF3VS:#;-JMDURV;;K)M]LW`VSLK9.4MGZZR=
+MO;-X-L_JV3W+9_NLG_VS@#;0"MI!2V@+K:$]M(@VT2K:1<MH&ZVC?;20-M)*
+MVDE+:2NMI;VTF#;3:MI-RVD[K:?]M*`VU(K:44MJ2ZVI/;6H-M6JVE7+:ENM
+MJWVUL#;6RMI92VMKK:V]M;@VU^K:7<MK>ZVO_;7`-M@*VV%+;(NML3VVR#;9
+M*MMERVR;K;-]MM`VVDK;:4MMJZVUO;;8-MMJVVW+;;NMM_VVX#;<BMMQ2V[+
+MK;D]M^@VW:K;=<MNVZV[?;?P-M[*VWE+;^NMO;VW^#;?ZMM]RV_[K;_]MP`W
+MX`K<@4MP"Z[!/;@(-^$JW(7+<!NNPWVX$#?B2MR)2W$KKL6]N!@WXVK<C<MQ
+M.Z['_;@@-^2*W)%+<DNNR3VY*#?EJMR5RW);KLM]N3`WYLK<F4MS:Z[-O;DX
+M-^?JW)W+<WNNS_VY0#?H"MVA2W2+KM$]ND@WZ2K=I<MTFZ[3?;I0-^I*W:E+
+M=:NNU;VZ6#?K:MVMRW6[KM?]NF`W[(K=L4MVRZ[9/;MH-^VJW;7+=MNNVWV[
+M<#?NRMVY2W?KKMV]NW@W[^K=O<MW^Z[?_;N`-_`*WL%+>`NOX3V\B#?Q*M[%
+MRW@;K^-]O)`W\DK>R4MY*Z_EO;R8-_-JWLW+>3NOY_V\H#?TBM[12WI+K^D]
+MO:@W]:K>U<MZ6Z_K?;VP-_;*WME+>VNO[;V]N#?WZM[=RWM[K^_]O<`W^`K?
+MX4M\BZ_Q/;[(-_DJW^7+?)NO\WV^T#?Z2M_I2WVKK_6]OM@W^VK?[<M]NZ_W
+M_;[@-_R*W_%+?LNO^3V_Z#?]JM_URW[;K_M]O_`W_LK?^4M_ZZ_]O;_X-__J
+MW_W+?_NO__V_`#@`"^`!3(`+L`$^P`@X`2O@!<R`&[`#?L`0.`)+X`E,@2NP
+M!;[`&#@#:^`-S($[L`?^P"`X!(O@$4R"2[`)/L$H.`6KX!7,@ENP"W[!,#@&
+MR^`93(-KL`V^P3@X!^O@'<R#>[`/_L%`.`@+X2%,A(NP$3["2#@)*^$ES(2;
+ML!-^PE`X"DOA*4R%J[`5OL)8.`MKX2W,A;NP%_["8#@,B^$Q3(;+L!D^PV@X
+M#:OA-<R&V[`;?L-P.`[+X3E,A^NP';[#>#@/Z^$]S(?[L!_^PX`X$`OB04R(
+M"[$A/L2(.!$KXD7,B!NQ(W[$D#@22^))3(DKL26^Q)@X$VOB3<R).[$G_L2@
+M.!2+XE%,BDNQ*3[%J#@5J^)5S(I;L2M^Q;`X%LOB64R+:[$MOL6X.!?KXEW,
+MBWNQ+_[%P#@8"^-A3(R+L3$^QL@X&2OC9<R,F[$S?L;0.!I+XVE,C:NQ-;[&
+MV#@;:^-MS(V[L3?^QN`X'(OC<4R.R[$Y/L?H.!VKXW7,CMNQ.W['\#@>R^-Y
+M3(_KL3V^Q_@X'^OC?<R/^[$__L<`.2`+Y(%,D`NR03[("#DA*^2%S)`;LD-^
+MR!`Y(DODB4R1*[)%OL@8.2-KY(W,D3NR1_[((#DDB^213))+LDD^R2@Y):OD
+ME<R26[)+?LDP.2;+Y)E,DVNR3;[).#DGZ^2=S)-[LD_^R4`Y*`OEH4R4B[)1
+M/LI(.2DKY:7,E)NR4W[*4#DJ2^6I3)6KLE6^RE@Y*VOEK<R5N[)7_LI@.2R+
+MY;%,ELNR63[+:#DMJ^6US);;LEM^RW`Y+LOEN4R7Z[)=OLMX.2_KY;W,E_NR
+M7_[+@#DP"^;!3)@+LV$^S(@Y,2OFQ<R8&[-C?LR0.3)+YLE,F2NS9;[,F#DS
+M:^;-S)D[LV?^S*`Y-(OFT4R:2[-I/LVH.36KYM7,FENS:W[-L#DVR^;93)MK
+MLVV^S;@Y-^OFW<R;>[-O_LW`.3@+Y^%,G(NS<3[.R#DY*^?ES)R;LW-^SM`Y
+M.DOGZ4R=J[-UOL[8.3MKY^W,G;NS=_[.X#D\B^?Q3)[+LWD^S^@Y/:OG]<R>
+MV[-[?L_P.3[+Y_E,G^NS?;[/^#D_Z^?]S)_[LW_^SP`Z0`OH`4V@"[2!/M`(
+M.D$KZ`7-H!NT@W[0$#I"2^@)3:$KM(6^T!@Z0VOH#<VA.[2'_M`@.D2+Z!%-
+MHDNTB3[1*#I%J^@5S:);M(M^T3`Z1LOH&4VC:[2-OM$X.D?KZ!W-HWNTC_[1
+M0#I("^DA3:2+M)$^TD@Z22OI)<VDF[23?M)0.DI+Z2E-I:NTE;[26#I+:^DM
+MS:6[M)?^TF`Z3(OI,4VFR[29/M-H.DVKZ37-IMNTFW[3<#I.R^DY3:?KM)V^
+MTW@Z3^OI/<VG^[2?_M.`.E`+ZD%-J`NUH3[4B#I1*^I%S:@;M:-^U)`Z4DOJ
+M24VI*[6EOM28.E-KZDW-J3NUI_[4H#I4B^I13:I+M:D^U:@Z5:OJ5<VJ6[6K
+M?M6P.E;+ZEE-JVNUK;[5N#I7Z^I=S:M[M:_^U<`Z6`OK84VLB[6Q/M;(.EDK
+MZV5-A'/1+NI%S#I:2^MI3:VKM;6^UM@Z6VOK;<VMN[6W_M;@.ER+ZW%-KLNU
+MN3[7Z#I=J^MUS:[;M;M^U_`Z7LOK>4VOZ[6]OM?X.E_KZWW-K_NUO_[7`#M@
+M"^R!3;`+ML$^V`@[82OLA<VP&[;#?M@0.V)+[(E-L2NVQ;[8&#MC:^R-S;$[
+MML?^V"`[9(OLD4VR2[;)/MDH.V6K[)7-LENVRW[9,#MFR^R93;-KMLV^V3@[
+M9^OLG<VS>[;/_ME`.V@+[:%-M(NVT3[:2#MI*^VES;2;MM-^VE`[:DOMJ4VU
+MJ[;5OMI8.VMK[:W-M;NVU_[:8#MLB^VQ3;;+MMD^VV@[;:OMM<VVV[;;?MMP
+M.V[+[;E-M^NVW;[;>#MOZ^V]S;?[MM_^VX`[<`ONP4VX"[?A/MR(.W$K[L7-
+MN!NWXW[<D#MR2^[)3;DKM^6^W)@[<VONS<VY.[?G_MR@.W2+[M%-NDNWZ3[=
+MJ#MUJ^[5S;I;M^M^W;`[=LONV4V[:[?MOMVX.W?K[MW-NWNW[_[=P#MX"^_A
+M3;R+M_$^WL@[>2OOY<V\F[?S?M[0.WI+[^E-O:NW];[>V#M[:^_MS;V[M_?^
+MWN`[?(OO\4V^R[?Y/M_H.WVK[_7-OMNW^W[?\#M^R^_Y3;_KM_V^W_@[?^OO
+M_<V_^[?__M\`/(`+\`%.P`NX`3_@"#R!*_`%SL`;N`-_X!`\@DOP"4[!*[@%
+MO^`8/(-K\`W.P3NX!__@(#R$B_`13L)+N`D_X2@\A:OP%<["6[@+?^$P/(;+
+M\!E.PVNX#;_A.#R'Z_`=SL-[N`__X4`\B`OQ(4[$B[@1/^)(/(DK\27.Q)NX
+M$W_B4#R*2_$I3L6KN!6_XE@\BVOQ+<[%N[@7_^)@/(R+\3%.QLNX&3_C:#R-
+MJ_$USL;;N!M_XW`\CLOQ.4['Z[@=O^-X/(_K\3W.Q_NX'__C@#R0"_)!3L@+
+MN2$_Y(@\D2OR1<[(&[DC?^20/))+\DE.R2NY);_DF#R3:_)-SLD[N2?_Y*`\
+ME(OR44[*2[DI/^6H/)6K\E7.RENY*W_EL#R6R_)93LMKN2V_Y;@\E^OR7<[+
+M>[DO_^7`/)@+\V%.S(NY,3_FR#R9*_-ESLR;N3-_YM`\FDOS:4[-J[DUO^;8
+M/)MK\VW.S;NY-__FX#R<B_-Q3L[+N3D_Y^@\G:OS=<[.V[D[?^?P/)[+\WE.
+MS^NY/;_G^#R?Z_-]SL_[N3__YP`]H`OT@4[0"[I!/^@(/:$K](7.T!NZ0W_H
+M$#VB2_2)3M$KND6_Z!@]HVOTC<[1.[I'_^@@/:2+])%.TDNZ23_I*#VEJ_25
+MSM);NDM_Z3`]ILOTF4[3:[I-O^DX/:?K])W.TWNZ3__I0#VH"_6A3M2+NE$_
+MZD@]J2OUI<[4F[I3?^I0/:I+]:E.U:NZ5;_J6#VK:_6MSM6[NE?_ZF`]K(OU
+ML4[6R[I9/^MH/:VK];7.UMNZ6W_K<#VNR_6Y3M?KNEV_ZW@]K^OUO<[7^[I?
+M_^N`/;`+]L%.V`N[83_LB#VQ*_;%SM@;NV-_[)`]LDOVR4[9*[MEO^R8/;-K
+M]LW.V3N[9__LH#VTB_;13MI+NVD_[:@]M:OVU<[:6[MK?^VP/;;+]ME.VVN[
+M;;_MN#VWZ_;=SMM[NV__[<`]N`OWX4[<B[MQ/^[(/;DK]^7.W)N[<W_NT#VZ
+M2_?I3MVKNW6_[M@]NVOW[<[=N[MW_^[@/;R+]_%.WLN[>3_OZ#V]J_?USM[;
+MNWM_[_`]OLOW^4[?Z[M]O^_X/;_K]_W.W_N[?__O`#[`"_@!3^`+O($_\`@^
+MP2OX!<_@&[R#?_`0/L)+^`E/X2N\A;_P&#[#:_@-S^$[O(?_\"`^Q(OX$4_B
+M2[R)/_$H/L6K^!7/XEN\BW_Q,#[&R_@93^-KO(V_\3@^Q^OX'<_C>[R/__%`
+M/L@+^2%/Y(N\D3_R2#[)*_DES^2;O)-_\E`^RDOY*4_EJ[R5O_)8/LMK^2W/
+MY;N\E__R8#[,B_DQ3^;+O)D_\V@^S:OY-<_FV[R;?_-P/L[+^3E/Y^N\G;_S
+M>#[/Z_D]S^?[O)__\X`^T`OZ04_H"[VA/_2(/M$K^D7/Z!N]HW_TD#[22_I)
+M3^DKO:6_])@^TVOZ3<_I.[VG__2@/M2+^E%/ZDN]J3_UJ#[5J_I5S^I;O:M_
+M];`^ULOZ64_K:[VMO_6X/M?K^EW/ZWN]K__UP#[8"_MA3^R+O;$_]L@^V2O[
+M9<_LF[VS?_;0/MI+^VE/[:N]M;_VV#[;:_MMS^V[O;?_]N`^W(O[<4_NR[VY
+M/_?H/MVK^W7/[MN]NW_W\#[>R_MY3^_KO;V_]_@^W^O[?<_O^[V___<`/^`+
+M_(%/\`N^P3_X"#_A*_R%S_`;OL-_^!`_XDO\B4_Q*[[%O_@8/^-K_(W/\3N^
+MQ__X(#_DB_R13_)+OLD_^2@_Y:O\E<_R6[[+?_DP/^;+_)E/\VN^S;_Y.#_G
+MZ_R=S_-[OL__^4`_Z`O]H4_TB[[1/_I(/^DK_:7/])N^TW_Z4#_J2_VI3_6K
+MOM6_^E@_ZVO]K<_UN[[7__I@/^R+_;%/]LN^V3_[:#_MJ_VUS_;;OMM_^W`_
+M[LO]N4_WZ[[=O_MX/^_K_;W/]_N^W__[@#_P"_[!3_@+O^$__(@_\2O^Q<_X
+M&[_C?_R0/_)+_LE/^2N_Y;_\F#_S:_[-S_D[O^?__*`_](O^T4_Z2[_I/_VH
+M/_6K_M7/^EN_ZW_]L#_VR_[93_MKO^V__;@_]^O^W<_[>[_O__W`/_@+_^%/
+M_(N_\3_^R#_Y*__ES_R;O_-__M`_^DO_Z4_]J[_UO_[8/_MK_^W/_;N_]__^
+MX#_\B__Q3_[+O_D__^@__:O_]<_^V[_[?__P/_[+__E/_^N__;__^#__Z__]
+MS__[O____P!@`"@`#H`$8`%H`!Z`"&`"J``N@`Q@`^@`/H`08`0H`4Z`%&`%
+M:`%>@!A@!J@!;H`<8`?H`7Z`(&`(*`*.@"1@"6@"GH`H8`JH`JZ`+&`+Z`*^
+M@#!@#"@#SH`T8`UH`]Z`.&`.J`/N@#Q@#^@#_H!`8!`H!`Z!1&`1:`0>@4A@
+M$J@$+H%,8!/H!#Z!4&`4*`5.@51@%6@%7H%88!:H!6Z!7&`7Z`5^@6!@&"@&
+MCH%D8!EH!IZ!:&`:J`:N@6Q@&^@&OH%P8!PH!\Z!=&`=:`?>@7A@'J@'[H%\
+M8!_H!_Z!@&`@*`@.@H1@(6@('H*(8"*H""Z"C&`CZ`@^@I!@)"@)3H*48"5H
+M"5Z"F&`FJ`EN@IQ@)^@)?H*@8"@H"HZ"I&`I:`J>@JA@*J@*KH*L8"OH"KZ"
+ML&`L*`O.@K1@+6@+WH*X8"ZH"^Z"O&`OZ`O^@L!@,"@,#H/$8#%H#!Z#R&`R
+MJ`PN@\Q@,^@,/H/08#0H#4Z#U&`U:`U>@]A@-J@-;H/<8#?H#7Z#X&`X*`Z.
+M@^1@.6@.GH/H8#JH#JZ#[&`[Z`Z^@_!@/"@/SH/T8#UH#]Z#^&`^J`_N@_Q@
+M/^@/_H,`84`H$`Z$!&%!:!`>A`AA0J@0+H0,84/H$#Z$$&%$*!%.A!1A16@1
+M7H0884:H$6Z$'&%'Z!%^A"!A2"@2CH0D84EH$IZ$*&%*J!*NA"QA2^@2OH0P
+M84PH$\Z$-&%-:!/>A#AA3J@3[H0\84_H$_Z$0&%0*!0.A41A46@4'H5(85*H
+M%"Z%3&%3Z!0^A5!A5"@53H54855H%5Z%6&%6J!5NA5QA5^@5?H5@85@H%HZ%
+M9&%9:!:>A6AA6J@6KH5L85OH%KZ%<&%<*!?.A71A76@7WH5X85ZH%^Z%?&%?
+MZ!?^A8!A8"@8#H:$86%H&!Z&B&%BJ!@NAHQA8^@8/H:0860H&4Z&E&%E:!E>
+MAIAA9J@9;H:<86?H&7Z&H&%H*!J.AJ1A:6@:GH:H86JH&JZ&K&%KZ!J^AK!A
+M;"@;SH:T86UH&]Z&N&%NJ!ONAKQA;^@;_H;`87`H'`Z'Q&%Q:!P>A\AA<J@<
+M+H?,87/H'#Z'T&%T*!U.A]1A=6@=7H?887:H'6Z'W&%WZ!U^A^!A>"@>CH?D
+M87EH'IZ'Z&%ZJ!ZNA^QA>^@>OH?P87PH'\Z']&%]:!_>A_AA?J@?[H?\87_H
+M'_Z'`&*`*"`.B`1B@6@@'H@(8H*H("Z(#&*#Z"`^B!!BA"@A3H@48H5H(5Z(
+M&&*&J"%NB!QBA^@A?H@@8H@H(HZ()&*):"*>B"ABBJ@BKH@L8HOH(KZ(,&*,
+M*"/.B#1BC6@CWH@X8HZH(^Z(/&*/Z"/^B$!BD"@D#HE$8I%H)!Z)2&*2J"0N
+MB4QBD^@D/HE08I0H)4Z)5&*5:"5>B5ABEJ@E;HE<8I?H)7Z)8&*8*":.B61B
+MF6@FGHEH8IJH)JZ);&*;Z":^B7!BG"@GSHET8IUH)]Z)>&*>J"?NB7QBG^@G
+M_HF`8J`H*`Z*A&*A:"@>BHABHJ@H+HJ,8J/H*#Z*D&*D*"E.BI1BI6@I7HJ8
+M8J:H*6Z*G&*GZ"E^BJ!BJ"@JCHJD8JEH*IZ*J&*JJ"JNBJQBJ^@JOHJP8JPH
+M*\Z*M&*M:"O>BKABKJ@K[HJ\8J_H*_Z*P&*P*"P.B\1BL6@L'HO(8K*H+"Z+
+MS&*SZ"P^B]!BM"@M3HO48K5H+5Z+V&*VJ"UNB]QBM^@M?HO@8K@H+HZ+Y&*Y
+M:"Z>B^ABNJ@NKHOL8KOH+KZ+\&*\*"_.B_1BO6@OWHOX8KZH+^Z+_&*_Z"_^
+'BP!CP+@7`0``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
new file mode 100644
index 00000000000..ef54ca6c770
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
@@ -0,0 +1,63 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_iso_zisofs.iso.Z
+M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
+MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
+MJ=.G4*-*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
+MKMV[>//JW<NWK]^_@`,+'DRXL.'#B!,K7LRXL>/'D"-+GDRYLN7+F#-KWLRY
+ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\
+MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^
+MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$;(44890DQ!!`@01BCA
+MA!1***`43S11X88<1GA0+`6!Z-&!``1`XH$((`"`!059,$%"%0PD`@`7%%2C
+MB@*I:$0``B10(@D"!'3B@1T6:>212":IY)),-NGDDU!&*>645%9I991-+)'$
+M%$\8,04(6SX!0@XVV`##"TAX"8(123!1Q!193$%%$1H*446;1!0A!0@F@'!A
+M$4,\(<6#`K8@Q0M$6$&H%$4$086@(*`P1`H@Q)!##C.`4(0+63Q1A1-'$!&$
+MFY%.6NFE-X"@A`M0-"H%ETZ\L.H40R#1)A-)@'KEKKSN*@.!.<`0K`PRQ$!#
+M#300"`,)OPKK++'&(JLL"<I6:VVU`#0;[+#%'ILL@200V>NXY)9K[KGHIJON
+MNNRVZ^Z2_\6[V#\"$FB@O/CFJ^^^_/9;799)@'!%&62`,$49<$`H`PC%ZG"L
+MPS`P#*P";:R1QAQOF#$'PRX4"(*A']>11L$Q?'S&R`Q_K`<(+K3\@AX7O^'O
+MS#37;//-.)=U8(U""C0``!@(="`124B1\]%()ZWTTDPW[?334$<M]=2OD1A0
+MC23^+%#0`1!M--5@ARWVV&27;?;9:*>M]MI,(T*CC0#@&)".//H8`)`]EWC@
+M%%`<$(`O[P`@A10%!!`(%%B$VTX0`P71CM8##6"UT$$2)``51F@0@`,[]OAC
+M&PD(4$$+*)``NNBDDS!$$1P$D$%!KQO43D'MF/$V03<.1+?G=U<^9`"#%WYX
+MX@$LWOCC!4E>$(\%79[YYIW;;7KHHY=^>O4D```'T`4%+7?<"-;]H^]"#N!U
+M\`$DXD03"!Q(1AIR(*XXXP(Y7OE``DPNY/T".:\YY^*[6_0^1[W4`8`0`-!`
+M031@`P,,Q``V&.#=A":D`[#)32[800S0I[XF).!`9D@#&\H@OP"0(A`#"00I
+M^!>0_"V/A0#P'_0"2`()3@]UI=."$2`0`#CH@0`/H$(8>!$07H2!"HQ(X`(;
+M^,`(TI"")5H`$H(P*%PY80D9W"#ATK>^!AP(#6&0`QG8D`8WK*&$)TSA"ING
+MOQ+!4(8`Y-T-L7>]U.F0ASX$HA")"``C4L$0`-A`001I$!M",0`*@%,3K(A%
+M#0INBXU8'P,.-(<\M(&,9BPA,$(QD%``HXTF>F'SIL"$!9"(`"$<(>;^MZ,!
+M^$@`-0R`*V,XQ]2YC9`#P25!ZEBZ0RY`D8R401;1%\DF>!$`E;QD&=<@`TUR
+M4B">!"4HWTC*28(/``.@0QO@L,K-\;*6UBM@Z101R$$>Y'0%^%GV\A:`7V9A
+MD;E:P@R&"<DN4M*2F%S##)S9R4\N;YJC9((#4!20;&Z3``#HI@.^R5!QDB")
+MN@Q(1`7R35\",YXTH&?ABGG,9.:3!OR$IC\)$DJ24I,)/`0`0H.$4&QJDYO/
+M6ZA#&XK#=;+MIDNS7=`(XCW=A4^.Y-/;(X570N/5KQUO!*CE%&I#FF(/`+;C
+MV4!REZ.?2B^H)@+>%H<WO^-!SF=*Q1]3:>A4`^+TK&A-JUK7:A$]M0.15#B$
+M5I,`A2]8*@<Q<!02B@`"#`UA"7U-`A&.P-=<S4D*M0H"J/@*!0P]*E!,`$%C
+MGV`%P;[)8%6``A0$184U06JS4T@"%M;4)K["24YT,AB=%$N%)`R!;VX*PA3X
+M&B@G4"$(0^@LT6@EV2H(`5=3V.N>C``IO@$J"6P:@J.2\`0G&,Q3B-T4A&;+
+M6-\"5[A@RI-MD9L$/8')N8U-0A.HF`406.$)3*A"$_B:)UI)@:Z/&BZD:GO;
+MW'Z7N%(8;VN;ZP*V^O>_``[PS&Y`CBE8(AG;L,8!]JC2!P0$'P4("!,!,.$*
+M.Y#"%[:PA#/,X0U[&,,?UC"(1RSB$G>8Q"<V<8A3S.(5NQC%+U8QC&<LXQJW
+MF,8WMG&,<\SC'?L8QS_6,9"'+.0B]YC(1S9RD)/,Y"4[&<E/5C*4IRSE*C>9
+MRE>V<I2SS.4M>QG+7]8RF,<LYC)WF<QG-G.8T\SF-;L9S6]6,YSG+.<ZMYG.
+M=\:#-MH1C%@T("`(A<$L?E`"`R3B'S<X!!JV48-9Q(XC\-!&`!8A!P%\0,"8
+MSK2F-\WI3GOZTZ`.M:A'3>I2F_K4J$ZUJE?-ZE:[^M6PCK6L9TWK6MOZUKC.
+MM:YWS>M>^_K7P`ZVL(=-[&(;^]C(3K:RE\WL9CO[V=".MK2G3>UJ6_O:V,ZV
+MMK?-[6Y[^]O@#K>XQTWN<IO[W.A.M[K7S>YVN_O=\(ZWO.=-[WK;^][XSK>^
+M]\WO?OO[WP`/N,`'3O""&_S@"$^XPA?.\(8[_.$0C[C$)T[QBEO\XAC/N,8W
+MSO&.>_SC(`^YR$=.\I*;_.0H3[G*5\[REKO\Y3"/N<QG3O.:V_SF.,^YSG?.
+M\Y[[_.=`#[K0AT[THAO]Z$A/NM*7SO2F._WI4(^ZU*=.]:I;_>I8S[K6M\[U
+MKGO]ZV`/N]C'3O:RF_WL:$^[VM?.]K:[_>UPC[O<YT[WNMO][GC/N][WSO>^
+M^_WO@`^\X`=/^,(;_O"(3[SB%\_XQCO^\9"/O.0G3_G*6_[RF,^\YC?/^<Y[
+M_O.@#[WH1T_ZTIO^]*A/O>I7S_K6N_[UL(^][&=/^]K;_O:XS[WN=\_[WOO^
+M]\`/OO"'3_SB&__XR$^^\I?/_.8[__G0C[[TIT_]ZEO_^MC/OO:WS_WN>__[
+MX`^_^,=/_O*;__SH3[_ZU\_^]KO__?"/O_SG3__ZV__^^,^__O?/__[[__\`
+M&(`".(`$6(`&>(`(F(`*N(`,V(`.^(`0&($2.($46($6>($8F($:N($<V($>
+M^($@&((B.((D6((F>((HF((JN((LV((N^((P&(,R.(,T6(,V>(,XF(,ZN(,\
+MV(,^^(-`&(1".(1$6(1&>(1(F(1*N(1,V(1.^(10&(52.(546(56>(58F(5:
+MN(5<V(5>^(5@&(9B.(9D6(9F>(9HF(9JN(9LV(9N^(9P&(=R.(=T6(=V>(=X
+MF(=ZN(=\V(=^^(>`&(B".(B$6(B&>(B(F(B*N(B,V(B.^(B0&(F2.(F46(F6
+@>(F8F(F:N(F<V(F>^(F@&(JB.(JD6(JF>(JHF(JJN'``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_bz2.c
new file mode 100644
index 00000000000..a2c5307b7aa
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_bz2.c
@@ -0,0 +1,134 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Based on libarchive/test/test_read_format_isorr_bz2.c with
+ * bugs introduced by Andreas Henriksson <andreas@fatal.se> for
+ * testing ISO9660 image with Joliet extension.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following to rebuild the data for this program:
+ tail -n +35 test_read_format_isojoliet_bz2.c | /bin/sh
+
+rm -rf /tmp/iso
+mkdir /tmp/iso
+mkdir /tmp/iso/dir
+echo "hello" >/tmp/iso/long-joliet-file-name.textfile
+ln /tmp/iso/long-joliet-file-name.textfile /tmp/iso/hardlink
+(cd /tmp/iso; ln -s long-joliet-file-name.textfile symlink)
+if [ "$(uname -s)" = "Linux" ]; then # gnu coreutils touch doesn't have -h
+TZ=utc touch -afm -t 197001020000.01 /tmp/iso /tmp/iso/long-joliet-file-name.textfile /tmp/iso/dir
+TZ=utc touch -afm -t 197001030000.02 /tmp/iso/symlink
+else
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/long-joliet-file-name.textfile /tmp/iso/dir
+TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink
+fi
+F=test_read_format_iso_joliet.iso.Z
+mkhybrid -J -uid 1 -gid 2 /tmp/iso | compress > $F
+uuencode $F $F > $F.uu
+exit 1
+ */
+
+DEFINE_TEST(test_read_format_isojoliet_bz2)
+{
+ const char *refname = "test_read_format_iso_joliet.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_set_options(a, "iso9660:!rockridge"));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* First entry is '.' root directory. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString(".", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(86401, archive_entry_ctime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(0, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+
+ /* A directory. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+
+ /* A regular file with two names ("hardlink" gets returned
+ * first, so it's not marked as a hardlink). */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("long-joliet-file-name.textfile",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(6, archive_entry_size(ae));
+ assertEqualInt(0, archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(6, (int)size);
+ assertEqualInt(0, offset);
+ assertEqualInt(0, memcmp(p, "hello\n", 6));
+
+ /* Second name for the same regular file (this happens to be
+ * returned second, so does get marked as a hardlink). */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString("long-joliet-file-name.textfile",
+ archive_entry_hardlink(ae));
+ assert(!archive_entry_size_is_set(ae));
+
+ /* A symlink to the regular file. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("symlink", archive_entry_pathname(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_long.c b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_long.c
new file mode 100644
index 00000000000..765cf37f1c2
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_long.c
@@ -0,0 +1,141 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_long.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following to rebuild the data for this program:
+ tail -n +35 test_read_format_isojoliet_long.c | /bin/sh
+
+rm -rf /tmp/iso
+mkdir /tmp/iso
+num=0
+file="";
+while [ $num -lt 100 ]
+do
+ num=$((num+10))
+ file="${file}1234567890"
+done
+dir="${file}dir"
+mkdir /tmp/iso/${dir}
+file="${file}123"
+echo "hello" > /tmp/iso/${file}
+ln /tmp/iso/${file} /tmp/iso/hardlink
+if [ "$(uname -s)" = "Linux" ]; then # gnu coreutils touch doesn't have -h
+TZ=utc touch -afm -t 197001020000.01 /tmp/iso /tmp/iso/${file} /tmp/iso/${dir}
+else
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/${file} /tmp/iso/${dir}
+fi
+F=test_read_format_iso_joliet_long.iso.Z
+mkhybrid -J -joliet-long -uid 1 -gid 2 /tmp/iso | compress > $F
+uuencode $F $F > $F.uu
+rm -rf /tmp/iso
+exit 1
+ */
+
+DEFINE_TEST(test_read_format_isojoliet_long)
+{
+ const char *refname = "test_read_format_iso_joliet_long.iso.Z";
+ char pathname[104];
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ for (i = 0; i < 100; i++)
+ pathname[i] = '0' + ((i+1) % 10);
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_set_options(a, "iso9660:!rockridge"));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* First entry is '.' root directory. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString(".", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(86401, archive_entry_ctime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(0, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+
+ /* A directory. */
+ pathname[100] = 'd';
+ pathname[101] = 'i';
+ pathname[102] = 'r';
+ pathname[103] = '\0';
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString(pathname, archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+
+ /* A regular file with two names (pathname gets returned
+ * first, so it's not marked as a hardlink). */
+ pathname[100] = '1';
+ pathname[101] = '2';
+ pathname[102] = '3';
+ pathname[103] = '\0';
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString(pathname, archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(6, archive_entry_size(ae));
+ assertEqualInt(0, archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(6, (int)size);
+ assertEqualInt(0, offset);
+ assertEqualInt(0, memcmp(p, "hello\n", 6));
+
+ /* Second name for the same regular file (this happens to be
+ * returned second, so does get marked as a hardlink). */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString(pathname, archive_entry_hardlink(ae));
+ assert(!archive_entry_size_is_set(ae));
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_rr.c b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_rr.c
new file mode 100644
index 00000000000..365f8e7a8de
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isojoliet_rr.c
@@ -0,0 +1,159 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Based on libarchive/test/test_read_format_isorr_bz2.c with
+ * bugs introduced by Andreas Henriksson <andreas@fatal.se> for
+ * testing ISO9660 image with Joliet extension.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_rr.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following to rebuild the data for this program:
+ tail -n +35 test_read_format_isojoliet_rr.c | /bin/sh
+
+rm -rf /tmp/iso
+mkdir /tmp/iso
+mkdir /tmp/iso/dir
+file="long-joliet-file-name.textfile"
+echo "hello" >/tmp/iso/$file
+ln /tmp/iso/$file /tmp/iso/hardlink
+(cd /tmp/iso; ln -s $file symlink)
+if [ "$(uname -s)" = "Linux" ]; then # gnu coreutils touch doesn't have -h
+TZ=utc touch -afm -t 197001020000.01 /tmp/iso/hardlink /tmp/iso/$file /tmp/iso/dir
+TZ=utc touch -afm -t 197001030000.02 /tmp/iso/symlink
+TZ=utc touch -afm -t 197001020000.01 /tmp/iso
+else
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso/hardlink /tmp/iso/$file /tmp/iso/dir
+TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso
+fi
+F=test_read_format_iso_joliet_rockridge.iso.Z
+mkhybrid -J -uid 1 -gid 2 /tmp/iso | compress > $F
+uuencode $F $F > $F.uu
+exit 1
+ */
+
+DEFINE_TEST(test_read_format_isojoliet_rr)
+{
+ const char *refname = "test_read_format_iso_joliet_rockridge.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* First entry is '.' root directory. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString(".", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+
+ /* A directory. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+
+ /* A regular file with two names ("hardlink" gets returned
+ * first, so it's not marked as a hardlink). */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("long-joliet-file-name.textfile",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(6, archive_entry_size(ae));
+ assertEqualInt(0, archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(6, (int)size);
+ assertEqualInt(0, offset);
+ assertEqualInt(0, memcmp(p, "hello\n", 6));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ /* mkisofs records their access time. */
+ /*assertEqualInt(86401, archive_entry_atime(ae));*/
+ /* TODO: Actually, libarchive should be able to
+ * compute nlinks correctly even without RR
+ * extensions. See comments in libarchive source. */
+ assertEqualInt(2, archive_entry_nlink(ae));
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+
+ /* Second name for the same regular file (this happens to be
+ * returned second, so does get marked as a hardlink). */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString("long-joliet-file-name.textfile",
+ archive_entry_hardlink(ae));
+ assert(!archive_entry_size_is_set(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ /* TODO: See above. */
+ assertEqualInt(2, archive_entry_nlink(ae));
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+
+ /* A symlink to the regular file. */
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+ assertEqualString("symlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("long-joliet-file-name.textfile",
+ archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_nlink(ae));
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
index 5457c7fd96f..cb5a969d621 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
@@ -23,119 +23,181 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_isorr_bz2.c,v 1.4 2008/06/21 19:11:51 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
-Execute the following to rebuild the data for this program:
- tail -n +32 test_read_format_isorr_bz2.c | /bin/sh
+PLEASE use old cdrtools; mkisofs verion is 2.01.
+This version mkisofs made wrong "SL" System Use Entry of RRIP.
+
+Execute the following command to rebuild the data for this program:
+ tail -n +34 test_read_format_isorr_bz2.c | /bin/sh
rm -rf /tmp/iso
mkdir /tmp/iso
mkdir /tmp/iso/dir
echo "hello" >/tmp/iso/file
+dd if=/dev/zero count=1 bs=12345678 >>/tmp/iso/file
ln /tmp/iso/file /tmp/iso/hardlink
(cd /tmp/iso; ln -s file symlink)
+(cd /tmp/iso; ln -s /tmp/ symlink2)
+(cd /tmp/iso; ln -s /tmp/../ symlink3)
+(cd /tmp/iso; ln -s .././../tmp/ symlink4)
+(cd /tmp/iso; ln -s .///file symlink5)
+(cd /tmp/iso; ln -s /tmp//../ symlink6)
TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/file /tmp/iso/dir
-TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink
-mkhybrid -R -uid 1 -gid 2 /tmp/iso | bzip2 > test_read_format_isorr_bz2.iso.bz2
-F=test_read_format_isorr_bz2.iso.bz2
+TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink /tmp/iso/symlink5
+F=test_read_format_iso_rockridge.iso.Z
+mkhybrid -R -uid 1 -gid 2 /tmp/iso | compress > $F
uuencode $F $F > $F.uu
exit 1
*/
DEFINE_TEST(test_read_format_isorr_bz2)
{
- const char *refname = "test_read_format_isorr_bz2.iso.bz2";
+ const char *refname = "test_read_format_iso_rockridge.iso.Z";
struct archive_entry *ae;
struct archive *a;
const void *p;
size_t size;
off_t offset;
+ int i;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualInt(0, archive_read_support_compression_all(a));
assertEqualInt(0, archive_read_support_format_all(a));
- assertEqualInt(0, archive_read_open_filename(a, refname, 10240));
-
- /* First entry is '.' root directory. */
- assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString(".", archive_entry_pathname(ae));
- assert(S_ISDIR(archive_entry_stat(ae)->st_mode));
- assertEqualInt(2048, archive_entry_size(ae));
- assertEqualInt(86401, archive_entry_mtime(ae));
- assertEqualInt(0, archive_entry_mtime_nsec(ae));
- assertEqualInt(86401, archive_entry_ctime(ae));
- assertEqualInt(0, archive_entry_stat(ae)->st_nlink);
- assertEqualInt(0, archive_entry_uid(ae));
- assertEqualIntA(a, ARCHIVE_EOF,
- archive_read_data_block(a, &p, &size, &offset));
- assertEqualInt(size, 0);
-
- /* A directory. */
- assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString("dir", archive_entry_pathname(ae));
- assert(S_ISDIR(archive_entry_stat(ae)->st_mode));
- assertEqualInt(2048, archive_entry_size(ae));
- assertEqualInt(86401, archive_entry_mtime(ae));
- assertEqualInt(86401, archive_entry_atime(ae));
- assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
- assertEqualInt(1, archive_entry_uid(ae));
- assertEqualInt(2, archive_entry_gid(ae));
-
- /* A regular file. */
- assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString("file", archive_entry_pathname(ae));
- assert(S_ISREG(archive_entry_stat(ae)->st_mode));
- assertEqualInt(6, archive_entry_size(ae));
- assertEqualInt(0, archive_read_data_block(a, &p, &size, &offset));
- assertEqualInt(6, size);
- assertEqualInt(0, offset);
- assertEqualInt(0, memcmp(p, "hello\n", 6));
- assertEqualInt(86401, archive_entry_mtime(ae));
- assertEqualInt(86401, archive_entry_atime(ae));
- assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
- assertEqualInt(1, archive_entry_uid(ae));
- assertEqualInt(2, archive_entry_gid(ae));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
- /* A hardlink to the regular file. */
- assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString("hardlink", archive_entry_pathname(ae));
- assert(S_ISREG(archive_entry_stat(ae)->st_mode));
- assertEqualString("file", archive_entry_hardlink(ae));
- assertEqualInt(6, archive_entry_size(ae));
- assertEqualInt(86401, archive_entry_mtime(ae));
- assertEqualInt(86401, archive_entry_atime(ae));
- assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
- assertEqualInt(1, archive_entry_uid(ae));
- assertEqualInt(2, archive_entry_gid(ae));
+ /* Retrieve each of the 8 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 10; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
- /* A symlink to the regular file. */
- assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString("symlink", archive_entry_pathname(ae));
- assert(S_ISLNK(archive_entry_stat(ae)->st_mode));
- assertEqualString("file", archive_entry_symlink(ae));
- assertEqualInt(0, archive_entry_size(ae));
- assertEqualInt(172802, archive_entry_mtime(ae));
- assertEqualInt(172802, archive_entry_atime(ae));
- assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
- assertEqualInt(1, archive_entry_uid(ae));
- assertEqualInt(2, archive_entry_gid(ae));
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ /* Now, we read timestamp recorded by RRIP "TF". */
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ /* Now, we read links recorded by RRIP "PX". */
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("dir", archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(12345684, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello\n", 6);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
+ /* A hardlink to the regular file. */
+ /* Note: If "hardlink" gets returned before "file",
+ * then "hardlink" will get returned as a regular file
+ * and "file" will get returned as the hardlink.
+ * This test should tolerate that, since it's a
+ * perfectly permissible thing for libarchive to do. */
+ assertEqualString("file", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString("hardlink", archive_entry_hardlink(ae));
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("file", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink2", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp (an absolute path) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink3", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp/.. (with a ".." component) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp/..", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink4", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to a path with ".." and "." components */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(".././../tmp",
+ archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink5", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file with "/" components. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(".///file", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink6", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp//..
+ * (with "/" and ".." components) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp//..", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
/* End of archive. */
assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
- assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2);
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
/* Close the archive. */
assertEqualInt(0, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
assertEqualInt(0, archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_ce.c b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_ce.c
new file mode 100644
index 00000000000..71bce93dfe9
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_ce.c
@@ -0,0 +1,223 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_ce.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following command to rebuild the data for this program:
+ tail -n +32 test_read_format_isorr_ce.c | /bin/sh
+
+dirname=/tmp/iso
+#
+rm -rf $dirname
+mkdir $dirname
+#
+num=0
+file=""
+while [ $num -lt 150 ]
+do
+ num=$((num+1))
+ file="a$file"
+done
+#
+num=0
+while [ $num -lt 3 ]
+do
+ num=$((num+1))
+ file="a$file"
+ echo "hello $((num+150))" > $dirname/$file
+ dd if=/dev/zero count=1 bs=4080 >> $dirname/$file
+ (cd $dirname; ln -s $file sym$num)
+done
+#
+mkdir $dirname/dir
+#
+time1="197001020000.01"
+time2="197001030000.02"
+TZ=utc touch -afhm -t $time1 $dirname/dir $dirname/aaaa*
+TZ=utc touch -afhm -t $time2 $dirname/sym*
+TZ=utc touch -afhm -t $time1 $dirname
+#
+F=test_read_format_iso_rockridge_ce.iso.Z
+mkisofs -R -uid 1 -gid 2 $dirname | compress > $F
+uuencode $F $F > $F.uu
+rm -rf $dirname
+exit 1
+ */
+
+/*
+ * Test reading SUSP "CE" extension is works fine.
+ */
+
+static void
+mkpath(char *p, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ p[i] = 'a';
+ p[len] = '\0';
+}
+
+DEFINE_TEST(test_read_format_isorr_ce)
+{
+ const char *refname = "test_read_format_iso_rockridge_ce.iso.Z";
+ char path1[160];
+ char path2[160];
+ char path3[160];
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ mkpath(path1, 151);
+ mkpath(path2, 152);
+ mkpath(path3, 153);
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Retrieve each of the 8 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 8; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ /* Now, we read timestamp recorded by RRIP "TF". */
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ /* Now, we read links recorded by RRIP "PX". */
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("dir", archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp(path1, archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString(path1, archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(4090, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello 151\n", 10);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp(path2, archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString(path2, archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(4090, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello 152\n", 10);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp(path3, archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString(path3, archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(4090, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello 153\n", 10);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("sym1", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(path1, archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("sym2", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(path2, archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("sym3", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(path3, archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_new_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_new_bz2.c
new file mode 100644
index 00000000000..633959af96d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_new_bz2.c
@@ -0,0 +1,204 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_new_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+
+/*
+PLEASE use latest cdrtools at least mkisofs version is 2.01.01a63 or later.
+Old version mkisofs made wrong "SL" System Use Entry of RRIP.
+
+Execute the following command to rebuild the data for this program:
+ tail -n +34 test_read_format_isorr_new_bz2.c | /bin/sh
+
+rm -rf /tmp/iso
+mkdir /tmp/iso
+mkdir /tmp/iso/dir
+echo "hello" >/tmp/iso/file
+dd if=/dev/zero count=1 bs=12345678 >>/tmp/iso/file
+ln /tmp/iso/file /tmp/iso/hardlink
+(cd /tmp/iso; ln -s file symlink)
+(cd /tmp/iso; ln -s /tmp/ symlink2)
+(cd /tmp/iso; ln -s /tmp/../ symlink3)
+(cd /tmp/iso; ln -s .././../tmp/ symlink4)
+(cd /tmp/iso; ln -s .///file symlink5)
+(cd /tmp/iso; ln -s /tmp//../ symlink6)
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/file /tmp/iso/dir
+TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink
+F=test_read_format_iso_rockridge_new.iso.Z
+mkhybrid -R -uid 1 -gid 2 /tmp/iso | compress > $F
+uuencode $F $F > $F.uu
+exit 1
+ */
+
+DEFINE_TEST(test_read_format_isorr_new_bz2)
+{
+ const char *refname = "test_read_format_iso_rockridge_new.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Retrieve each of the 8 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 10; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ /* Now, we read timestamp recorded by RRIP "TF". */
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ /* Now, we read links recorded by RRIP "PX". */
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("dir", archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(12345684, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello\n", 6);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
+ /* A hardlink to the regular file. */
+ /* Note: If "hardlink" gets returned before "file",
+ * then "hardlink" will get returned as a regular file
+ * and "file" will get returned as the hardlink.
+ * This test should tolerate that, since it's a
+ * perfectly permissible thing for libarchive to do. */
+ assertEqualString("file", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString("hardlink", archive_entry_hardlink(ae));
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("file", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink2", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp/ (an absolute path) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp/", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink3", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp/../ (with a ".." component) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp/../", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink4", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to a path with ".." and "." components */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(".././../tmp/",
+ archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink5", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file with "/" components. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(".///file", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink6", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp//../
+ * (with "/" and ".." components) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp//../", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_rr_moved.c b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_rr_moved.c
new file mode 100644
index 00000000000..d59b3464030
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_rr_moved.c
@@ -0,0 +1,270 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_rr_moved.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following command to rebuild the data for this program:
+ tail -n +32 test_read_format_isorr_rr_moved.c | /bin/sh
+
+dirname=/tmp/iso
+rm -rf $dirname
+mkdir -p $dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10
+echo "hello" >$dirname/file
+dd if=/dev/zero count=1 bs=12345678 >>$dirname/file
+deepfile=$dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10/deep
+echo "hello" >$deepfile
+dd if=/dev/zero count=1 bs=12345678 >>$deepfile
+time="197001020000.01"
+TZ=utc touch -afhm -t $time $deepfile
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5/dir6/dir7
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5/dir6
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4/dir5
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3/dir4
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2/dir3
+TZ=utc touch -afhm -t $time $dirname/dir1/dir2
+TZ=utc touch -afhm -t $time $dirname/dir1
+TZ=utc touch -afhm -t $time $dirname/file
+TZ=utc touch -afhm -t $time $dirname
+F=test_read_format_isorr_rockridge_moved.iso.Z
+mkhybrid -R -uid 1 -gid 2 $dirname | compress > $F
+uuencode $F $F > $F.uu
+exit 1
+ */
+
+DEFINE_TEST(test_read_format_isorr_rr_moved)
+{
+ const char *refname = "test_read_format_iso_rockridge_rr_moved.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Retrieve each of the 8 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 13; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ /* Now, we read timestamp recorded by RRIP "TF". */
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ /* Now, we read links recorded by RRIP "PX". */
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("dir1", archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6/dir7",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6/dir7",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9/dir10",
+ archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9/dir10",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString("file", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(12345684, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello\n", 6);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9/dir10/deep",
+ archive_entry_pathname(ae)) == 0) {
+ /* A regular file. */
+ assertEqualString("dir1/dir2/dir3/dir4/dir5/dir6/dir7"
+ "/dir8/dir9/dir10/deep",
+ archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(12345684, archive_entry_size(ae));
+ assertEqualInt(0,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello\n", 6);
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isozisofs_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_isozisofs_bz2.c
new file mode 100644
index 00000000000..05271cdd89e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isozisofs_bz2.c
@@ -0,0 +1,187 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isozisofs_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+Execute the following command to rebuild the data for this program:
+ tail -n +32 test_read_format_isozisofs_bz2.c | /bin/sh
+
+rm -rf /tmp/iso /tmp/ziso
+mkdir /tmp/iso
+mkdir /tmp/iso/dir
+echo "hello" >/tmp/iso/file
+dd if=/dev/zero count=1 bs=12345678 >>/tmp/iso/file
+ln /tmp/iso/file /tmp/iso/hardlink
+(cd /tmp/iso; ln -s file symlink)
+(cd /tmp/iso; ln -s /tmp/ symlink2)
+(cd /tmp/iso; ln -s /tmp/../ symlink3)
+(cd /tmp/iso; ln -s .././../tmp/ symlink4)
+TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/file /tmp/iso/dir
+TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink
+mkzftree /tmp/iso /tmp/ziso
+TZ=utc touch -afhm -t 197001020000.01 /tmp/ziso /tmp/ziso/file /tmp/ziso/dir
+TZ=utc touch -afhm -t 197001030000.02 /tmp/ziso/symlink
+F=test_read_format_iso_zisofs.iso.Z
+mkhybrid -R -uid 1 -gid 2 -z /tmp/ziso | compress > $F
+uuencode $F $F > $F.uu
+exit 1
+
+ */
+
+DEFINE_TEST(test_read_format_isozisofs_bz2)
+{
+ const char *refname = "test_read_format_iso_zisofs.iso.Z";
+ struct archive_entry *ae;
+ struct archive *a;
+ const void *p;
+ size_t size;
+ off_t offset;
+ int i;
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_compression_all(a));
+ assertEqualInt(0, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Retrieve each of the 8 files on the ISO image and
+ * verify that each one is what we expect. */
+ for (i = 0; i < 8; ++i) {
+ assertEqualInt(0, archive_read_next_header(a, &ae));
+
+ if (strcmp(".", archive_entry_pathname(ae)) == 0) {
+ /* '.' root directory. */
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ /* Now, we read timestamp recorded by RRIP "TF". */
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ /* Now, we read links recorded by RRIP "PX". */
+ assertEqualInt(3, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &p, &size, &offset));
+ assertEqualInt((int)size, 0);
+ } else if (strcmp("dir", archive_entry_pathname(ae)) == 0) {
+ /* A directory. */
+ assertEqualString("dir", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) {
+ int r;
+ /* A regular file. */
+ assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualInt(12345684, archive_entry_size(ae));
+ r = archive_read_data_block(a, &p, &size, &offset);
+ if (r == ARCHIVE_FAILED) {
+ skipping("Can't read body of ZISOFS entry.");
+ } else {
+ assertEqualInt(ARCHIVE_OK, r);
+ assertEqualInt(0, offset);
+ assertEqualMem(p, "hello\n", 6);
+ }
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
+ /* A hardlink to the regular file. */
+ /* Note: If "hardlink" gets returned before "file",
+ * then "hardlink" will get returned as a regular file
+ * and "file" will get returned as the hardlink.
+ * This test should tolerate that, since it's a
+ * perfectly permissible thing for libarchive to do. */
+ assertEqualString("file", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
+ assertEqualString("hardlink", archive_entry_hardlink(ae));
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(86401, archive_entry_atime(ae));
+ assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to the regular file. */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("file", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(172802, archive_entry_mtime(ae));
+ assertEqualInt(172802, archive_entry_atime(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink2", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp (an absolute path) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink3", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to /tmp/.. (with a ".." component) */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString("/tmp/..", archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else if (strcmp("symlink4", archive_entry_pathname(ae)) == 0) {
+ /* A symlink to a path with ".." and "." components */
+ assertEqualInt(AE_IFLNK, archive_entry_filetype(ae));
+ assertEqualString(".././../tmp",
+ archive_entry_symlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1, archive_entry_stat(ae)->st_nlink);
+ assertEqualInt(1, archive_entry_uid(ae));
+ assertEqualInt(2, archive_entry_gid(ae));
+ } else {
+ failure("Saw a file that shouldn't have been there");
+ assertEqualString(archive_entry_pathname(ae), "");
+ }
+ }
+
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE);
+
+ /* Close the archive. */
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
index 954f0222ad1..ce6e92086dc 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
@@ -23,58 +23,61 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_mtree.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $");
-
-/* Single entry with a hardlink. */
-static unsigned char archive[] = {
- "#mtree\n"
- "file type=file uid=18 mode=0123\n"
- "dir type=dir\n"
- " file\\040with\\040space type=file uid=18\n"
- " ..\n"
- "file\\04with\\040space type=file\n"
- "dir2 type=dir\n"
- " dir3a type=dir\n"
- " indir3a type=file\n"
- "dir2/fullindir2 type=file mode=0777\n"
- " ..\n"
- " indir2 type=file\n"
- " dir3b type=dir\n"
- " indir3b type=file\n"
- " ..\n"
- " ..\n"
- "notindir type=file\n"
- "dir2/fullindir2 mode=0644\n"
-};
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_mtree.c 201247 2009-12-30 05:59:21Z kientzle $");
-DEFINE_TEST(test_read_format_mtree)
+static void
+test_read_format_mtree1(void)
{
+ const char reffile[] = "test_read_format_mtree.mtree";
+ char buff[16];
struct archive_entry *ae;
struct archive *a;
+ FILE *f;
+
+ extract_reference_file(reffile);
+
+ /*
+ * An access error occurred on some platform when mtree
+ * format handling open a directory. It is for through
+ * the routine which open a directory that we create
+ * "dir" and "dir2" directories.
+ */
+ assertMakeDir("dir", 0775);
+ assertMakeDir("dir2", 0775);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_compression_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_format_all(a));
- assertEqualIntA(a, ARCHIVE_OK,
- archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_file(a, reffile, 11));
+
+ /*
+ * Read "file", whose data is available on disk.
+ */
+ f = fopen("file", "wb");
+ assert(f != NULL);
+ assertEqualInt(3, fwrite("hi\n", 1, 3, f));
+ fclose(f);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt(archive_format(a), ARCHIVE_FORMAT_MTREE_V1);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_MTREE);
assertEqualString(archive_entry_pathname(ae), "file");
assertEqualInt(archive_entry_uid(ae), 18);
- assert(S_ISREG(archive_entry_mode(ae)));
+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0123);
+ assertEqualInt(archive_entry_size(ae), 3);
+ assertEqualInt(3, archive_read_data(a, buff, 3));
+ assertEqualMem(buff, "hi\n", 3);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(archive_entry_pathname(ae), "dir");
- assert(S_ISDIR(archive_entry_mode(ae)));
+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(archive_entry_pathname(ae), "dir/file with space");
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualString(archive_entry_pathname(ae), "file\\04with space");
+ assertEqualString(archive_entry_pathname(ae), "file with space");
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(archive_entry_pathname(ae), "dir2");
@@ -103,11 +106,38 @@ DEFINE_TEST(test_read_format_mtree)
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
}
+static void
+test_read_format_mtree2(void)
+{
+ static char archive[] =
+ "#mtree\n"
+ "d type=dir content=.\n";
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_MTREE);
+ assertEqualString(archive_entry_pathname(ae), "d");
+ assertEqualInt(archive_entry_filetype(ae), AE_IFDIR);
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_read_format_mtree)
+{
+ test_read_format_mtree1();
+ test_read_format_mtree2();
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_mtree.mtree.uu b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.mtree.uu
new file mode 100644
index 00000000000..1634d0015f5
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.mtree.uu
@@ -0,0 +1,13 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_mtree.mtree.uu 201247 2009-12-30 05:59:21Z kientzle $
+
+begin 644 test_read_format_mtree.mtree
+M(VUT<F5E"F9I;&4@='EP93UF:6QE('5I9#TQ."!M;V1E/3`Q,C,@<VEZ93TS
+M"F1I<B!T>7!E/61I<@H@9FEL95PP-#!W:71H7#`T,'-P86-E('1Y<&4]9FEL
+M92!U:60],3@*("XN"F9I;&5<,#0P=VET:%PP-#!S<&%C92!T>7!E/69I;&4*
+M9&ER,B!T>7!E/61I<@H@9&ER,V$@='EP93UD:7(*("!I;F1I<C-A('1Y<&4]
+M9FEL90ID:7(R+V9U;&QI;F1I<C(@='EP93UF:6QE(&UO9&4],#<W-PH@("XN
+M"B!I;F1I<C(@='EP93UF:6QE"B!D:7(S8B!T>7!E/61I<@H@(&EN9&ER,V(@
+M='EP93UF:6QE"B`@+BX*("XN"FYO=&EN9&ER('1Y<&4]9FEL90ID:7(R+V9U
+3;&QI;F1I<C(@;6]D93TP-C0T"@``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_pax_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_pax_bz2.c
index 186d5f9d5ba..af70b366308 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_pax_bz2.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_pax_bz2.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_pax_bz2.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_pax_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',152,180,30,185,0,0,140,127,176,212,
@@ -44,19 +44,23 @@ DEFINE_TEST(test_read_format_pax_bz2)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2);
- assert(archive_format(a) == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ r = archive_read_support_compression_bzip2(a);
+ if (r != ARCHIVE_OK) {
+ archive_read_close(a);
+ skipping("Bzip2 unavailable");
+ return;
+ }
+ assertEqualIntA(a,ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a,ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a,ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE);
+ assertEqualIntA(a,ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_raw.c b/archivers/libarchive/files/libarchive/test/test_read_format_raw.c
new file mode 100644
index 00000000000..cd5f00ee1bf
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_raw.c
@@ -0,0 +1,89 @@
+/*-
+ * Copyright (c) 2007 Kai Wang
+ * Copyright (c) 2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_raw.c 191594 2009-04-27 20:09:05Z kientzle $");
+
+DEFINE_TEST(test_read_format_raw)
+{
+ char buff[512];
+ struct archive_entry *ae;
+ struct archive *a;
+ const char *reffile1 = "test_read_format_raw.data";
+ const char *reffile2 = "test_read_format_raw.data.Z";
+
+ /* First, try pulling data out of an uninterpretable file. */
+ extract_reference_file(reffile1);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, reffile1, 512));
+
+ /* First (and only!) Entry */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualString("data", archive_entry_pathname(ae));
+ /* Most fields should be unset (unknown) */
+ assert(!archive_entry_size_is_set(ae));
+ assert(!archive_entry_atime_is_set(ae));
+ assert(!archive_entry_ctime_is_set(ae));
+ assert(!archive_entry_mtime_is_set(ae));
+ assertEqualInt(4, archive_read_data(a, buff, 32));
+ assertEqualMem(buff, "foo\n", 4);
+
+ /* Test EOF */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+
+ /* Second, try the same with a compressed file. */
+ extract_reference_file(reffile2);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, reffile2, 1));
+
+ /* First (and only!) Entry */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualString("data", archive_entry_pathname(ae));
+ /* Most fields should be unset (unknown) */
+ assert(!archive_entry_size_is_set(ae));
+ assert(!archive_entry_atime_is_set(ae));
+ assert(!archive_entry_ctime_is_set(ae));
+ assert(!archive_entry_mtime_is_set(ae));
+ assertEqualInt(4, archive_read_data(a, buff, 32));
+ assertEqualMem(buff, "foo\n", 4);
+
+ /* Test EOF */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.Z.uu b/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.Z.uu
new file mode 100644
index 00000000000..eff01d3799e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.Z.uu
@@ -0,0 +1,5 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_raw.data.Z.uu 191594 2009-04-27 20:09:05Z kientzle $
+begin 644 test_read_format_raw.data.Z
+('YV09MZ\40``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.uu b/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.uu
new file mode 100644
index 00000000000..e88da003fb4
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_raw.data.uu
@@ -0,0 +1,5 @@
+$FreeBSD: head/lib/libarchive/test/test_read_format_raw.data.uu 191594 2009-04-27 20:09:05Z kientzle $
+begin 644 test_read_format_raw.data
+$9F]O"@``
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
index 1de08495ca9..9c197df0946 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.3 2008/01/13 23:50:30 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tar.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Each of these archives is a short archive with a single entry. The
@@ -71,14 +71,15 @@ static void verifyEmpty(void)
assertA(0 == archive_read_open_memory(a, archiveEmpty, 512));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualString(archive_compression_name(a), "none");
failure("512 zero bytes should be recognized as a tar archive.");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
@@ -100,9 +101,9 @@ static unsigned char archive1[] = {
static void verify1(struct archive_entry *ae)
{
/* A hardlink is not a symlink. */
- assert(!S_ISLNK(archive_entry_mode(ae)));
+ assert(archive_entry_filetype(ae) != AE_IFLNK);
/* Nor is it a directory. */
- assert(!S_ISDIR(archive_entry_mode(ae)));
+ assert(archive_entry_filetype(ae) != AE_IFDIR);
assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -131,7 +132,7 @@ static unsigned char archive2[] = {
static void verify2(struct archive_entry *ae)
{
- assert(S_ISLNK(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFLNK);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -160,7 +161,7 @@ static unsigned char archive3[] = {
static void verify3(struct archive_entry *ae)
{
- assert(S_ISCHR(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFCHR);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -189,7 +190,7 @@ static unsigned char archive4[] = {
static void verify4(struct archive_entry *ae)
{
- assert(S_ISBLK(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFBLK);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -218,7 +219,7 @@ static unsigned char archive5[] = {
static void verify5(struct archive_entry *ae)
{
- assert(S_ISDIR(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFDIR);
assertEqualInt(archive_entry_mtime(ae), 1131430878);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
@@ -244,7 +245,7 @@ static unsigned char archive6[] = {
static void verify6(struct archive_entry *ae)
{
- assert(S_ISFIFO(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFIFO);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -315,7 +316,7 @@ static unsigned char archiveK[] = {
static void verifyK(struct archive_entry *ae)
{
- assert(S_ISLNK(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFLNK);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -401,7 +402,7 @@ static unsigned char archivexL[] = {
static void verifyxL(struct archive_entry *ae)
{
- assert(S_ISLNK(archive_entry_mode(ae)));
+ assertEqualInt(archive_entry_filetype(ae), AE_IFLNK);
assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
assertEqualInt(archive_entry_uid(ae), 1000);
assertEqualInt(archive_entry_gid(ae), 1000);
@@ -447,10 +448,10 @@ static void verify(unsigned char *d, size_t s,
f(ae);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
free(buff);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.c b/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.c
index d9ba69bd93c..8d917144448 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar_empty_filename.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/*
* Tar entries with empty filenames are unusual, but shouldn't crash us.
@@ -58,9 +58,9 @@ DEFINE_TEST(test_read_format_tar_empty_filename)
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.tar.uu
index 7a34c82ca6b..f8a4f4f2f1b 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.tar.uu
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_filename.tar.uu
@@ -1,3 +1,4 @@
+$FreeBSD: src/lib/libarchive/test/test_read_format_tar_empty_filename.tar.uu,v 1.2 2008/07/03 03:26:30 peter Exp $
begin 644 test_compat_tar_1.tar
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tbz.c b/archivers/libarchive/files/libarchive/test/test_read_format_tbz.c
index 3d135eb6df6..06d8cad4798 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tbz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tbz.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tbz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tbz.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',237,7,140,'W',0,0,27,251,144,208,
@@ -37,19 +37,23 @@ DEFINE_TEST(test_read_format_tbz)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2);
- assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ r = archive_read_support_compression_bzip2(a);
+ if (r != ARCHIVE_OK) {
+ skipping("Bzip2 support");
+ archive_read_finish(a);
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tgz.c b/archivers/libarchive/files/libarchive/test/test_read_format_tgz.c
index ce61aa67971..f411b433802 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tgz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tgz.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tgz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tgz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U',
@@ -36,19 +36,25 @@ DEFINE_TEST(test_read_format_tgz)
{
struct archive_entry *ae;
struct archive *a;
+ int r;
+
assert((a = archive_read_new()) != NULL);
- assert(0 == archive_read_support_compression_all(a));
- assert(0 == archive_read_support_format_all(a));
- assert(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assert(0 == archive_read_next_header(a, &ae));
- assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP);
- assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualInt(ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK,archive_read_finish(a));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tlz.c b/archivers/libarchive/files/libarchive/test/test_read_format_tlz.c
new file mode 100644
index 00000000000..7dd09a0c518
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tlz.c
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tlz.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+static unsigned char archive[] = {
+ 93, 0, 0,128, 0,255,255,255,255,255,255,255,255, 0, 23, 0,
+ 51, 80, 24,164,204,238, 45, 77, 28,191, 13,144, 8, 10, 70, 5,
+173,215, 47,132,237,145,162, 96, 6,131,168,152, 8,135,161,189,
+ 73,110,132, 27,195, 52,109,203, 22, 17,168,211, 18,181, 76, 93,
+120, 88,154,155,244,141,193,206,170,224, 80,137,134, 67, 1, 9,
+123,121,189, 74,137,197, 63,255,214, 55,119, 0
+};
+
+DEFINE_TEST(test_read_format_tlz)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_txz.c b/archivers/libarchive/files/libarchive/test/test_read_format_txz.c
new file mode 100644
index 00000000000..acff175c56f
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_txz.c
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_txz.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+static unsigned char archive[] = {
+253, 55,122, 88, 90, 0, 0, 4,230,214,180, 70, 2, 0, 33, 1,
+ 22, 0, 0, 0,116, 47,229,163,224, 5,255, 0, 73, 93, 0, 23,
+ 0, 51, 80, 24,164,204,238, 45, 77, 28,191, 13,144, 8, 10, 70,
+ 5,173,215, 47,132,237,145,162, 96, 6,131,168,152, 8,135,161,
+189, 73,110,132, 27,195, 52,109,203, 22, 17,168,211, 18,181, 76,
+ 93,120, 88,154,155,244,141,193,206,170,224, 80,137,134, 67, 1,
+ 9,123,121,188,247, 28,139, 0, 0, 0, 0, 0,112,184, 17, 5,
+103, 16, 8, 73, 0, 1,101,128, 12, 0, 0, 0, 30, 69, 92, 96,
+177,196,103,251, 2, 0, 0, 0, 0, 4, 89, 90
+};
+
+DEFINE_TEST(test_read_format_txz)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xz reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tz.c b/archivers/libarchive/files/libarchive/test/test_read_format_tz.c
index 337b96dfc17..eb066013842 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tz.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tz.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tz.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tz.c 189381 2009-03-05 00:31:48Z kientzle $");
static unsigned char archive[] = {
31,157,144,'.',0,8,28,'H',176,160,193,131,8,19,'*','\\',200,176,'!','B',24,
@@ -39,17 +39,22 @@ DEFINE_TEST(test_read_format_tz)
struct archive_entry *ae;
struct archive *a;
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_memory(a, archive, sizeof(archive)));
- assertA(0 == archive_read_next_header(a, &ae));
- assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS);
- assertA(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ failure("archive_compression_name(a)=\"%s\"",
+ archive_compression_name(a));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS);
+ failure("archive_format_name(a)=\"%s\"", archive_format_name(a));
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_xar.c b/archivers/libarchive/files/libarchive/test/test_read_format_xar.c
new file mode 100644
index 00000000000..a6966776081
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_xar.c
@@ -0,0 +1,697 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+#define UID 1001
+#define UNAME "cue"
+#define GID 1001
+#define GNAME "cue"
+
+/* Verify that a file records with hardlink.
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+ln f1 hardlink
+chown $UNAME:$GNAME hardlink
+chmod 0644 hardlink
+env TZ=utc touch -afm -t 197001020000.01 f1 hardlink
+xar -cf archive1.xar f1 hardlink
+od -t x1 archive1.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive1.xar.txt
+*/
+static unsigned char archive1[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc6,
+0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x70,0x00,0x00,0x00,0x01,0x78,0xda,0xc4,0x54,
+0xc9,0x6e,0xdb,0x30,0x14,0xbc,0xe7,0x2b,0x08,0xdd,0x55,0xae,0xb6,0x45,0x83,0x56,
+0xd0,0x4b,0xd1,0x7b,0xd3,0x4b,0x6f,0x34,0x17,0x89,0x88,0x36,0x48,0x54,0xe0,0xe4,
+0xeb,0x4b,0x52,0x52,0x0c,0xa7,0x71,0x6f,0x45,0x01,0x01,0x1a,0x0e,0x87,0xa3,0xa7,
+0xf7,0x06,0x14,0x8f,0x97,0xb6,0x01,0x2f,0x66,0x9c,0x5c,0xdf,0x9d,0x32,0xfc,0x05,
+0x65,0xc0,0x74,0xaa,0xd7,0xae,0xab,0x4e,0xd9,0xcf,0xa7,0x6f,0x79,0x91,0x3d,0x96,
+0x0f,0xe2,0x22,0xc7,0xf2,0x01,0x08,0xdf,0xab,0xf0,0x02,0x42,0x8d,0x46,0xfa,0x70,
+0x22,0xf7,0xae,0x35,0x25,0x41,0x88,0xe7,0x98,0xe4,0x88,0x3c,0x61,0x7a,0xa4,0xe8,
+0x48,0xb9,0x80,0xb7,0x92,0x74,0xa8,0x36,0xea,0x79,0x9a,0x5b,0x30,0xf9,0xd7,0xc6,
+0x9c,0xb2,0xa9,0x96,0x38,0x8b,0x3b,0x40,0xf4,0xd6,0x4e,0xc6,0x97,0x48,0xc0,0x15,
+0x25,0x76,0x72,0x6f,0xd1,0x5c,0xc0,0x04,0xa2,0x05,0xdc,0x3c,0xd2,0xca,0xba,0xc6,
+0x00,0xa7,0x4f,0x19,0x59,0x6d,0xd4,0x9d,0x72,0xd8,0xaf,0x70,0x72,0xab,0x03,0x88,
+0x36,0x41,0xcc,0x0f,0x28,0x47,0x38,0xca,0x10,0x3a,0xc6,0x07,0x07,0x59,0x7b,0x95,
+0xc9,0x7b,0x3f,0x17,0x64,0xf2,0x2a,0xab,0xc6,0x7e,0x1e,0x4a,0x35,0x1b,0x01,0x17,
+0xb8,0xb0,0x4e,0x97,0x18,0x21,0x1c,0xc8,0x80,0x12,0x35,0x4f,0x66,0x5c,0x74,0x09,
+0x2d,0xdc,0xbb,0x6c,0xde,0x64,0x6d,0xaf,0x4d,0x89,0xf6,0x8c,0x85,0x62,0x22,0x4c,
+0xa4,0x7f,0x1d,0x0c,0x68,0x5c,0xf7,0x1c,0x66,0x94,0x95,0xb5,0x1c,0x75,0x5c,0x08,
+0x18,0xf9,0x45,0xd1,0xc9,0x50,0xd0,0x75,0x23,0x2d,0x53,0xcb,0x62,0x97,0x6e,0xdb,
+0xb5,0x75,0x5d,0x4b,0x2f,0x13,0x02,0xa2,0x31,0x5d,0xe5,0xeb,0x92,0x50,0x01,0x57,
+0xb8,0xf0,0xeb,0x38,0xc8,0xed,0x64,0xd6,0xd1,0xe0,0xfd,0x75,0x34,0x81,0xdb,0x72,
+0xb3,0xcd,0x57,0x0e,0x43,0xe3,0x54,0x0a,0x01,0xbc,0xe4,0xd5,0x9b,0x1b,0x32,0xb8,
+0x4a,0xe5,0xa8,0x6a,0xf7,0x62,0x74,0xfe,0x31,0x13,0x3f,0xbe,0x7f,0x0d,0xd5,0xd9,
+0x82,0x52,0x4d,0xac,0x56,0x98,0x53,0xc6,0xa9,0x3c,0xb3,0x82,0x4b,0x2d,0x09,0xb5,
+0x85,0x3d,0x70,0x6c,0xf7,0xc4,0x2a,0xba,0xe7,0x45,0x98,0xc3,0x47,0xa3,0xad,0x96,
+0x8b,0x1f,0xa5,0xf2,0x77,0xbf,0xb0,0xd3,0x07,0x76,0x56,0x67,0x75,0xe0,0x9a,0x5a,
+0x7e,0xb6,0x4c,0xda,0xe0,0xcd,0x8a,0xa2,0x40,0x86,0xed,0xc8,0x7e,0xc7,0xac,0x41,
+0x8a,0x87,0x1c,0xff,0xe9,0xb4,0x34,0x0f,0xbe,0x77,0xef,0x9f,0xc4,0xee,0x73,0xd9,
+0x7f,0x8c,0x5d,0x3f,0xba,0xca,0x75,0xb2,0xf9,0x4b,0xfa,0x2c,0xfe,0x24,0x77,0x41,
+0x15,0x2f,0x0d,0x01,0xd3,0x15,0xf2,0x1b,0x00,0x00,0xff,0xff,0x03,0x00,0x88,0x32,
+0x49,0x7b,0x67,0xbf,0xc6,0x01,0x29,0xf2,0x1c,0x40,0x05,0x3c,0x49,0x25,0x9f,0xab,
+0x7c,0x8e,0xc5,0xa5,0x79,0xe0,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf,0x80,0x13,
+0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47
+};
+
+static void verify0(struct archive *a, struct archive_entry *ae)
+{
+ const void *p;
+ size_t size;
+ off_t offset;
+
+ assert(archive_entry_filetype(ae) == AE_IFREG);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "f1");
+ assert(archive_entry_hardlink(ae) == NULL);
+ assert(archive_entry_symlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+ assertEqualInt(archive_entry_size(ae), 16);
+ assertEqualInt(archive_read_data_block(a, &p, &size, &offset), 0);
+ assertEqualInt((int)size, 16);
+ assertEqualInt((int)offset, 0);
+ assertEqualInt(memcmp(p, "hellohellohello\n", 16), 0);
+}
+
+static void verify1(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ /* A hardlink is not a symlink. */
+ assert(archive_entry_filetype(ae) != AE_IFLNK);
+ /* Nor is it a directory. */
+ assert(archive_entry_filetype(ae) != AE_IFDIR);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "hardlink");
+ assertEqualString(archive_entry_hardlink(ae), "f1");
+ assert(archive_entry_symlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+ assertEqualInt(archive_entry_nlink(ae), 2);
+}
+
+/* Verify that symlinks are read correctly.
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+ln -s f1 symlink
+chown $UNAME:$GNAME symlink
+chmod 0644 symlink
+env TZ=utc touch -afm -t 197001020000.01 f1 symlink
+xar -cf archive2.xar f1 symlink
+od -t x1 archive2.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive2.xar.txt
+*/
+static unsigned char archive2[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe8,
+0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x84,0x00,0x00,0x00,0x01,0x78,0xda,0xb4,0x54,
+0xcb,0x6e,0xa3,0x30,0x14,0xdd,0xf7,0x2b,0x90,0xf7,0x8c,0x1f,0x40,0x82,0x23,0xe3,
+0xaa,0x9b,0x6a,0xf6,0xd3,0xd9,0xcc,0xce,0xf1,0x83,0x58,0xe5,0x25,0x70,0xaa,0xa4,
+0x5f,0x3f,0xb6,0x09,0x4d,0xd3,0x30,0xdd,0x8d,0x84,0xc4,0xf5,0xf1,0xb9,0xc7,0x97,
+0x7b,0x0f,0x66,0x8f,0xa7,0xb6,0x49,0xde,0xf4,0x38,0xd9,0xbe,0xab,0x00,0xfe,0x81,
+0x40,0xa2,0x3b,0xd9,0x2b,0xdb,0xd5,0x15,0xf8,0xfd,0xf2,0x9c,0x96,0xe0,0x91,0x3f,
+0xb0,0x93,0x18,0xf9,0x43,0xc2,0x5c,0x2f,0xfd,0x2b,0x61,0x72,0xd4,0xc2,0xf9,0x8c,
+0xd4,0xd9,0x56,0x73,0x82,0x10,0x4d,0x31,0x49,0x11,0x79,0xc1,0xd9,0x2e,0x2b,0x76,
+0xb8,0x60,0xf0,0x96,0x12,0x93,0x0e,0x5a,0xbe,0x4e,0xc7,0x36,0x99,0xdc,0xb9,0xd1,
+0x15,0x98,0x0e,0x02,0x83,0xb0,0x93,0xb0,0xde,0x98,0x49,0x3b,0x8e,0x18,0xbc,0x44,
+0x11,0x9d,0xec,0x7b,0x10,0x67,0x30,0x06,0x41,0x02,0x2e,0x1a,0x71,0x65,0x6c,0xa3,
+0x13,0xab,0x2a,0x40,0x2e,0x32,0xf2,0xae,0x1c,0xb4,0xcb,0xd1,0x0e,0xd1,0x3f,0x3e,
+0x73,0xa9,0x23,0x61,0xed,0x37,0xb4,0xf6,0x4a,0x13,0xdf,0xd0,0xc4,0x95,0x56,0x8f,
+0xfd,0x71,0xe0,0xf2,0xa8,0x19,0x9c,0xc3,0x19,0xb5,0x8a,0x63,0x84,0xb0,0x07,0x7d,
+0x14,0xa1,0xe3,0xa4,0xc7,0x99,0x17,0xa3,0x19,0xfb,0xa0,0x1d,0x17,0x5a,0xdb,0x2b,
+0xcd,0xd1,0xb6,0xf0,0x3d,0x8c,0x61,0x04,0x1b,0xdb,0xbd,0x26,0xee,0x3c,0xf8,0xb6,
+0x85,0xaf,0x06,0xdc,0xf8,0x94,0x00,0xce,0xdb,0x61,0x87,0x4f,0xe7,0x36,0x20,0x0c,
+0xc6,0x55,0xc4,0x3b,0xd1,0x7e,0xc2,0xe3,0x2a,0xb6,0x31,0x68,0xdc,0xb6,0x70,0x99,
+0x84,0x12,0x4e,0xc4,0xc8,0x9f,0xa9,0xbb,0xda,0x1d,0x38,0xc9,0xfc,0x49,0x73,0x38,
+0xe3,0x97,0x11,0x91,0xdb,0x69,0x5d,0xc6,0x85,0x37,0xd7,0x71,0x79,0x6c,0xf1,0xd2,
+0x32,0x73,0x31,0x0c,0x8d,0x95,0xd1,0x18,0xf0,0x94,0xd6,0xef,0x76,0x00,0xf0,0x42,
+0x15,0xa3,0x3c,0xd8,0x37,0xad,0xd2,0xaf,0x3e,0xf9,0xf5,0xf3,0xc9,0x57,0x67,0xca,
+0x2c,0x53,0xc4,0x28,0x89,0x69,0x96,0xd3,0x4c,0xec,0xf3,0x92,0x0a,0x25,0x48,0x66,
+0x4a,0xb3,0xa5,0xd8,0x6c,0x88,0x91,0xd9,0x86,0x96,0x7e,0x36,0x5f,0x85,0x96,0x5a,
+0x4e,0x6e,0x14,0xd2,0xfd,0xf3,0x84,0x42,0x6d,0xf3,0xbd,0xdc,0xcb,0x2d,0x55,0x99,
+0xa1,0x7b,0x93,0x0b,0xe3,0xb5,0xf3,0xb2,0x2c,0x91,0xce,0x0b,0xb2,0x29,0x72,0xa3,
+0x91,0xa4,0x94,0xc1,0x7b,0xa5,0xb9,0x79,0xf0,0xa3,0x7b,0x2b,0x56,0x9c,0xff,0x0c,
+0xb2,0x66,0x45,0x4c,0xb7,0x28,0x45,0x38,0xd0,0x90,0x37,0x98,0x7f,0xf0,0x9a,0x15,
+0xd7,0x69,0xff,0xdd,0x8a,0x9b,0x3c,0xff,0x6c,0xc5,0xe0,0xae,0x24,0x18,0xaa,0x02,
+0xfd,0x68,0x6b,0xdb,0x89,0x06,0xf0,0x83,0x18,0xd5,0xaa,0xf9,0x82,0x4f,0xef,0x7c,
+0xe7,0x59,0xe1,0x22,0x61,0x30,0x5e,0x2b,0x7f,0x01,0x00,0x00,0xff,0xff,0x03,0x00,
+0x2b,0xab,0x4f,0xf9,0xbb,0xf7,0x90,0xb5,0x34,0x8f,0x7c,0xae,0x72,0xa0,0x80,0xd2,
+0x69,0xc7,0xa2,0xe7,0x44,0x53,0xeb,0x75,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf,
+0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47
+};
+
+static void verify2(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assertEqualInt(archive_entry_filetype(ae), AE_IFLNK);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "symlink");
+ assertEqualString(archive_entry_symlink(ae), "f1");
+ assert(archive_entry_hardlink(ae) == NULL);
+}
+
+/* Character device node.
+#How to make
+mknod devchar c 0 30
+chown $UNAME:$GNAME devchar
+chmod 0644 devchar
+env TZ=utc touch -afm -t 197001020000.01 devchar
+xar -cf archive3.xar devchar
+od -t x1 archive3.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive3.xar.txt
+*/
+static unsigned char archive3[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x38,
+0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x3b,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x92,
+0x4d,0x6e,0xc3,0x20,0x10,0x85,0xf7,0x39,0x05,0xf2,0xde,0x05,0x9c,0x9f,0x36,0xd6,
+0x84,0xec,0x7a,0x82,0x74,0xd3,0x1d,0xc2,0x93,0x98,0xd4,0x36,0x11,0xe0,0x28,0xe9,
+0xe9,0x0b,0xe3,0xa4,0x69,0xa5,0xaa,0x92,0x25,0x1e,0x8f,0xef,0x8d,0x86,0xc1,0xb0,
+0xbd,0xf4,0x1d,0x3b,0xa3,0x0f,0xd6,0x0d,0x9b,0x42,0x3e,0x89,0x82,0xe1,0x60,0x5c,
+0x63,0x87,0xc3,0xa6,0x78,0xdb,0xbd,0x96,0x2f,0xc5,0x56,0xcd,0xe0,0xa2,0xbd,0x9a,
+0x31,0x88,0xce,0xa4,0x85,0x81,0xf1,0xa8,0x63,0x4a,0x94,0xd1,0xf6,0xa8,0x2a,0x21,
+0xd6,0xa5,0xac,0x4a,0x51,0xed,0xa4,0xa8,0xab,0x79,0x2d,0x57,0xc0,0x7f,0x23,0x14,
+0x6a,0xd1,0x7c,0x84,0xb1,0x67,0x21,0x5e,0x3b,0xdc,0x14,0xa1,0xd5,0xb2,0xc8,0x27,
+0x0c,0xdc,0x7e,0x1f,0x30,0x2a,0x01,0xfc,0xa6,0xc8,0x0d,0xf6,0x33,0x17,0x07,0x4e,
+0x22,0x97,0xe0,0xf7,0x1a,0xb4,0xdb,0xdb,0x0e,0x99,0x6d,0x52,0xdb,0xb7,0x32,0xe6,
+0xaf,0x76,0xaa,0x7a,0xb9,0x7c,0x4f,0xc9,0x7b,0x1f,0x0c,0x7a,0x92,0x72,0xfd,0x2c,
+0x4a,0x21,0x33,0x26,0x44,0x9d,0x3f,0x99,0xb0,0xfe,0x81,0xe9,0x7f,0x30,0xfd,0xc0,
+0x0e,0xde,0x8d,0x27,0x65,0x46,0x04,0x3e,0xc9,0xc9,0xb5,0x8d,0x92,0x42,0xc8,0x64,
+0x26,0x45,0xd6,0x18,0xd0,0x4f,0x1c,0xa9,0xc9,0xfb,0xc6,0xc6,0x3b,0xd6,0xbb,0x06,
+0x95,0x58,0x2d,0x16,0xa9,0x99,0x2c,0xc9,0x6c,0xf0,0x6c,0xcd,0xa4,0x13,0x61,0x07,
+0xe7,0xd5,0x3c,0x0d,0x66,0x52,0x37,0x57,0x1f,0x93,0xce,0x26,0x09,0x8a,0xf1,0x1f,
+0x39,0x88,0xd7,0x13,0x2a,0xd3,0x6a,0xaf,0x4d,0x44,0xcf,0xc2,0x09,0x8d,0xd5,0x1d,
+0x70,0xf2,0x89,0x18,0x74,0xba,0x54,0x8a,0x64,0x08,0x38,0xed,0x68,0xea,0x79,0xd0,
+0xf9,0xf9,0x39,0xbd,0x3f,0x70,0xfa,0x1b,0xbe,0x00,0x00,0x00,0xff,0xff,0x03,0x00,
+0xab,0x43,0xa3,0xac,0x76,0x40,0x1e,0x8b,0x95,0x0d,0x28,0x79,0x79,0x43,0x49,0x4e,
+0x16,0xa1,0x56,0x99,0x1f,0x83,0x77,0x41
+};
+
+static void verify3(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assertEqualInt(archive_entry_filetype(ae), AE_IFCHR);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "devchar");
+ assert(archive_entry_symlink(ae) == NULL);
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+}
+
+/* Block device node.
+#How to make
+mknod devblock b 0 30
+chown $UNAME:$GNAME devblock
+chmod 0644 devblock
+env TZ=utc touch -afm -t 197001020000.01 devblock
+xar -cf archive4.xar devblock
+od -t x1 archive4.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive4.xar.txt
+*/
+static unsigned char archive4[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x34,
+0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x38,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x92,
+0xc1,0x6e,0xc2,0x30,0x0c,0x86,0xef,0x3c,0x45,0xd4,0x7b,0x17,0x07,0xd0,0x0a,0x95,
+0x09,0xb7,0x3d,0x01,0xbb,0xec,0x96,0xa5,0x06,0x32,0xda,0xa6,0x6a,0x5a,0x04,0x7b,
+0xfa,0x25,0x2e,0x8c,0x4d,0x9a,0x26,0x55,0xea,0x97,0x3f,0x9f,0x2d,0x37,0x29,0x6e,
+0x2f,0x4d,0x2d,0xce,0xd4,0x07,0xe7,0xdb,0x4d,0xa6,0x9e,0x20,0x13,0xd4,0x5a,0x5f,
+0xb9,0xf6,0xb0,0xc9,0x5e,0x77,0x2f,0xf9,0x2a,0xdb,0xea,0x19,0x5e,0x4c,0xaf,0x67,
+0x02,0x07,0x6f,0xe3,0x4b,0xa0,0xed,0xc9,0x0c,0xb1,0x22,0x1f,0x5c,0x43,0x7a,0x0e,
+0xb0,0xce,0xd5,0x3c,0x87,0xf9,0x4e,0x41,0xb9,0x58,0x95,0xaa,0x40,0xf9,0x5b,0xe1,
+0xa2,0x23,0xd9,0x53,0x18,0x1b,0x11,0x86,0x6b,0x4d,0x9b,0x2c,0x1c,0x8d,0xca,0xd2,
+0x8e,0x40,0xbf,0xdf,0x07,0x1a,0x34,0xa0,0xbc,0x11,0xa7,0xc1,0x7d,0xa6,0xe6,0x28,
+0x19,0x52,0x0b,0x79,0xef,0xc1,0xab,0xbd,0xab,0x49,0xb8,0x2a,0x8e,0x7d,0x6b,0x63,
+0xff,0x1e,0x07,0x8a,0xb7,0x58,0x79,0x9f,0x43,0x60,0xc3,0xa8,0xd6,0x05,0xe4,0xa0,
+0x92,0x06,0x50,0xa6,0x47,0x45,0xad,0x79,0x68,0xe6,0x1f,0xcd,0x3c,0xb4,0x43,0xef,
+0xc7,0x4e,0xdb,0x91,0x50,0x4e,0x38,0xa5,0xae,0xd2,0x0a,0x40,0xc5,0x30,0x12,0x47,
+0x63,0xa0,0x7e,0xf2,0x98,0xa6,0xec,0x5b,0x1b,0xef,0x5a,0xe3,0x2b,0xd2,0xf0,0xbc,
+0x5c,0xc6,0x61,0x12,0x72,0x58,0xd1,0xd9,0xd9,0x89,0xa3,0xe1,0x5a,0xdf,0xeb,0x45,
+0x3c,0x98,0x89,0x6e,0xa9,0xf9,0x88,0x9c,0x42,0x06,0x2e,0x93,0x3f,0xea,0x70,0xb8,
+0x76,0xa4,0xdf,0x6b,0x6f,0x4f,0x22,0x74,0x64,0x9d,0xa9,0x51,0x72,0xc6,0xbb,0xad,
+0x89,0x1f,0x14,0x75,0x16,0x50,0xf2,0x92,0x8f,0x3c,0x9d,0x72,0xba,0x7b,0xc9,0x97,
+0x8f,0x92,0x7f,0x85,0x2f,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0xbe,0x66,0xa2,0x82,
+0x3a,0x54,0xd3,0x61,0xaa,0x8e,0x30,0x4c,0xc8,0x36,0x3b,0x7a,0xa4,0xb9,0xef,0xfc,
+0x7a,0x5d,0x21,0xde
+};
+
+static void verify4(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assertEqualInt(archive_entry_filetype(ae), AE_IFBLK);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "devblock");
+ assert(archive_entry_symlink(ae) == NULL);
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+}
+
+/* Directory.
+#How to make
+mkdir dir1
+chown $UNAME:$GNAME dir1
+chmod 0755 dir1
+env TZ=utc touch -afm -t 197001020000.01 dir1
+xar -cf archive5.xar dir1
+od -t x1 archive5.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive5.xar.txt
+*/
+static unsigned char archive5[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x16,
+0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xec,0x00,0x00,0x00,0x01,0x78,0xda,0x74,0x91,
+0xc1,0x6e,0xc2,0x30,0x0c,0x86,0xef,0x3c,0x45,0xd4,0x7b,0x17,0xa7,0x83,0x31,0xaa,
+0x34,0xdc,0xf6,0x04,0xec,0xb2,0x5b,0x95,0x1a,0x88,0x68,0x1a,0x94,0xa4,0x13,0xdd,
+0xd3,0x2f,0x71,0xe9,0xd0,0xa4,0x4d,0xaa,0xd4,0x3f,0xbf,0x3f,0xff,0xb2,0x6c,0xb9,
+0xbf,0xd9,0x9e,0x7d,0xa2,0x0f,0xc6,0x0d,0x4d,0x21,0x9e,0xa0,0x60,0x38,0x68,0xd7,
+0x99,0xe1,0xd4,0x14,0xef,0x87,0xb7,0xf2,0xb5,0xd8,0xab,0x95,0xbc,0xb5,0x5e,0xad,
+0x98,0x8c,0x4e,0xa7,0x1f,0x93,0xda,0x63,0x1b,0x53,0x47,0x19,0x8d,0x45,0x55,0x01,
+0xec,0x4a,0x51,0x95,0x50,0x1d,0x04,0xd4,0x6b,0x51,0xaf,0x37,0x92,0xff,0x46,0xa8,
+0xe9,0x8c,0xfa,0x12,0x46,0xcb,0x42,0x9c,0x7a,0x6c,0x8a,0x70,0x6e,0x45,0x91,0x2b,
+0x4c,0xba,0xe3,0x31,0x60,0x54,0x20,0xf9,0x5d,0x91,0x1b,0xcc,0x57,0x0e,0x97,0x9c,
+0x44,0x8e,0xe0,0x4b,0x06,0xbd,0x8e,0xa6,0x47,0x66,0xba,0x34,0xf6,0x3d,0x46,0xff,
+0x3d,0xce,0x33,0x7c,0xa4,0xce,0x65,0x0e,0x26,0x2d,0x49,0xb1,0xdb,0x42,0x09,0x22,
+0x63,0x00,0x75,0xfe,0x44,0xc2,0xec,0x03,0x6b,0xff,0x49,0x7b,0x49,0x58,0xfb,0xc0,
+0x4e,0xde,0x8d,0x57,0xa5,0x47,0x94,0x7c,0x96,0xb3,0x6b,0x3a,0x25,0x00,0x44,0x32,
+0x93,0x22,0x6b,0x0c,0xe8,0x67,0x8e,0xd4,0xec,0xfd,0x60,0xe3,0x82,0x59,0xd7,0xa1,
+0x82,0xed,0x26,0xed,0x90,0x24,0x99,0x71,0xba,0xa2,0xea,0x8c,0x47,0x1d,0x9d,0x9f,
+0x24,0xa7,0x37,0x55,0x86,0xd6,0x52,0x25,0x45,0x90,0xa4,0x35,0xe5,0xcd,0xe4,0x7b,
+0x71,0x3a,0x98,0xe4,0x74,0xbe,0x6f,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x23,0x7a,
+0x8c,0x2f,0x78,0xe9,0x69,0x28,0x93,0x14,0x72,0x68,0x8d,0xeb,0x42,0x7b,0xf6,0x0f,
+0x70,0x64,0xa3,0xff,0xb9,0x35
+};
+
+static void verify5(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assertEqualInt(archive_entry_filetype(ae), AE_IFDIR);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+}
+
+/* fifo
+#How to make
+mkfifo -m 0755 fifo
+chown $UNAME:$GNAME fifo
+env TZ=utc touch -afm -t 197001020000.01 fifo
+xar -cf archive6.xar fifo
+od -t x1 archive6.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive6.xar.txt
+*/
+static unsigned char archive6[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0e,
+0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe7,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x91,
+0xc1,0x6e,0xc3,0x20,0x0c,0x86,0xef,0x7d,0x0a,0xc4,0x3d,0xc3,0x64,0xab,0xda,0x46,
+0x94,0xde,0xf6,0x04,0xdd,0x65,0x37,0x44,0x9c,0x16,0x2d,0x84,0x2a,0x90,0xa9,0xdd,
+0xd3,0x0f,0x9c,0x66,0xd5,0xa4,0x69,0x12,0x52,0xbe,0xfc,0x7c,0xb6,0x2c,0xac,0x0e,
+0x57,0xdf,0xb3,0x4f,0x1c,0xa3,0x0b,0xc3,0x9e,0xcb,0x27,0xe0,0x0c,0x07,0x1b,0x5a,
+0x37,0x9c,0xf6,0xfc,0xed,0xf8,0x5a,0x6d,0xf9,0x41,0xaf,0xd4,0xd5,0x8c,0x7a,0xc5,
+0x54,0x0a,0x36,0x7f,0x98,0xb2,0x23,0x9a,0x94,0x2b,0xaa,0xe4,0x3c,0xea,0x1a,0x60,
+0x57,0xc9,0xba,0x82,0xfa,0x28,0x65,0xf3,0x02,0x4d,0xbd,0x55,0xe2,0xb7,0x42,0x45,
+0x67,0xb4,0x1f,0x71,0xf2,0x2c,0xa6,0x5b,0x8f,0x7b,0x1e,0xcf,0x46,0xf2,0x72,0xc3,
+0x54,0xe8,0xba,0x88,0x49,0x83,0x12,0x77,0xa2,0x34,0xba,0xaf,0xd2,0x5c,0x09,0x82,
+0xd2,0x42,0x2c,0x3d,0xe8,0xaf,0x73,0x3d,0x32,0xd7,0xe6,0xb1,0xef,0x6d,0xec,0xdf,
+0xe3,0xc8,0xe7,0xf7,0x5c,0xb9,0xcc,0xc1,0x94,0x27,0x94,0xbb,0x0d,0x54,0x20,0x8b,
+0x06,0xd0,0x94,0x23,0xb3,0xe6,0x1f,0x9a,0xf9,0x47,0x33,0x0f,0xed,0x34,0x86,0xe9,
+0xa2,0xed,0x84,0x4a,0xcc,0x38,0xa7,0xae,0xd5,0x12,0x40,0xe6,0x30,0x13,0x45,0x53,
+0xc4,0x71,0xf6,0x88,0xe6,0xec,0x47,0x9b,0x16,0xcd,0x87,0x16,0x35,0x6c,0xd6,0xeb,
+0x3c,0x4c,0x41,0x0a,0xd3,0xed,0x82,0xba,0x73,0x5d,0x50,0x82,0x90,0xc2,0xc1,0xf8,
+0x25,0x24,0xa4,0x17,0x2a,0x8f,0x52,0x56,0x25,0x68,0x57,0x4a,0xd0,0xe6,0xbe,0x01,
+0x00,0x00,0xff,0xff,0x03,0x00,0x44,0x19,0x8a,0x2a,0x82,0xbc,0x8c,0xae,0x97,0xa7,
+0x7d,0x65,0xa5,0x82,0xdb,0xaa,0xc2,0xcb,0xbe,0xf0,0x1f,0xd1,0xf9,0x56
+};
+
+static void verify6(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assertEqualInt(archive_entry_filetype(ae), AE_IFIFO);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0755);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "fifo");
+ assert(archive_entry_symlink(ae) == NULL);
+ assert(archive_entry_hardlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+}
+
+/* Verify that a file records with directory name.
+#How to make
+mkdir dir1
+echo "hellohellohello" > dir1/f1
+chown $UNAME:$GNAME dir1/f1
+chmod 0644 dir1/f1
+env TZ=utc touch -afm -t 197001020000.01 dir1/f1
+xar -cf archive7.xar dir1/f1
+od -t x1 archive7.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive7.xar.txt
+*/
+
+static unsigned char archive7[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xbb,
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x8a,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x53,
+0xc9,0x6e,0xdb,0x30,0x14,0xbc,0xe7,0x2b,0x04,0xdd,0x55,0x2e,0xa2,0x16,0x1a,0xb4,
+0x82,0x5e,0x8a,0xdc,0x93,0x5e,0x7a,0xa3,0xb9,0xd8,0x44,0xb5,0x41,0xa2,0x02,0x3b,
+0x5f,0x5f,0x92,0xa2,0x1c,0xbb,0x59,0x00,0x01,0x1a,0x3e,0xce,0x1b,0x0d,0x9f,0x86,
+0xec,0xf1,0xdc,0xb5,0xc9,0xab,0x9a,0x66,0x33,0xf4,0xfb,0x14,0xfd,0x80,0x69,0xa2,
+0x7a,0x31,0x48,0xd3,0x1f,0xf7,0xe9,0xef,0x97,0x5f,0x59,0x9d,0x3e,0x36,0x0f,0xec,
+0xcc,0xa7,0xe6,0x21,0x61,0x76,0x10,0xee,0x95,0x30,0x31,0x29,0x6e,0x5d,0x47,0x66,
+0x4d,0xa7,0x1a,0x0c,0x21,0xcd,0x10,0xce,0x20,0x7e,0x41,0x68,0x57,0xe0,0x5d,0x51,
+0x31,0x70,0x4f,0x09,0x4d,0x27,0x25,0xfe,0xce,0x4b,0x97,0xcc,0xf6,0xd2,0xaa,0x7d,
+0x3a,0x9f,0x38,0x4a,0xfd,0x4e,0xc2,0x06,0xad,0x67,0x65,0x1b,0xc8,0x40,0x44,0xa1,
+0x3a,0x9b,0x37,0x2f,0xce,0x40,0x00,0x5e,0x02,0x6c,0x1a,0x61,0xa5,0x4d,0xab,0x12,
+0x23,0x9d,0xed,0x28,0x63,0x2f,0xa3,0x6a,0xa4,0x99,0x94,0xb0,0xc3,0x74,0x61,0x20,
+0xac,0xc3,0x4e,0xcf,0xbb,0xb0,0x83,0x18,0x08,0x30,0x14,0xaf,0xfd,0x78,0xed,0x4f,
+0x98,0xe4,0x96,0xaf,0x30,0x61,0xad,0xea,0x8f,0xf6,0xd4,0xe0,0x9c,0x81,0x08,0xe3,
+0x46,0xb4,0x88,0xef,0xdd,0x6e,0x7e,0x51,0xf9,0xee,0xd7,0x17,0xb7,0x69,0x6e,0xa7,
+0xe6,0xe3,0xd8,0x1a,0x11,0x46,0x03,0xce,0xd9,0xf1,0xcd,0x8c,0x29,0xd8,0xb8,0x7c,
+0x12,0x27,0xf3,0xaa,0x64,0xf6,0xff,0xa8,0x9e,0x9f,0x7e,0xba,0x33,0xea,0x3a,0xcf,
+0x25,0xd6,0x52,0x20,0x9a,0x13,0x9a,0xf3,0x03,0xa9,0x29,0x97,0x1c,0xe7,0xba,0xd6,
+0x15,0x45,0xba,0xc4,0x5a,0xe4,0x25,0xad,0x19,0xf8,0x20,0x74,0x75,0x73,0xb6,0x13,
+0x17,0xf6,0xcb,0x4f,0x14,0xb2,0x22,0x07,0x71,0x10,0x15,0x95,0xb9,0xa6,0x07,0x4d,
+0xb8,0x76,0xe2,0xa4,0xae,0x6b,0xa8,0x48,0x81,0xcb,0x82,0x68,0x05,0x05,0xa5,0x0c,
+0x7c,0x54,0x8a,0x33,0x04,0xef,0x43,0x64,0xe2,0xf3,0x7c,0x90,0xfa,0x8f,0xfb,0x95,
+0x5b,0x30,0x1c,0xaf,0x0b,0x18,0xd1,0x0a,0x66,0x10,0x79,0x1e,0x84,0x3b,0xff,0x20,
+0xc7,0xeb,0x6e,0x78,0xfc,0x1b,0x1e,0xbf,0xe1,0x1d,0xa7,0x61,0x19,0x1b,0xb1,0x28,
+0x06,0x56,0x18,0xcb,0x46,0x36,0x08,0x42,0x17,0x02,0x8f,0xd6,0xda,0x32,0xab,0x69,
+0x65,0x06,0x14,0x8b,0x57,0xe2,0x72,0x25,0x76,0x83,0x54,0x0d,0x2c,0x09,0x71,0x96,
+0x3c,0x5c,0xab,0x21,0x62,0x3e,0x48,0x37,0x69,0x8b,0x71,0xd3,0x77,0x61,0x03,0x9e,
+0xb4,0x86,0x38,0x22,0xd7,0xe1,0xaf,0x13,0x03,0xe1,0x72,0xfd,0x03,0x00,0x00,0xff,
+0xff,0x03,0x00,0x8d,0xb1,0x06,0x76,0xa6,0x7a,0xc3,0xbb,0x13,0x3d,0x45,0xe2,0x2b,
+0x3b,0xd0,0x88,0xc7,0x58,0x7b,0xbd,0x30,0x9d,0x01,0x44,0x78,0xda,0xca,0x48,0xcd,
+0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,
+0x06,0x47
+};
+
+static void verify7(struct archive *a, struct archive_entry *ae)
+{
+ (void)a; /* UNUSED */
+ assert(archive_entry_filetype(ae) == AE_IFREG);
+ assertEqualInt(archive_entry_mode(ae) & 0777, 0644);
+ assertEqualInt(archive_entry_uid(ae), UID);
+ assertEqualInt(archive_entry_gid(ae), GID);
+ assertEqualString(archive_entry_uname(ae), UNAME);
+ assertEqualString(archive_entry_gname(ae), GNAME);
+ assertEqualString(archive_entry_pathname(ae), "dir1/f1");
+ assert(archive_entry_hardlink(ae) == NULL);
+ assert(archive_entry_symlink(ae) == NULL);
+ assertEqualInt(archive_entry_mtime(ae), 86401);
+}
+
+/* Verify that a file records with bzip2 compression
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+env TZ=utc touch -afm -t 197001020000.01 f1
+xar --compression bzip2 -cf archive8.xar f1
+od -t x1 archive8.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive8.xar.txt
+*/
+
+static unsigned char archive8[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xb1,
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x42,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x53,
+0xcb,0x6e,0xdc,0x20,0x14,0xdd,0xe7,0x2b,0x90,0xf7,0x0e,0x60,0xe3,0x07,0x23,0x86,
+0xa8,0x9b,0xa8,0xfb,0x4e,0x37,0xdd,0x61,0x1e,0x63,0x14,0xbf,0x64,0xe3,0x68,0x92,
+0xaf,0x2f,0x60,0x3b,0xa3,0x34,0x6d,0x25,0x4b,0x3e,0x1c,0x0e,0xe7,0x5e,0xee,0xe5,
+0xb2,0xa7,0x5b,0xdf,0x81,0x57,0x3d,0x2f,0x76,0x1c,0xce,0x09,0x7e,0x44,0x09,0xd0,
+0x83,0x1c,0x95,0x1d,0xae,0xe7,0xe4,0xe7,0xe5,0x39,0xad,0x93,0x27,0xfe,0xc0,0x6e,
+0x62,0xe6,0x0f,0x80,0xb9,0x51,0xfa,0x1f,0x60,0x72,0xd6,0xc2,0xf9,0x13,0xa9,0xb3,
+0xbd,0xe6,0x19,0x42,0x34,0xc5,0x59,0x8a,0xc8,0x05,0xd1,0x13,0xc6,0x27,0x9c,0x33,
+0xf8,0x59,0x12,0x0f,0xb5,0x5a,0xbe,0x2c,0x6b,0x0f,0x16,0xf7,0xd6,0xe9,0x73,0xb2,
+0xb4,0x02,0x27,0x61,0x07,0xb0,0xd1,0x98,0x45,0x3b,0x8e,0x18,0xdc,0x51,0x64,0x17,
+0xfb,0x1e,0xcc,0x19,0x8c,0x20,0x58,0xc0,0xc3,0x23,0xae,0x8c,0xed,0x34,0xb0,0xca,
+0xa7,0xbd,0xdb,0x28,0xe1,0x44,0x44,0x80,0x75,0x7a,0xb8,0xba,0x96,0x13,0xc2,0xe0,
+0x0e,0x37,0x7e,0xf7,0xcf,0x3e,0x87,0xda,0x63,0xe1,0xf2,0x1e,0xcb,0x73,0x47,0x21,
+0x8e,0x84,0xc5,0x34,0x75,0x56,0xc6,0x5b,0xc1,0x5b,0xda,0xbc,0xdb,0x29,0x4b,0xe0,
+0xae,0x15,0xb3,0x6c,0xed,0xab,0x56,0xe9,0x9f,0xb7,0xfc,0xf1,0xfd,0x9b,0x4f,0xcf,
+0xe4,0xa4,0x28,0x4a,0x94,0xcb,0x3a,0xcf,0x9b,0x26,0x93,0xaa,0x92,0xba,0x29,0xa8,
+0x2a,0x89,0x29,0xa8,0x50,0x22,0x97,0x45,0xa1,0x71,0xe5,0xeb,0xf6,0xc5,0xe8,0x48,
+0xe6,0xe6,0x66,0x21,0xdd,0x3f,0x23,0x14,0xaa,0x22,0x8d,0x6c,0x64,0x45,0x55,0x6e,
+0x68,0x63,0x88,0x30,0xa6,0x36,0xa4,0xae,0x6b,0xa4,0x49,0x91,0x95,0x05,0x31,0x1a,
+0x49,0x4a,0x19,0xfc,0xea,0xb4,0x55,0x0f,0x7e,0x94,0x8f,0xc9,0xbf,0xf7,0x15,0xd5,
+0xbf,0x7c,0x0b,0x8e,0x86,0x02,0xd6,0x47,0x88,0x69,0x85,0x52,0x84,0x53,0x94,0x5d,
+0x10,0x3a,0x85,0x0f,0x7b,0x59,0x7f,0x97,0x89,0xff,0xc8,0xc4,0x5d,0x76,0x9d,0xc7,
+0x75,0xe2,0x72,0xd5,0x0c,0x6e,0x70,0x63,0xad,0xe2,0x18,0x21,0xec,0x49,0x8f,0x22,
+0xb5,0x2e,0x7a,0xde,0x74,0x11,0x6d,0xdc,0x87,0x6c,0x3d,0x64,0xfd,0xa8,0x34,0x47,
+0x65,0x78,0x02,0x11,0x46,0xd2,0xbd,0x4d,0x1a,0x74,0x76,0x78,0x39,0x27,0xe3,0x6c,
+0xaf,0x76,0x10,0x5d,0xc2,0x5b,0x31,0xab,0xc0,0x31,0x18,0xb6,0x37,0xe1,0x20,0x7c,
+0x5e,0xc6,0xfb,0x45,0x10,0x1f,0x5f,0x78,0x6f,0x61,0x0a,0x60,0x1c,0x03,0x06,0xe3,
+0x50,0xfc,0x06,0x00,0x00,0xff,0xff,0x03,0x00,0x19,0xcf,0xf5,0xc0,0xf9,0x65,0xe8,
+0x78,0xc3,0xfa,0x5f,0x0a,0xf6,0x09,0x17,0xd8,0xb0,0x54,0xb9,0x02,0x8d,0x91,0x31,
+0x9c,0x42,0x5a,0x68,0x39,0x31,0x41,0x59,0x26,0x53,0x59,0xc1,0x52,0x36,0xf7,0x00,
+0x00,0x03,0x41,0x00,0x00,0x10,0x02,0x44,0xa0,0x00,0x21,0xb4,0x01,0x9a,0x0d,0x46,
+0xa5,0x32,0x38,0xbb,0x92,0x29,0xc2,0x84,0x86,0x0a,0x91,0xb7,0xb8
+};
+
+/* Verify that a file records with no compression
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+env TZ=utc touch -afm -t 197001020000.01 f1
+xar --compression none -cf archive9.xar f1
+od -t x1 archive9.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive9.xar.txt
+*/
+
+static unsigned char archive9[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x98,
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x47,0x00,0x00,0x00,0x01,0x78,0xda,0xa4,0x53,
+0x4d,0x6f,0xe3,0x20,0x14,0xbc,0xf7,0x57,0x20,0xee,0x5e,0xc0,0x25,0x89,0x1d,0x11,
+0xaa,0x5e,0xaa,0xbd,0x6f,0xf6,0xb2,0x37,0x02,0x8f,0x18,0xc5,0x1f,0x11,0xc6,0x55,
+0xba,0xbf,0x7e,0x01,0xdb,0xad,0xba,0x55,0x7b,0xa9,0x64,0xc9,0xe3,0x61,0xde,0x78,
+0x78,0xf0,0xc4,0xc3,0xad,0x6b,0xd1,0x33,0xf8,0xd1,0x0d,0xfd,0x01,0xb3,0x1f,0x14,
+0x23,0xe8,0xf5,0x60,0x5c,0x7f,0x3e,0xe0,0xdf,0xc7,0xa7,0xa2,0xc2,0x0f,0xf2,0x4e,
+0xdc,0x94,0x97,0x77,0x48,0x84,0x41,0xc7,0x17,0x12,0xda,0x83,0x0a,0xb1,0xa2,0x08,
+0xae,0x03,0x59,0x52,0x5a,0x17,0xac,0x2c,0x28,0x3f,0xd2,0x7a,0xcf,0xaa,0x3d,0xaf,
+0x05,0x79,0x2f,0xc9,0x45,0x0d,0xe8,0xcb,0x38,0x75,0x68,0x0c,0x2f,0x2d,0x1c,0xf0,
+0xd8,0x28,0x86,0xd3,0x0a,0x12,0x83,0xb5,0x23,0x04,0x49,0x05,0x59,0x50,0x66,0x47,
+0xf7,0x37,0x99,0x0b,0x92,0x41,0xb2,0x20,0xab,0x47,0xfe,0xb2,0xae,0x05,0xe4,0x4c,
+0x8c,0xbd,0xd8,0x18,0x15,0x54,0x46,0x48,0xb4,0xd0,0x9f,0x43,0x23,0xd9,0x56,0x90,
+0x05,0xce,0xfc,0xba,0xb9,0x35,0x84,0xba,0x5e,0x5b,0xa7,0x73,0x52,0x32,0xe8,0x00,
+0xa1,0x18,0x43,0x4c,0xde,0x61,0xb2,0x14,0x2c,0x81,0xca,0xf7,0xd9,0x96,0x70,0xc9,
+0x7e,0x0d,0x17,0x39,0xe5,0x75,0xe3,0x9e,0xc1,0x14,0xff,0x6f,0xf5,0xd7,0xcf,0xc7,
+0x98,0x71,0x63,0x76,0xfc,0xa4,0x4f,0x7a,0x57,0x9b,0x7b,0x5b,0x9f,0x2c,0x57,0xd6,
+0x56,0x96,0x57,0x55,0x45,0x81,0x6f,0xca,0xed,0x86,0x5b,0xa0,0xba,0x8e,0xcd,0xfb,
+0x60,0xb4,0xa6,0xbf,0x05,0xaf,0x62,0xca,0xef,0xff,0xe1,0xa3,0xd3,0xdc,0x42,0xf2,
+0xda,0x43,0xa1,0x3f,0x39,0xdc,0xed,0x9f,0x78,0x0e,0xeb,0xa9,0x22,0xd1,0x65,0xc8,
+0xea,0x1d,0x2d,0x28,0x2b,0x68,0x79,0xa4,0x74,0x9f,0x1e,0x16,0x65,0xdd,0x9b,0x4c,
+0x7d,0x21,0x53,0x6f,0xb2,0xb3,0x1f,0xa6,0xab,0xd4,0x13,0x08,0x32,0xc3,0x99,0x75,
+0x46,0x32,0x4a,0x59,0x24,0x23,0xca,0xd4,0x34,0x82,0x9f,0x75,0x19,0xcd,0xdc,0xab,
+0x6c,0x5a,0x65,0xdd,0x60,0x40,0xd2,0x2d,0xe7,0x31,0x4c,0x82,0x99,0x0c,0x2f,0x57,
+0x40,0xad,0xeb,0x2f,0x07,0x3c,0x78,0x77,0x76,0xbd,0x6a,0xb1,0x6c,0x94,0x37,0x89,
+0x13,0x24,0x2d,0xcf,0xc2,0x5e,0xc5,0x5c,0x36,0xfa,0x65,0x90,0x6f,0x60,0xba,0x74,
+0x69,0x14,0x48,0x9e,0x05,0x41,0xf2,0x64,0xfc,0x03,0x00,0x00,0xff,0xff,0x03,0x00,
+0xee,0x8e,0xf8,0x75,0xa1,0xaf,0x74,0x71,0x3f,0x40,0x08,0xab,0x13,0x7d,0xc0,0x82,
+0x3a,0x56,0xeb,0x4e,0x35,0xf1,0x35,0xb7,0x68,0x65,0x6c,0x6c,0x6f,0x68,0x65,0x6c,
+0x6c,0x6f,0x68,0x65,0x6c,0x6c,0x6f,0x0a
+};
+
+/* Verify that a file records with md5 hashing algorithm
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+env TZ=utc touch -afm -t 197001020000.01 f1
+xar --toc-cksum md5 -cf archive10.xar f1
+od -t x1 archive10.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive10.xar.txt
+*/
+
+static unsigned char archive10[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xaf,
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x40,0x00,0x00,0x00,0x02,0x78,0xda,0x7c,0x53,
+0x4d,0x6f,0xdc,0x20,0x10,0xbd,0xe7,0x57,0x20,0xee,0x0e,0x60,0xb3,0xb6,0x59,0xb1,
+0x44,0xbd,0x44,0xbd,0x77,0x7b,0xe9,0x8d,0xe5,0xc3,0x8b,0xe2,0x2f,0x61,0x1c,0x6d,
+0xf2,0xeb,0x8b,0xb1,0x9d,0xb4,0x4d,0x52,0xc9,0x92,0x1f,0x8f,0xc7,0x9b,0x61,0x86,
+0xe1,0x0f,0xb7,0xae,0x05,0xcf,0xc6,0x4f,0x6e,0xe8,0x4f,0x90,0xdc,0x63,0x08,0x4c,
+0xaf,0x06,0xed,0xfa,0xe6,0x04,0x7f,0x9e,0x1f,0xb3,0x1a,0x3e,0x88,0x3b,0x7e,0x93,
+0x5e,0xdc,0x01,0x1e,0x06,0x15,0x7f,0x80,0x2b,0x6f,0x64,0x88,0x27,0xb2,0xe0,0x3a,
+0x23,0x72,0x8c,0x59,0x46,0xf2,0x0c,0xd3,0x33,0x66,0xc7,0x02,0x1f,0x69,0xcd,0xd1,
+0xdf,0x92,0x74,0xe8,0x6a,0xd4,0xd3,0x34,0x77,0x60,0x0a,0x2f,0xad,0x39,0xc1,0x4e,
+0x1f,0xe0,0xb2,0x01,0xf8,0x60,0xed,0x64,0x82,0xc0,0x1c,0x6d,0x28,0xb1,0x93,0x7b,
+0x35,0x82,0x94,0x1c,0x25,0xb0,0x38,0xa0,0xdd,0x22,0xad,0xac,0x6b,0x0d,0x70,0x3a,
+0x66,0xbd,0xd9,0x68,0x19,0x64,0x42,0x80,0xb7,0xa6,0x6f,0xc2,0x55,0xe4,0x05,0x47,
+0x1b,0x5c,0xf9,0xcd,0x7f,0x71,0xfd,0x23,0xd4,0x27,0xb1,0x22,0xb7,0xd7,0x61,0xcf,
+0x57,0x8e,0x63,0xeb,0x54,0xba,0x14,0xba,0x65,0xcd,0xab,0x1b,0x21,0xda,0xa4,0xd2,
+0xab,0xab,0x7b,0x36,0x3a,0xfb,0xf7,0x8e,0x3f,0xbe,0x7f,0x8b,0xd9,0xd9,0xba,0x28,
+0x74,0x6e,0xb5,0x22,0xac,0xa0,0xac,0x90,0x17,0x5a,0x33,0xa9,0x65,0x5e,0xd8,0xda,
+0x56,0x8c,0xd8,0x32,0xb7,0xaa,0x28,0x59,0xac,0xda,0x07,0xa3,0x3d,0x97,0x5b,0xf0,
+0x52,0x85,0x2f,0x23,0x1c,0x74,0x45,0x2f,0xea,0xa2,0x2a,0xa6,0x0b,0xcb,0x2e,0x96,
+0x4a,0x1b,0xbd,0x69,0x5d,0xd7,0xd8,0xd0,0x43,0x5e,0x1e,0xa8,0x35,0x58,0x31,0xc6,
+0xd1,0x47,0xa7,0xb5,0x78,0xe8,0xad,0x7a,0x5c,0x7d,0xd1,0xd5,0xea,0x57,0xec,0xc0,
+0xde,0x4e,0xc0,0xbb,0x04,0x09,0xab,0x70,0x86,0x49,0x86,0xf3,0x33,0xc6,0xc7,0xe5,
+0x23,0x51,0xd6,0xbd,0xcb,0xe4,0x7f,0x64,0xf2,0x5d,0xd6,0xf8,0x61,0x1e,0x85,0x9a,
+0x0d,0x47,0x2b,0x5c,0x59,0xa7,0x05,0xc1,0x98,0x44,0x32,0xa2,0x44,0xcd,0x93,0xf1,
+0xab,0x2e,0xa1,0x95,0x7b,0x93,0xcd,0xbb,0xac,0x1b,0xb4,0x11,0xb8,0xa4,0x34,0x26,
+0xb3,0xc0,0x44,0x86,0x97,0xd1,0x80,0xd6,0xf5,0x4f,0x27,0x38,0x78,0xd7,0xb8,0x5e,
+0xb6,0x50,0x5c,0xa5,0xd7,0x0b,0xc7,0xd1,0xb2,0xbd,0x0a,0x7b,0x19,0xf3,0xb2,0xd1,
+0x2f,0x81,0xf4,0xf6,0x96,0xe7,0xb6,0xcc,0x00,0x4a,0x43,0xc0,0x51,0x1a,0x89,0xdf,
+0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x27,0xf8,0xf5,0x28,0x87,0x01,0xb1,0xb7,0x18,
+0xe8,0x34,0x20,0x06,0x5c,0x66,0x9a,0x43,0x26,0xe7,0x94,0x78,0xda,0xca,0x48,0xcd,
+0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,
+0x06,0x47
+};
+
+/* Verify that a file records with no hashing algorithm
+#How to make
+echo "hellohellohello" > f1
+chown $UNAME:$GNAME f1
+chmod 0644 f1
+env TZ=utc touch -afm -t 197001020000.01 f1
+xar --toc-cksum none -cf archive11.xar f1
+od -t x1 archive11.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive11.xar.txt
+*/
+
+static unsigned char archive11[] = {
+0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x98,
+0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xef,0x00,0x00,0x00,0x00,0x78,0xda,0x7c,0x52,
+0xcb,0x6e,0xeb,0x20,0x14,0xdc,0xf7,0x2b,0x10,0x7b,0x17,0xb0,0x89,0x63,0x22,0x42,
+0x75,0x37,0x55,0xf7,0xcd,0xdd,0x74,0x47,0x78,0x38,0xa8,0x7e,0xc9,0xc6,0x55,0xda,
+0xaf,0xbf,0x3c,0xe2,0x56,0x55,0xd5,0x2b,0x21,0x79,0x3c,0xcc,0x39,0x67,0x74,0x18,
+0xfe,0x70,0xed,0x3b,0xf0,0x66,0xe6,0xc5,0x8d,0xc3,0x11,0x92,0x7b,0x0c,0x81,0x19,
+0xd4,0xa8,0xdd,0xd0,0x1e,0xe1,0xdf,0xd3,0x63,0xd1,0xc0,0x07,0x71,0xc7,0xaf,0x72,
+0x16,0x77,0x80,0xfb,0x51,0x85,0x0f,0xe0,0x6a,0x36,0xd2,0x87,0x8a,0xc2,0xbb,0xde,
+0x88,0x12,0x63,0x56,0x90,0xb2,0xc0,0xf4,0x44,0xf0,0x81,0x54,0x07,0x5a,0x73,0xf4,
+0x5d,0x12,0x8b,0xac,0xeb,0x0c,0x70,0x3a,0x4c,0x81,0xf1,0x1f,0x70,0x2d,0xbd,0x4c,
+0x08,0xf0,0xce,0x0c,0xad,0xbf,0x88,0xb2,0xe2,0xe8,0x06,0x33,0x3f,0x5a,0xbb,0x18,
+0x2f,0x30,0x47,0x37,0x94,0xe9,0xc5,0x7d,0x18,0x41,0xc2,0x94,0x04,0x32,0xb7,0xd9,
+0x06,0x8b,0x7f,0xef,0xcc,0x11,0xca,0x69,0xea,0x9c,0x4a,0x1e,0xd0,0xb5,0x68,0x3f,
+0xdc,0x04,0xd1,0x4d,0x2a,0x67,0x75,0x71,0x6f,0x46,0x17,0xea,0x62,0xd4,0xeb,0xb2,
+0xf6,0x5b,0xcd,0xf3,0xd3,0x9f,0x60,0xce,0x36,0x55,0xa5,0x4b,0xab,0x15,0x61,0x15,
+0x65,0x95,0x3c,0xd3,0x86,0x49,0x2d,0xcb,0xca,0x36,0x76,0xcf,0x88,0xad,0x4b,0xab,
+0xaa,0x9a,0x35,0x1c,0xfd,0x68,0xb4,0x79,0xb9,0xfa,0x59,0x2a,0xff,0xeb,0x84,0x9d,
+0xde,0xd3,0xb3,0x3a,0xab,0x3d,0xd3,0x95,0x65,0x67,0x4b,0xa5,0x0d,0xbd,0x69,0xd3,
+0x34,0xd8,0xd0,0x5d,0x59,0xef,0xa8,0x35,0x58,0x31,0xc6,0xd1,0xcf,0x4e,0x79,0x77,
+0xe8,0x73,0x79,0x5c,0xfd,0xf2,0x08,0xe4,0x25,0xbc,0xc2,0xb6,0x7d,0xc0,0xfb,0x04,
+0x09,0xdb,0xe3,0x02,0x93,0x02,0x97,0x27,0x8c,0x0f,0xf1,0x44,0x59,0xff,0x25,0x93,
+0xff,0x91,0xc9,0x2f,0x59,0x3b,0x8f,0xeb,0x24,0xd4,0x6a,0x38,0xca,0x30,0xb3,0x4e,
+0x0b,0x82,0x31,0x09,0x64,0x40,0x89,0x5a,0x17,0x33,0x67,0x5d,0x42,0x99,0xfb,0x94,
+0xad,0x9b,0xac,0x1f,0xb5,0x11,0xb8,0xa6,0x34,0x98,0x89,0x30,0x91,0xfe,0x7d,0x32,
+0xa0,0x73,0xc3,0xeb,0x11,0x8e,0xb3,0x6b,0xdd,0x20,0x3b,0x28,0x2e,0x72,0xd6,0x91,
+0xe3,0x28,0x5e,0x67,0xe1,0x20,0x83,0x2f,0x1b,0xfa,0x25,0x10,0xc3,0x86,0x62,0xda,
+0x62,0x64,0x51,0xca,0x2c,0x47,0x29,0xc1,0xff,0x00,0x00,0x00,0xff,0xff,0x03,0x00,
+0xf1,0x18,0xdc,0x71,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00,
+0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47
+};
+
+enum enc {
+ GZIP,
+ BZIP2
+};
+
+static void verify(unsigned char *d, size_t s,
+ void (*f1)(struct archive *, struct archive_entry *),
+ void (*f2)(struct archive *, struct archive_entry *),
+ enum enc etype)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ unsigned char *buff;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ switch (etype) {
+ case BZIP2:
+ /* This is only check whether bzip is supported or not.
+ * This filter won't be used this test. */
+ if (ARCHIVE_OK != archive_read_support_compression_bzip2(a)) {
+ skipping("Unsupported bzip2");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ break;
+ case GZIP:
+ /* This gzip must be needed. archive_read_support_format_xar()
+ * will return a warning if gzip is unsupported. */
+ break;
+ }
+ assertA(0 == archive_read_support_compression_all(a));
+ r = archive_read_support_format_xar(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xar reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assert((buff = malloc(100000)) != NULL);
+ if (buff == NULL)
+ return;
+ memcpy(buff, d, s);
+ memset(buff + s, 0, 2048);
+
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_open_memory(a, buff, s + 1024));
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR);
+ /* Verify the only entry. */
+ f1(a, ae);
+ if (f2) {
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR);
+ /* Verify the only entry. */
+ f2(a, ae);
+ }
+ /* End of archive. */
+ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertA(0 == archive_read_close(a));
+ assertA(0 == archive_read_finish(a));
+ free(buff);
+}
+
+DEFINE_TEST(test_read_format_xar)
+{
+ verify(archive1, sizeof(archive1), verify0, verify1, GZIP);
+ verify(archive2, sizeof(archive2), verify0, verify2, GZIP);
+ verify(archive3, sizeof(archive3), verify3, NULL, GZIP);
+ verify(archive4, sizeof(archive4), verify4, NULL, GZIP);
+ verify(archive5, sizeof(archive5), verify5, NULL, GZIP);
+ verify(archive6, sizeof(archive6), verify6, NULL, GZIP);
+ verify(archive7, sizeof(archive7), verify7, NULL, GZIP);
+ verify(archive8, sizeof(archive8), verify0, NULL, BZIP2);
+ verify(archive9, sizeof(archive9), verify0, NULL, GZIP);
+ verify(archive10, sizeof(archive10), verify0, NULL, GZIP);
+ verify(archive11, sizeof(archive11), verify0, NULL, GZIP);
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_zip.c b/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
index 50e522bb4d5..680e7ede360 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
@@ -23,7 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_zip.c,v 1.3 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_zip.c 189482 2009-03-07 03:30:35Z kientzle $");
+
+/*
+ * The reference file for this has been manually tweaked so that:
+ * * file2 has length-at-end but file1 does not
+ * * file2 has an invalid CRC
+ */
DEFINE_TEST(test_read_format_zip)
{
@@ -34,6 +40,7 @@ DEFINE_TEST(test_read_format_zip)
const void *pv;
size_t s;
off_t o;
+ int r;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
@@ -46,26 +53,39 @@ DEFINE_TEST(test_read_format_zip)
assertEqualInt(0, archive_entry_size(ae));
assertEqualIntA(a, ARCHIVE_EOF,
archive_read_data_block(a, &pv, &s, &o));
- assertEqualInt(s, 0);
+ assertEqualInt((int)s, 0);
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(1179604289, archive_entry_mtime(ae));
assertEqualInt(18, archive_entry_size(ae));
- assertEqualInt(18, archive_read_data(a, buff, 18));
+ failure("archive_read_data() returns number of bytes read");
+ r = archive_read_data(a, buff, 19);
+ if (r < ARCHIVE_OK) {
+ if (strcmp(archive_error_string(a),
+ "libarchive compiled without deflate support (no libz)") == 0) {
+ skipping("Skipping ZIP compression check: %s",
+ archive_error_string(a));
+ goto finish;
+ }
+ }
+ assertEqualInt(18, r);
assert(0 == memcmp(buff, "hello\nhello\nhello\n", 18));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("file2", archive_entry_pathname(ae));
assertEqualInt(1179605932, archive_entry_mtime(ae));
- assertEqualInt(18, archive_entry_size(ae));
- assertEqualInt(18, archive_read_data(a, buff, 18));
+ failure("file2 has length-at-end, so we shouldn't see a valid size");
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ failure("file2 has a bad CRC, so reading to end should fail");
+ assertEqualInt(ARCHIVE_WARN, archive_read_data(a, buff, 19));
assert(0 == memcmp(buff, "hello\nhello\nhello\n", 18));
assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE);
assertA(archive_format(a) == ARCHIVE_FORMAT_ZIP);
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+finish:
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_zip.zip.uu b/archivers/libarchive/files/libarchive/test/test_read_format_zip.zip.uu
index f61340e2f93..b1f04c4fea0 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_zip.zip.uu
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_zip.zip.uu
@@ -1,13 +1,14 @@
-$FreeBSD$
-begin 645 test_read_format_zip.zip
-M4$L#!`H``````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1AE5
-M3T95>`0`Z`/H`U!+`P04````"`!O9K,V.C=F/0H````2````!0`5`&9I;&4Q
-M550)``-!54]&K%M/1E5X!`#H`^@#RTC-R<GGRD`B`5!+`P04````"`!::K,V
-M.C=F/0H````2````!0`5`&9I;&4R550)``.L6T]&K%M/1E5X!`#H`^@#RTC-
-MR<GGRD`B`5!+`0(7`PH``````%EFLS8````````````````$``T`````````
-M$`#M00````!D:7(O550%``,954]&57@``%!+`0(7`Q0````(`&]FLS8Z-V8]
-M"@```!(````%``T```````$```"D@3<```!F:6QE,554!0`#055/1E5X``!0
-M2P$"%P,4````"`!::K,V.C=F/0H````2````!0`-```````!````I(%Y````
-H9FEL93)55`4``ZQ;3T95>```4$L%!@`````#``,`OP```+L`````````
+$FreeBSD: src/lib/libarchive/test/test_read_format_zip.zip.uu,v 1.3 2008/10/21 05:08:35 kientzle Exp $
+begin 644 test_read_format_zip.zip
+M4$L#!`H`"````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1M19
+M_4A5>`0`Z`/H`U!+!P@```````````````!02P,$%`````@`;V:S-CHW9CT*
+M````$@````4`%0!F:6QE,554"0`#055/1L!9_4A5>`0`Z`/H`\M(S<G)Y\I`
+M(@%02P,$%``(``@`6FJS-@``````````$@````4`%0!F:6QE,E54"0`#K%M/
+M1L!9_4A5>`0`Z`/H`\M(S<G)Y\I`(@%02P<(.C=F$@H````2````4$L!`A<#
+M"@`(````66:S-@````````````````0`#0`````````0`.U!`````&1I<B]5
+M5`4``QE53T95>```4$L!`A<#%``(``@`;V:S-CHW9CT*````$@````4`#0``
+M`````0```.V!1P```&9I;&4Q550%``-!54]&57@``%!+`0(7`Q0`"``(`%IJ
+MLS8Z-V8]"@```!(````%``T```````$```#M@8D```!F:6QE,E54!0`#K%M/
+;1E5X``!02P4&``````,``P"_````VP``````
`
end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_large.c b/archivers/libarchive/files/libarchive/test/test_read_large.c
index d0342407cd8..a2be6017865 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_large.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_large.c
@@ -23,21 +23,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_large.c,v 1.3 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_large.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char testdata[10 * 1024 * 1024];
static unsigned char testdatacopy[10 * 1024 * 1024];
static unsigned char buff[11 * 1024 * 1024];
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define open _open
+#define close _close
+#endif
+
/* Check correct behavior on large reads. */
DEFINE_TEST(test_read_large)
{
unsigned int i;
int tmpfilefd;
- char tmpfilename[] = "/tmp/test-read_large.XXXXXX";
+ char tmpfilename[] = "test-read_large.XXXXXX";
size_t used;
struct archive *a;
struct archive_entry *entry;
+ FILE *f;
for (i = 0; i < sizeof(testdata); i++)
testdata[i] = (unsigned char)(rand());
@@ -51,12 +57,8 @@ DEFINE_TEST(test_read_large)
archive_entry_set_pathname(entry, "test");
assertA(0 == archive_write_header(a, entry));
archive_entry_free(entry);
- assertA(sizeof(testdata) == archive_write_data(a, testdata, sizeof(testdata)));
-#if ARCHIVE_API_VERSION > 1
+ assertA((int)sizeof(testdata) == archive_write_data(a, testdata, sizeof(testdata)));
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
assert(NULL != (a = archive_read_new()));
assertA(0 == archive_read_support_format_all(a));
@@ -64,11 +66,7 @@ DEFINE_TEST(test_read_large)
assertA(0 == archive_read_open_memory(a, buff, sizeof(buff)));
assertA(0 == archive_read_next_header(a, &entry));
assertA(0 == archive_read_data_into_buffer(a, testdatacopy, sizeof(testdatacopy)));
-#if ARCHIVE_API_VERSION > 1
assertA(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
assert(0 == memcmp(testdata, testdatacopy, sizeof(testdata)));
@@ -77,18 +75,19 @@ DEFINE_TEST(test_read_large)
assertA(0 == archive_read_support_compression_all(a));
assertA(0 == archive_read_open_memory(a, buff, sizeof(buff)));
assertA(0 == archive_read_next_header(a, &entry));
- assert(0 < (tmpfilefd = mkstemp(tmpfilename)));
- assertA(0 == archive_read_data_into_fd(a, tmpfilefd));
- close(tmpfilefd);
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_read_finish(a));
+#if defined(__BORLANDC__)
+ tmpfilefd = open(tmpfilename, O_WRONLY | O_CREAT | O_BINARY);
#else
- archive_read_finish(a);
+ tmpfilefd = open(tmpfilename, O_WRONLY | O_CREAT | O_BINARY, 0755);
#endif
- tmpfilefd = open(tmpfilename, O_RDONLY);
- read(tmpfilefd, testdatacopy, sizeof(testdatacopy));
+ assert(0 < tmpfilefd);
+ assertA(0 == archive_read_data_into_fd(a, tmpfilefd));
close(tmpfilefd);
- assert(0 == memcmp(testdata, testdatacopy, sizeof(testdata)));
+ assertA(0 == archive_read_finish(a));
- unlink(tmpfilename);
+ f = fopen(tmpfilename, "rb");
+ assertEqualInt(sizeof(testdatacopy),
+ fread(testdatacopy, 1, sizeof(testdatacopy), f));
+ fclose(f);
+ assert(0 == memcmp(testdata, testdatacopy, sizeof(testdata)));
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c b/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
index 5e2c9c536b4..4e2a8134ec2 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
@@ -23,15 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_pax_truncated.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_pax_truncated.c 189483 2009-03-07 03:34:34Z kientzle $");
DEFINE_TEST(test_read_pax_truncated)
{
struct archive_entry *ae;
struct archive *a;
- ssize_t used, i;
- size_t buff_size = 1000000;
- ssize_t filedata_size = 100000;
+ size_t used, i, buff_size = 1000000;
+ size_t filedata_size = 100000;
char *buff = malloc(buff_size);
char *buff2 = malloc(buff_size);
char *filedata = malloc(filedata_size);
@@ -40,7 +39,8 @@ DEFINE_TEST(test_read_pax_truncated)
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_pax(a));
assertA(0 == archive_write_set_compression_none(a));
- assertA(0 == archive_write_open_memory(a, buff, buff_size, &used));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, buff_size, &used));
/*
* Write a file to it.
@@ -56,14 +56,15 @@ DEFINE_TEST(test_read_pax_truncated)
archive_entry_set_size(ae, filedata_size);
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
- assertA(filedata_size == archive_write_data(a, filedata, filedata_size));
+ assertA((ssize_t)filedata_size
+ == archive_write_data(a, filedata, filedata_size));
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/* Now, read back a truncated version of the archive and
@@ -72,7 +73,7 @@ DEFINE_TEST(test_read_pax_truncated)
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_format_all(a));
assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == read_open_memory(a, buff, i, 13));
+ assertA(0 == read_open_memory2(a, buff, i, 13));
if (i < 1536) {
assertEqualIntA(a, ARCHIVE_FATAL, archive_read_next_header(a, &ae));
@@ -98,16 +99,20 @@ DEFINE_TEST(test_read_pax_truncated)
* does not return an error if it can't consume
* it.) */
if (i < 1536 + 512*((filedata_size + 511)/512) + 512) {
- assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae));
+ failure("i=%d minsize=%d", i,
+ 1536 + 512*((filedata_size + 511)/512) + 512);
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_next_header(a, &ae));
} else {
- assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_next_header(a, &ae));
}
wrap_up:
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
@@ -141,16 +146,18 @@ DEFINE_TEST(test_read_pax_truncated)
* does not return an error if it can't consume
* it.) */
if (i < 1536 + 512*((filedata_size + 511)/512) + 512) {
- assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_next_header(a, &ae));
} else {
- assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_next_header(a, &ae));
}
wrap_up2:
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
@@ -167,10 +174,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the size field in the pax attributes. */
@@ -182,10 +189,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the size field in the pax attributes. */
@@ -199,10 +206,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the size field in the pax attributes. */
@@ -217,10 +224,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the size field in the pax attributes. */
@@ -233,10 +240,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the size field in the pax attributes. */
@@ -248,10 +255,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/* Damage the ustar header. */
@@ -263,10 +270,10 @@ DEFINE_TEST(test_read_pax_truncated)
assertA(0 == archive_read_open_memory(a, buff2, used));
assertEqualIntA(a, ARCHIVE_FATAL, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
/*
diff --git a/archivers/libarchive/files/libarchive/test/test_read_position.c b/archivers/libarchive/files/libarchive/test/test_read_position.c
index 3675e11a4b9..85b79672142 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_position.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_position.c
@@ -23,10 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_position.c,v 1.3 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_position.c 189389 2009-03-05 02:19:42Z kientzle $");
-static unsigned char nulls[10000000];
-static unsigned char buff[10000000];
+static unsigned char nulls[10000];
+static unsigned char buff[10000000];
/* Check that header_position tracks correctly on read. */
DEFINE_TEST(test_read_position)
@@ -34,42 +34,61 @@ DEFINE_TEST(test_read_position)
struct archive *a;
struct archive_entry *ae;
size_t write_pos;
- const size_t data_size = 1000000;
+ intmax_t read_position;
+ size_t i, j;
+ size_t data_sizes[] = {0, 5, 511, 512, 513};
- /* Create a simple archive_entry. */
- assert((ae = archive_entry_new()) != NULL);
- archive_entry_set_pathname(ae, "testfile");
- archive_entry_set_mode(ae, S_IFREG);
- archive_entry_set_size(ae, data_size);
+ /* Sanity test */
+ assert(sizeof(nulls) + 512 + 1024 <= sizeof(buff));
+ /* Create an archive. */
assert(NULL != (a = archive_write_new()));
assertA(0 == archive_write_set_format_pax_restricted(a));
assertA(0 == archive_write_set_bytes_per_block(a, 512));
assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &write_pos));
- assertA(0 == archive_write_header(a, ae));
- archive_entry_free(ae);
- assertA(data_size == (size_t)archive_write_data(a, nulls, sizeof(nulls)));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+
+ for (i = 0; i < sizeof(data_sizes)/sizeof(data_sizes[0]); ++i) {
+ /* Create a simple archive_entry. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_pathname(ae, "testfile");
+ archive_entry_set_mode(ae, S_IFREG);
+ archive_entry_set_size(ae, data_sizes[i]);
+ assertA(0 == archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertA(data_sizes[i]
+ == (size_t)archive_write_data(a, nulls, sizeof(nulls)));
+ }
assertA(0 == archive_write_close(a));
- archive_write_finish(a);
-#endif
- /* 512-byte header + data_size (rounded up) + 1024 end-of-archive */
- assert(write_pos == ((512 + data_size + 1024 + 511)/512)*512);
+ assertA(0 == archive_write_finish(a));
/* Read the archive back. */
assert(NULL != (a = archive_read_new()));
assertA(0 == archive_read_support_format_tar(a));
assertA(0 == archive_read_open_memory2(a, buff, sizeof(buff), 512));
- assert((intmax_t)0 == (intmax_t)archive_read_header_position(a));
- assertA(0 == archive_read_next_header(a, &ae));
- assert((intmax_t)0 == (intmax_t)archive_read_header_position(a));
- assertA(0 == archive_read_data_skip(a));
- assert((intmax_t)0 == (intmax_t)archive_read_header_position(a));
+
+ read_position = 0;
+ /* Initial header position is zero. */
+ assert(read_position == (intmax_t)archive_read_header_position(a));
+ for (j = 0; j < i; ++j) {
+ assertA(0 == archive_read_next_header(a, &ae));
+ assert(read_position
+ == (intmax_t)archive_read_header_position(a));
+ /* Every other entry: read, then skip */
+ if (j & 1)
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_data_into_buffer(a, buff, 1));
+ assertA(0 == archive_read_data_skip(a));
+ /* read_data_skip() doesn't change header_position */
+ assert(read_position
+ == (intmax_t)archive_read_header_position(a));
+
+ read_position += 512; /* Size of header. */
+ read_position += (data_sizes[j] + 511) & ~511;
+ }
+
assertA(1 == archive_read_next_header(a, &ae));
- assert((intmax_t)((data_size + 511 + 512)/512)*512 == (intmax_t)archive_read_header_position(a));
+ assert(read_position == (intmax_t)archive_read_header_position(a));
assertA(0 == archive_read_close(a));
- assert((intmax_t)((data_size + 511 + 512)/512)*512 == (intmax_t)archive_read_header_position(a));
+ assert(read_position == (intmax_t)archive_read_header_position(a));
archive_read_finish(a);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_truncated.c b/archivers/libarchive/files/libarchive/test/test_read_truncated.c
index 726984c58c4..9b26b59818a 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_truncated.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_truncated.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_truncated.c,v 1.3 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_truncated.c,v 1.4 2008/09/01 05:38:33 kientzle Exp $");
char buff[1000000];
char buff2[100000];
@@ -52,14 +52,14 @@ DEFINE_TEST(test_read_truncated)
archive_entry_set_size(ae, sizeof(buff2));
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
- assertA(sizeof(buff2) == archive_write_data(a, buff2, sizeof(buff2)));
+ assertA((int)sizeof(buff2) == archive_write_data(a, buff2, sizeof(buff2)));
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/* Now, read back a truncated version of the archive and
@@ -81,7 +81,7 @@ DEFINE_TEST(test_read_truncated)
assertA(ARCHIVE_FATAL == archive_read_data(a, buff2, sizeof(buff2)));
goto wrap_up;
} else {
- assertA(sizeof(buff2) == archive_read_data(a, buff2, sizeof(buff2)));
+ assertA((int)sizeof(buff2) == archive_read_data(a, buff2, sizeof(buff2)));
}
/* Verify the end of the archive. */
@@ -97,10 +97,10 @@ DEFINE_TEST(test_read_truncated)
}
wrap_up:
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
@@ -140,10 +140,10 @@ DEFINE_TEST(test_read_truncated)
}
wrap_up2:
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_uu.c b/archivers/libarchive/files/libarchive/test/test_read_uu.c
new file mode 100644
index 00000000000..a5de09af740
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_uu.c
@@ -0,0 +1,134 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_uu.c 201248 2009-12-30 06:12:03Z kientzle $");
+
+static const char archive[] = {
+"begin 644 test_read_uu.Z\n"
+"M'YV0+@`('$BPH,&#\"!,J7,BP(4(8$&_4J`$\"`,08$F%4O)AQ(\\2/(#7&@#%C\n"
+"M!@T8-##.L`$\"QL@:-F(``%'#H<V;.'/J!%!G#ITP<BS\"H).FS<Z$1(T>/1A2\n"
+"IHU\"0%9=*G4JUJM6K6+-JW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW9P$`\n"
+"`\n"
+"end\n"
+};
+
+static const char archive64[] = {
+"begin-base64 644 test_read_uu.Z\n"
+"H52QLgAIHEiwoMGDCBMqXMiwIUIYEG/UqAECAMQYEmFUvJhxI8SPIDXGgDFjBg0YNDDOsAECxsga\n"
+"NmIAAFHDoc2bOHPqBFBnDp0wcizCoJOmzc6ERI0ePRhSo1CQFZdKnUq1qtWrWLNq3cq1q9evYMOK\n"
+"HUu2rNmzaNOqXcu2rdu3ZwE=\n"
+"====\n"
+};
+
+static const char extradata[] = {
+"From uudecode@libarchive Mon Jun 2 03:03:31 2008\n"
+"Return-Path: <uudecode@libarchive>\n"
+"Received: from libarchive (localhost [127.0.0.1])\n"
+" by libarchive (8.14.2/8.14.2) with ESMTP id m5233UT1006448\n"
+" for <uudecode@libarchive>; Mon, 2 Jun 2008 03:03:31 GMT\n"
+" (envelope-from uudecode@libarchive)\n"
+"Received: (from uudecode@localhost)\n"
+" by libarchive (8.14.2/8.14.2/Submit) id m5233U3e006406\n"
+" for uudecode; Mon, 2 Jun 2008 03:03:30 GMT\n"
+" (envelope-from root)\n"
+"Date: Mon, 2 Jun 2008 03:03:30 GMT\n"
+"From: Libarchive Test <uudecode@libarchive>\n"
+"Message-Id: <200806020303.m5233U3e006406@libarchive>\n"
+"To: uudecode@libarchive\n"
+"Subject: Libarchive uudecode test\n"
+"\n"
+"* Redistribution and use in source and binary forms, with or without\n"
+"* modification, are permitted provided that the following conditions\n"
+"* are met:\n"
+"\n"
+"01234567890abcdeghijklmnopqrstuvwxyz\n"
+"01234567890ABCEFGHIJKLMNOPQRSTUVWXYZ\n"
+"\n"
+};
+
+static void
+test_read_uu_sub(const char *uudata, size_t uusize)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ char *buff;
+ int extra;
+
+ assert(NULL != (buff = malloc(uusize + 64 * 1024)));
+ if (buff == NULL)
+ return;
+ for (extra = 0; extra <= 64; extra = extra==0?1:extra*2) {
+ size_t size = extra * 1024;
+ char *p = buff;
+
+ /* Add extra text size of which is from 1K bytes to
+ * 64Kbytes before uuencoded data. */
+ while (size) {
+ if (size > sizeof(extradata)-1) {
+ memcpy(p, extradata, sizeof(extradata)-1);
+ p += sizeof(extradata)-1;
+ size -= sizeof(extradata)-1;
+ } else {
+ memcpy(p, extradata, size-1);
+ p += size-1;
+ *p++ = '\n';/* the last of extra text must have
+ * '\n' character. */
+ break;
+ }
+ }
+ memcpy(p, uudata, uusize);
+ size = extra * 1024 + uusize;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ read_open_memory(a, buff, size, 2));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ failure("archive_compression_name(a)=\"%s\"",
+ archive_compression_name(a));
+ assertEqualInt(archive_compression(a),
+ ARCHIVE_COMPRESSION_COMPRESS);
+ failure("archive_format_name(a)=\"%s\"",
+ archive_format_name(a));
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ }
+ free(buff);
+}
+
+DEFINE_TEST(test_read_uu)
+{
+ /* Read the traditional uuencoded data. */
+ test_read_uu_sub(archive, sizeof(archive)-1);
+ /* Read the Base64 uuencoded data. */
+ test_read_uu_sub(archive64, sizeof(archive64)-1);
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
index e863fbd23cd..b08373819df 100644
--- a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
+++ b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.9 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.10 2008/09/01 05:38:33 kientzle Exp $");
/*
* Exercise various lengths of filenames in tar archives,
@@ -101,10 +101,10 @@ test_filename(const char *prefix, int dlen, int flen)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/*
@@ -117,7 +117,7 @@ test_filename(const char *prefix, int dlen, int flen)
/* Read the file and check the filename. */
assertA(0 == archive_read_next_header(a, &ae));
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("Leading '/' preserved on long filenames");
#else
assertEqualString(filename, archive_entry_pathname(ae));
@@ -133,7 +133,7 @@ test_filename(const char *prefix, int dlen, int flen)
* here.
*/
assertA(0 == archive_read_next_header(a, &ae));
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("Trailing '/' preserved on dirnames");
#else
assertEqualString(dirname, archive_entry_pathname(ae));
@@ -141,7 +141,7 @@ test_filename(const char *prefix, int dlen, int flen)
assert((S_IFDIR | 0755) == archive_entry_mode(ae));
assertA(0 == archive_read_next_header(a, &ae));
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("Trailing '/' added to dir names");
#else
assertEqualString(dirname, archive_entry_pathname(ae));
@@ -151,10 +151,10 @@ test_filename(const char *prefix, int dlen, int flen)
/* Verify the end of the archive. */
assert(1 == archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_tar_large.c b/archivers/libarchive/files/libarchive/test/test_tar_large.c
index df8a1399ad9..adc81551cec 100644
--- a/archivers/libarchive/files/libarchive/test/test_tar_large.c
+++ b/archivers/libarchive/files/libarchive/test/test_tar_large.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_large.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_tar_large.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <errno.h>
#include <stdlib.h>
@@ -53,7 +53,7 @@ struct memblock {
struct memblock *next;
size_t size;
void *buff;
- off_t filebytes;
+ int64_t filebytes;
};
/*
@@ -61,19 +61,19 @@ struct memblock {
* some accounting overhead.
*/
struct memdata {
- off_t filebytes;
+ int64_t filebytes;
void *buff;
struct memblock *first;
struct memblock *last;
};
/* The following size definitions simplify things below. */
-#define KB ((off_t)1024)
-#define MB ((off_t)1024 * KB)
-#define GB ((off_t)1024 * MB)
-#define TB ((off_t)1024 * GB)
+#define KB ((int64_t)1024)
+#define MB ((int64_t)1024 * KB)
+#define GB ((int64_t)1024 * MB)
+#define TB ((int64_t)1024 * GB)
-#if ARCHIVE_API_VERSION < 2
+#if ARCHIVE_VERSION_NUMBER < 2000000
static ssize_t memory_read_skip(struct archive *, void *, size_t request);
#else
static off_t memory_read_skip(struct archive *, void *, off_t request);
@@ -100,7 +100,7 @@ memory_write(struct archive *a, void *_private, const void *buff, size_t size)
if ((const char *)filedata <= (const char *)buff
&& (const char *)buff < (const char *)filedata + filedatasize) {
/* We don't need to store a block of file data. */
- private->last->filebytes += size;
+ private->last->filebytes += (int64_t)size;
} else {
/* Yes, we're assuming the very first write is metadata. */
/* It's header or metadata, copy and save it. */
@@ -117,7 +117,7 @@ memory_write(struct archive *a, void *_private, const void *buff, size_t size)
}
block->next = NULL;
}
- return (size);
+ return ((long)size);
}
static ssize_t
@@ -140,8 +140,8 @@ memory_read(struct archive *a, void *_private, const void **buff)
* We're returning file bytes, simulate it by
* passing blocks from the template data.
*/
- if (private->filebytes > (off_t)filedatasize)
- size = filedatasize;
+ if (private->filebytes > (int64_t)filedatasize)
+ size = (ssize_t)filedatasize;
else
size = (ssize_t)private->filebytes;
private->filebytes -= size;
@@ -152,7 +152,7 @@ memory_read(struct archive *a, void *_private, const void **buff)
*/
block = private->first;
private->first = block->next;
- size = block->size;
+ size = (ssize_t)block->size;
if (block->buff != NULL) {
private->buff = block->buff;
*buff = block->buff;
@@ -167,7 +167,7 @@ memory_read(struct archive *a, void *_private, const void **buff)
}
-#if ARCHIVE_API_VERSION < 2
+#if ARCHIVE_VERSION_NUMBER < 2000000
static ssize_t
memory_read_skip(struct archive *a, void *private, size_t skip)
{
@@ -179,7 +179,6 @@ memory_read_skip(struct archive *a, void *private, size_t skip)
#else
static off_t
memory_read_skip(struct archive *a, void *_private, off_t skip)
-#endif
{
struct memdata *private = _private;
@@ -191,18 +190,19 @@ memory_read_skip(struct archive *a, void *_private, off_t skip)
}
if (private->filebytes > 0) {
if (private->filebytes < skip)
- skip = private->filebytes;
+ skip = (off_t)private->filebytes;
private->filebytes -= skip;
} else {
skip = 0;
}
return (skip);
}
+#endif
DEFINE_TEST(test_tar_large)
{
/* The sizes of the entries we're going to generate. */
- static off_t tests[] = {
+ static int64_t tests[] = {
/* Test for 32-bit signed overflow. */
2 * GB - 1, 2 * GB, 2 * GB + 1,
/* Test for 32-bit unsigned overflow. */
@@ -218,9 +218,10 @@ DEFINE_TEST(test_tar_large)
struct memdata memdata;
struct archive_entry *ae;
struct archive *a;
- off_t filesize, writesize;
+ int64_t filesize;
+ size_t writesize;
- filedatasize = 1 * MB;
+ filedatasize = (size_t)(1 * MB);
filedata = malloc(filedatasize);
memset(filedata, 0xAA, filedatasize);
memset(&memdata, 0, sizeof(memdata));
@@ -236,17 +237,13 @@ DEFINE_TEST(test_tar_large)
/*
* Write a series of large files to it.
*/
- for (i = 0; tests[i] > 0; i++) {
+ for (i = 0; tests[i] != 0; i++) {
assert((ae = archive_entry_new()) != NULL);
sprintf(namebuff, "file_%d", i);
archive_entry_copy_pathname(ae, namebuff);
archive_entry_set_mode(ae, S_IFREG | 0755);
filesize = tests[i];
- if (filesize < 0) {
- skipping("32-bit off_t doesn't permit testing of very large files.");
- return;
- }
archive_entry_set_size(ae, filesize);
assertA(0 == archive_write_header(a, ae));
@@ -257,9 +254,10 @@ DEFINE_TEST(test_tar_large)
*/
while (filesize > 0) {
writesize = filedatasize;
- if (writesize > filesize)
- writesize = filesize;
- assertA(writesize == archive_write_data(a, filedata, writesize));
+ if ((int64_t)writesize > filesize)
+ writesize = (size_t)filesize;
+ assertA((int)writesize
+ == archive_write_data(a, filedata, writesize));
filesize -= writesize;
}
}
@@ -273,10 +271,10 @@ DEFINE_TEST(test_tar_large)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/*
@@ -303,10 +301,10 @@ DEFINE_TEST(test_tar_large)
/* Close out the archive. */
assertA(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertA(0 == archive_read_finish(a));
#endif
free(memdata.buff);
diff --git a/archivers/libarchive/files/libarchive/test/test_ustar_filenames.c b/archivers/libarchive/files/libarchive/test/test_ustar_filenames.c
index 88b4b2c4ac4..e3ebf3c92f0 100644
--- a/archivers/libarchive/files/libarchive/test/test_ustar_filenames.c
+++ b/archivers/libarchive/files/libarchive/test/test_ustar_filenames.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_ustar_filenames.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Exercise various lengths of filenames in ustar archives.
@@ -43,7 +43,7 @@ test_filename(const char *prefix, int dlen, int flen)
if (prefix != NULL) {
strcpy(filename, prefix);
- i = strlen(prefix);
+ i = (int)strlen(prefix);
}
if (dlen > 0) {
for (; i < dlen; i++)
@@ -53,7 +53,7 @@ test_filename(const char *prefix, int dlen, int flen)
}
for (; i < dlen + flen + separator; i++)
filename[i] = 'b';
- filename[i++] = '\0';
+ filename[i] = '\0';
strcpy(dirname, filename);
@@ -111,7 +111,11 @@ test_filename(const char *prefix, int dlen, int flen)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
- assertA(0 == archive_write_finish(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
+ assertEqualInt(0, archive_write_finish(a));
+#endif
/*
* Now, read the data back.
@@ -153,7 +157,11 @@ test_filename(const char *prefix, int dlen, int flen)
failure("This fails if entries were written that should not have been written. dlen=%d, flen=%d", dlen, flen);
assertEqualInt(1, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
- assert(0 == archive_read_finish(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
+ assertEqualInt(0, archive_read_finish(a));
+#endif
}
DEFINE_TEST(test_ustar_filenames)
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress.c b/archivers/libarchive/files/libarchive/test/test_write_compress.c
index 6f8ef3565fe..aa590de8a91 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_compress.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress.c
@@ -25,7 +25,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress.c,v 1.2 2008/03/15 11:05:49 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* A basic exercise of compress reading and writing.
@@ -68,10 +68,10 @@ DEFINE_TEST(test_write_compress)
archive_write_close(a);
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assert(0 == archive_write_finish(a));
#endif
/*
@@ -85,16 +85,16 @@ DEFINE_TEST(test_write_compress)
for (i = 0; i < 100; i++) {
sprintf(path, "file%03d", i);
- assertEqualInt(0, archive_read_next_header(a, &ae));
+ if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
+ break;
assertEqualString(path, archive_entry_pathname(ae));
- assertEqualInt(datasize, archive_entry_size(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
}
-
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
free(data);
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress_bzip2.c b/archivers/libarchive/files/libarchive/test/test_write_compress_bzip2.c
new file mode 100644
index 00000000000..ee6954022aa
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress_bzip2.c
@@ -0,0 +1,228 @@
+/*-
+ * Copyright (c) 2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_bzip2.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * A basic exercise of bzip2 reading and writing.
+ *
+ * TODO: Add a reference file and make sure we can decompress that.
+ */
+
+DEFINE_TEST(test_write_compress_bzip2)
+{
+ struct archive_entry *ae;
+ struct archive* a;
+ char *buff, *data;
+ size_t buffsize, datasize;
+ char path[16];
+ size_t used1, used2;
+ int i, r;
+
+ buffsize = 2000000;
+ assert(NULL != (buff = (char *)malloc(buffsize)));
+
+ datasize = 10000;
+ assert(NULL != (data = (char *)malloc(datasize)));
+ memset(data, 0, datasize);
+
+ /*
+ * Write a 100 files and read them all back.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ r = archive_write_set_compression_bzip2(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("bzip2 writing not supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertEqualInt(ARCHIVE_COMPRESSION_BZIP2, archive_compression(a));
+ assertEqualString("bzip2", archive_compression_name(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used1));
+ assertEqualInt(ARCHIVE_COMPRESSION_BZIP2, archive_compression(a));
+ assertEqualString("bzip2", archive_compression_name(a));
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_size(ae, datasize);
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ archive_entry_copy_pathname(ae, path);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize
+ == (size_t)archive_write_data(a, data, datasize));
+ }
+ archive_entry_free(ae);
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ assertA(0 == archive_read_open_memory(a, buff, used1));
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assert(0 == archive_read_close(a));
+ assert(0 == archive_read_finish(a));
+
+ /*
+ * Repeat the cycle again, this time setting some compression
+ * options.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_bzip2(a));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "nonexistent-option=0"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=abc"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=99"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=9"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize == (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Curiously, this test fails; the test data above compresses
+ * better at default compression than at level 9. */
+ /*
+ failure("compression-level=9 wrote %d bytes, default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 < used1);
+ */
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ assertA(0 == archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assert(0 == archive_read_close(a));
+ assert(0 == archive_read_finish(a));
+
+ /*
+ * Repeat again, with much lower compression.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_bzip2(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=1"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ failure("Writing file %s", path);
+ assertEqualIntA(a, datasize,
+ (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Level 0 really does result in larger data. */
+ failure("Compression-level=0 wrote %d bytes; default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 > used1);
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ assertA(0 == archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 999; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assert(0 == archive_read_close(a));
+ assert(0 == archive_read_finish(a));
+
+ /*
+ * Test various premature shutdown scenarios to make sure we
+ * don't crash or leak memory.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_bzip2(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_bzip2(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_bzip2(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_bzip2(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Clean up.
+ */
+ free(data);
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress_gzip.c b/archivers/libarchive/files/libarchive/test/test_write_compress_gzip.c
new file mode 100644
index 00000000000..ec55c8db646
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress_gzip.c
@@ -0,0 +1,252 @@
+/*-
+ * Copyright (c) 2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * A basic exercise of gzip reading and writing.
+ *
+ * TODO: Add a reference file and make sure we can decompress that.
+ */
+
+DEFINE_TEST(test_write_compress_gzip)
+{
+ struct archive_entry *ae;
+ struct archive* a;
+ char *buff, *data;
+ size_t buffsize, datasize;
+ char path[16];
+ size_t used1, used2;
+ int i, r;
+
+ buffsize = 2000000;
+ assert(NULL != (buff = (char *)malloc(buffsize)));
+
+ datasize = 10000;
+ assert(NULL != (data = (char *)malloc(datasize)));
+ memset(data, 0, datasize);
+
+ /*
+ * Write a 100 files and read them all back.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ r = archive_write_set_compression_gzip(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("gzip writing not supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertEqualInt(ARCHIVE_COMPRESSION_GZIP, archive_compression(a));
+ assertEqualString("gzip", archive_compression_name(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used1));
+ assertEqualInt(ARCHIVE_COMPRESSION_GZIP, archive_compression(a));
+ assertEqualString("gzip", archive_compression_name(a));
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_size(ae, datasize);
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ archive_entry_copy_pathname(ae, path);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize
+ == (size_t)archive_write_data(a, data, datasize));
+ }
+ archive_entry_free(ae);
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("Can't verify gzip writing by reading back;"
+ " gzip reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used1));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat the cycle again, this time setting some compression
+ * options.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_gzip(a));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "nonexistent-option=0"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=abc"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=99"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=9"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize == (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Curiously, this test fails; the test data above compresses
+ * better at default compression than at level 9. */
+ /*
+ failure("compression-level=9 wrote %d bytes, default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 < used1);
+ */
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat again, with much lower compression.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_gzip(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=0"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ failure("Writing file %s", path);
+ assertEqualIntA(a, datasize,
+ (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Level 0 really does result in larger data. */
+ failure("Compression-level=0 wrote %d bytes; default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 > used1);
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("gzip reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Test various premature shutdown scenarios to make sure we
+ * don't crash or leak memory.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_gzip(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_gzip(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_gzip(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_gzip(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Clean up.
+ */
+ free(data);
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress_lzma.c b/archivers/libarchive/files/libarchive/test/test_write_compress_lzma.c
new file mode 100644
index 00000000000..0b456910dae
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress_lzma.c
@@ -0,0 +1,245 @@
+/*-
+ * Copyright (c) 2007-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_lzma.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * A basic exercise of lzma reading and writing.
+ *
+ */
+
+DEFINE_TEST(test_write_compress_lzma)
+{
+ struct archive_entry *ae;
+ struct archive* a;
+ char *buff, *data;
+ size_t buffsize, datasize;
+ char path[16];
+ size_t used1, used2;
+ int i, r;
+
+ buffsize = 2000000;
+ assert(NULL != (buff = (char *)malloc(buffsize)));
+
+ datasize = 10000;
+ assert(NULL != (data = (char *)malloc(datasize)));
+ memset(data, 0, datasize);
+
+ /*
+ * Write a 100 files and read them all back.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ r = archive_write_set_compression_lzma(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("lzma writing not supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertEqualInt(ARCHIVE_COMPRESSION_LZMA, archive_compression(a));
+ assertEqualString("lzma", archive_compression_name(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used1));
+ assertEqualInt(ARCHIVE_COMPRESSION_LZMA, archive_compression(a));
+ assertEqualString("lzma", archive_compression_name(a));
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_size(ae, datasize);
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ archive_entry_copy_pathname(ae, path);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize
+ == (size_t)archive_write_data(a, data, datasize));
+ }
+ archive_entry_free(ae);
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("Can't verify lzma writing by reading back;"
+ " lzma reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used1));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat the cycle again, this time setting some compression
+ * options.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_lzma(a));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "nonexistent-option=0"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=abc"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=99"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=9"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize == (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ failure("Trying to read %s", path);
+ if (!assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat again, with much lower compression.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_lzma(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=0"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ failure("Writing file %s", path);
+ assertEqualIntA(a, datasize,
+ (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Level 0 really does result in larger data. */
+ failure("Compression-level=0 wrote %d bytes; default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 > used1);
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ r = archive_read_support_compression_lzma(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzma reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Test various premature shutdown scenarios to make sure we
+ * don't crash or leak memory.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_lzma(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_lzma(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_lzma(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_lzma(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Clean up.
+ */
+ free(data);
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress_program.c b/archivers/libarchive/files/libarchive/test/test_write_compress_program.c
index 666bbf9231d..bae77e5341b 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_compress_program.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress_program.c
@@ -23,26 +23,38 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress_program.c,v 1.2 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $");
char buff[1000000];
char buff2[64];
DEFINE_TEST(test_write_compress_program)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("archive_write_set_compress_program()");
#else
struct archive_entry *ae;
struct archive *a;
size_t used;
int blocksize = 1024;
+ int r;
+
+ if (!canGzip()) {
+ skipping("Cannot run 'gzip'");
+ return;
+ }
/* Create a new archive in memory. */
/* Write it through an external "gzip" program. */
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ustar(a));
- assertA(0 == archive_write_set_compression_program(a, "gzip"));
+ r = archive_write_set_compression_program(a, "gzip");
+ if (r == ARCHIVE_FATAL) {
+ skipping("Write compression via external "
+ "program unsupported on this platform");
+ archive_write_finish(a);
+ return;
+ }
assertA(0 == archive_write_set_bytes_per_block(a, blocksize));
assertA(0 == archive_write_set_bytes_in_last_block(a, blocksize));
assertA(blocksize == archive_write_get_bytes_in_last_block(a));
@@ -64,38 +76,43 @@ DEFINE_TEST(test_write_compress_program)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
/*
* Now, read the data back through the built-in gzip support.
*/
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_open_memory(a, buff, used));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ r = archive_read_support_compression_gzip(a);
+ /* The compression_gzip() handler will fall back to gunzip
+ * automatically, but if we know gunzip isn't available, then
+ * skip the rest. */
+ if (r != ARCHIVE_OK && !canGunzip()) {
+ skipping("No libz and no gunzip program, "
+ "unable to verify gzip compression");
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
- assertA(0 == archive_read_next_header(a, &ae));
+ if (!assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae))) {
+ archive_read_finish(a);
+ return;
+ }
- assert(1 == archive_entry_mtime(ae));
- assert(0 == archive_entry_atime(ae));
- assert(0 == archive_entry_ctime(ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file", archive_entry_pathname(ae));
- assert((S_IFREG | 0755) == archive_entry_mode(ae));
- assert(8 == archive_entry_size(ae));
- assertA(8 == archive_read_data(a, buff2, 10));
- assert(0 == memcmp(buff2, "12345678", 8));
+ assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
/* Verify the end of the archive. */
- assert(1 == archive_read_next_header(a, &ae));
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
- archive_read_finish(a);
-#endif
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_compress_xz.c b/archivers/libarchive/files/libarchive/test/test_write_compress_xz.c
new file mode 100644
index 00000000000..88db2e66898
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_compress_xz.c
@@ -0,0 +1,253 @@
+/*-
+ * Copyright (c) 2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+/*
+ * A basic exercise of xz reading and writing.
+ *
+ * TODO: Add a reference file and make sure we can decompress that.
+ */
+
+DEFINE_TEST(test_write_compress_xz)
+{
+ struct archive_entry *ae;
+ struct archive* a;
+ char *buff, *data;
+ size_t buffsize, datasize;
+ char path[16];
+ size_t used1, used2;
+ int i, r;
+
+ buffsize = 2000000;
+ assert(NULL != (buff = (char *)malloc(buffsize)));
+
+ datasize = 10000;
+ assert(NULL != (data = (char *)malloc(datasize)));
+ memset(data, 0, datasize);
+
+ /*
+ * Write a 100 files and read them all back.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ r = archive_write_set_compression_xz(a);
+ if (r == ARCHIVE_FATAL) {
+ skipping("xz writing not supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertEqualInt(ARCHIVE_COMPRESSION_XZ, archive_compression(a));
+ assertEqualString("xz", archive_compression_name(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used1));
+ assertEqualInt(ARCHIVE_COMPRESSION_XZ, archive_compression(a));
+ assertEqualString("xz", archive_compression_name(a));
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_size(ae, datasize);
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ archive_entry_copy_pathname(ae, path);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize
+ == (size_t)archive_write_data(a, data, datasize));
+ }
+ archive_entry_free(ae);
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("Can't verify xz writing by reading back;"
+ " xz reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used1));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat the cycle again, this time setting some compression
+ * options.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_xz(a));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "nonexistent-option=0"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=abc"));
+ assertEqualIntA(a, ARCHIVE_WARN,
+ archive_write_set_compressor_options(a, "compression-level=99"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=9"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ assertA(datasize == (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Curiously, this test fails; the test data above compresses
+ * better at default compression than at level 9. */
+ /*
+ failure("compression-level=9 wrote %d bytes, default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 < used1);
+ */
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xz reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ failure("Trying to read %s", path);
+ if (!assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Repeat again, with much lower compression.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_bytes_per_block(a, 10));
+ assertA(0 == archive_write_set_compression_xz(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_compressor_options(a, "compression-level=0"));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, path);
+ archive_entry_set_size(ae, datasize);
+ archive_entry_set_filetype(ae, AE_IFREG);
+ assertA(0 == archive_write_header(a, ae));
+ failure("Writing file %s", path);
+ assertEqualIntA(a, datasize,
+ (size_t)archive_write_data(a, data, datasize));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+ assert(0 == archive_write_finish(a));
+
+ /* Level 0 really does result in larger data. */
+ failure("Compression-level=0 wrote %d bytes; default wrote %d bytes",
+ (int)used2, (int)used1);
+ assert(used2 > used1);
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_compression_all(a));
+ r = archive_read_support_compression_xz(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("xz reading not fully supported on this platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used2));
+ for (i = 0; i < 100; i++) {
+ sprintf(path, "file%03d", i);
+ if (!assertEqualInt(ARCHIVE_OK,
+ archive_read_next_header(a, &ae)))
+ break;
+ assertEqualString(path, archive_entry_pathname(ae));
+ assertEqualInt((int)datasize, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ }
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+
+ /*
+ * Test various premature shutdown scenarios to make sure we
+ * don't crash or leak memory.
+ */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_xz(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_xz(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_xz(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_xz(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used2));
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Clean up.
+ */
+ free(data);
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk.c b/archivers/libarchive/files/libarchive/test/test_write_disk.c
index fe44a4538e2..169f4f23996 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk.c
@@ -23,11 +23,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk.c,v 1.9 2008/06/15 10:35:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk.c 201247 2009-12-30 05:59:21Z kientzle $");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
#define UMASK 022
+/*
+ * When comparing mode values, ignore high-order bits
+ * that are set on some OSes. This should cover the bits
+ * we're interested in (standard mode bits + file type bits)
+ * while ignoring extra markers such as Haiku/BeOS index
+ * flags.
+ */
+#define MODE_MASK 0777777
static void create(struct archive_entry *ae, const char *msg)
{
@@ -39,30 +47,33 @@ static void create(struct archive_entry *ae, const char *msg)
failure("%s", msg);
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
-#if ARCHIVE_API_VERSION > 1
- assertEqualInt(0, archive_write_finish(ad));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(ad);
+#else
+ assertEqualInt(0, archive_write_finish(ad));
#endif
/* Test the entries on disk. */
assert(0 == stat(archive_entry_pathname(ae), &st));
- failure("st.st_mode=%o archive_entry_mode(ae)=%o",
- st.st_mode, archive_entry_mode(ae));
+ failure("%s", msg);
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
/* When verifying a dir, ignore the S_ISGID bit, as some systems set
* that automatically. */
if (archive_entry_filetype(ae) == AE_IFDIR)
st.st_mode &= ~S_ISGID;
- assertEqualInt(st.st_mode, archive_entry_mode(ae) & ~UMASK);
+ assertEqualInt(st.st_mode & MODE_MASK,
+ archive_entry_mode(ae) & ~UMASK & MODE_MASK);
+#endif
}
static void create_reg_file(struct archive_entry *ae, const char *msg)
{
static const char data[]="abcdefghijklmnopqrstuvwxyz";
struct archive *ad;
- struct stat st;
/* Write the entry to disk. */
assert((ad = archive_write_disk_new()) != NULL);
+ archive_write_disk_set_options(ad, ARCHIVE_EXTRACT_TIME);
failure("%s", msg);
/*
* A touchy API design issue: archive_write_data() does (as of
@@ -82,30 +93,30 @@ static void create_reg_file(struct archive_entry *ae, const char *msg)
* the entry being a maximum size.
*/
archive_entry_set_size(ae, sizeof(data));
+ archive_entry_set_mtime(ae, 123456789, 0);
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
-#if ARCHIVE_API_VERSION > 1
- assertEqualInt(0, archive_write_finish(ad));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(ad);
+#else
+ assertEqualInt(0, archive_write_finish(ad));
#endif
/* Test the entries on disk. */
- assert(0 == stat(archive_entry_pathname(ae), &st));
- failure("st.st_mode=%o archive_entry_mode(ae)=%o",
- st.st_mode, archive_entry_mode(ae));
- assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK));
- assertEqualInt(st.st_size, sizeof(data));
+ assertIsReg(archive_entry_pathname(ae), archive_entry_mode(ae) & 0777);
+ assertFileSize(archive_entry_pathname(ae), sizeof(data));
+ /* test_write_disk_times has more detailed tests of this area. */
+ assertFileMtime(archive_entry_pathname(ae), 123456789, 0);
+ failure("No atime given, so atime should get set to current time");
+ assertFileAtimeRecent(archive_entry_pathname(ae));
}
static void create_reg_file2(struct archive_entry *ae, const char *msg)
{
const int datasize = 100000;
char *data;
- char *compare;
struct archive *ad;
- struct stat st;
- int i, fd;
+ int i;
data = malloc(datasize);
for (i = 0; i < datasize; i++)
@@ -125,37 +136,124 @@ static void create_reg_file2(struct archive_entry *ae, const char *msg)
archive_write_data_block(ad, data + i, 1000, i));
}
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
-#if ARCHIVE_API_VERSION > 1
assertEqualInt(0, archive_write_finish(ad));
+
+ /* Test the entries on disk. */
+ assertIsReg(archive_entry_pathname(ae), archive_entry_mode(ae) & 0777);
+ assertFileSize(archive_entry_pathname(ae), i);
+ assertFileContents(data, datasize, archive_entry_pathname(ae));
+ free(data);
+}
+
+static void create_reg_file3(struct archive_entry *ae, const char *msg)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct archive *ad;
+ struct stat st;
+
+ /* Write the entry to disk. */
+ assert((ad = archive_write_disk_new()) != NULL);
+ failure("%s", msg);
+ /* Set the size smaller than the data and verify the truncation. */
+ archive_entry_set_size(ae, 5);
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(5, archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(ad);
#else
+ assertEqualInt(0, archive_write_finish(ad));
+#endif
+ /* Test the entry on disk. */
+ assert(0 == stat(archive_entry_pathname(ae), &st));
+ failure("st.st_mode=%o archive_entry_mode(ae)=%o",
+ st.st_mode, archive_entry_mode(ae));
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK));
+#endif
+ assertEqualInt(st.st_size, 5);
+}
+
+
+static void create_reg_file4(struct archive_entry *ae, const char *msg)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct archive *ad;
+ struct stat st;
+
+ /* Write the entry to disk. */
+ assert((ad = archive_write_disk_new()) != NULL);
+ /* Leave the size unset. The data should not be truncated. */
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(ARCHIVE_OK,
+ archive_write_data_block(ad, data, sizeof(data), 0));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(ad);
+#else
+ assertEqualInt(0, archive_write_finish(ad));
#endif
- /* Test the entries on disk. */
+ /* Test the entry on disk. */
assert(0 == stat(archive_entry_pathname(ae), &st));
failure("st.st_mode=%o archive_entry_mode(ae)=%o",
st.st_mode, archive_entry_mode(ae));
+#if !defined(_WIN32) || defined(__CYGWIN__)
assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK));
- assertEqualInt(st.st_size, i);
-
- compare = malloc(datasize);
- fd = open(archive_entry_pathname(ae), O_RDONLY);
- assertEqualInt(datasize, read(fd, compare, datasize));
- close(fd);
- assert(memcmp(compare, data, datasize) == 0);
- free(compare);
- free(data);
+#endif
+ failure(msg);
+ assertEqualInt(st.st_size, sizeof(data));
+}
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static void create_reg_file_win(struct archive_entry *ae, const char *msg)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct archive *ad;
+ struct stat st;
+ char *p, *fname;
+ size_t l;
+
+ /* Write the entry to disk. */
+ assert((ad = archive_write_disk_new()) != NULL);
+ archive_write_disk_set_options(ad, ARCHIVE_EXTRACT_TIME);
+ failure("%s", msg);
+ archive_entry_set_size(ae, sizeof(data));
+ archive_entry_set_mtime(ae, 123456789, 0);
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(ad);
+#else
+ assertEqualInt(0, archive_write_finish(ad));
+#endif
+ /* Test the entries on disk. */
+ l = strlen(archive_entry_pathname(ae));
+ fname = malloc(l + 1);
+ assert(NULL != fname);
+ strcpy(fname, archive_entry_pathname(ae));
+ /* Replace unusable characters in Windows to '_' */
+ for (p = fname; *p != '\0'; p++)
+ if (*p == ':' || *p == '*' || *p == '?' ||
+ *p == '"' || *p == '<' || *p == '>' || *p == '|')
+ *p = '_';
+ assert(0 == stat(fname, &st));
+ failure("st.st_mode=%o archive_entry_mode(ae)=%o",
+ st.st_mode, archive_entry_mode(ae));
+ assertEqualInt(st.st_size, sizeof(data));
}
+#endif /* _WIN32 && !__CYGWIN__ */
#endif
DEFINE_TEST(test_write_disk)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("archive_write_disk interface");
#else
struct archive_entry *ae;
/* Force the umask to something predictable. */
- umask(UMASK);
+ assertUmask(UMASK);
/* A regular file. */
assert((ae = archive_entry_new()) != NULL);
@@ -171,6 +269,20 @@ DEFINE_TEST(test_write_disk)
create_reg_file2(ae, "Test creating another regular file");
archive_entry_free(ae);
+ /* A regular file with a size restriction */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file3");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ create_reg_file3(ae, "Regular file with size restriction");
+ archive_entry_free(ae);
+
+ /* A regular file with an unspecified size */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file3");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ create_reg_file4(ae, "Regular file with unspecified size");
+ archive_entry_free(ae);
+
/* A regular file over an existing file */
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "file");
@@ -198,5 +310,23 @@ DEFINE_TEST(test_write_disk)
archive_entry_set_mode(ae, S_IFREG | 0744);
create(ae, "Test creating a file over an existing dir.");
archive_entry_free(ae);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* A file with unusable characters in its file name. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "f:i*l?e\"f<i>l|e");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ create_reg_file_win(ae, "Test creating a regular file"
+ " with unusable characters in its file name");
+ archive_entry_free(ae);
+
+ /* A file with unusable characters in its directory name. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "d:i*r?e\"c<t>o|ry/file1");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ create_reg_file_win(ae, "Test creating a regular file"
+ " with unusable characters in its file name");
+ archive_entry_free(ae);
+#endif /* _WIN32 && !__CYGWIN__ */
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_failures.c b/archivers/libarchive/files/libarchive/test/test_write_disk_failures.c
new file mode 100644
index 00000000000..991fa3d4fe6
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_failures.c
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_failures.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
+
+#define UMASK 022
+
+
+#endif
+
+DEFINE_TEST(test_write_disk_failures)
+{
+#if ARCHIVE_VERSION_NUMBER < 1009000 || (defined(_WIN32) && !defined(__CYGWIN__))
+ skipping("archive_write_disk interface");
+#else
+ struct archive_entry *ae;
+ struct archive *a;
+ int fd;
+
+ /* Force the umask to something predictable. */
+ assertUmask(UMASK);
+
+ /* A directory that we can't write to. */
+ assertMakeDir("dir", 0555);
+
+ /* Can we? */
+ fd = open("dir/testfile", O_WRONLY | O_CREAT | O_BINARY, 0777);
+ if (fd >= 0) {
+ /* Apparently, we can, so the test below won't work. */
+ close(fd);
+ skipping("Can't test writing to non-writable directory");
+ return;
+ }
+
+ /* Try to extract a regular file into the directory above. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "dir/file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assert((a = archive_write_disk_new()) != NULL);
+ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_TIME);
+ archive_entry_set_mtime(ae, 123456789, 0);
+ assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, ae));
+ assertEqualIntA(a, 0, archive_write_finish_entry(a));
+ assertEqualInt(0, archive_write_finish(a));
+ archive_entry_free(ae);
+#endif
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c b/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c
index dda384a85a1..934aa08d578 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c
@@ -23,9 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_hardlink.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_hardlink.c 201247 2009-12-30 05:59:21Z kientzle $");
+#if defined(_WIN32) && !defined(__CYGWIN__)
+/* Execution bits, Group members bits and others bits do not work. */
+#define UMASK 0177
+#define E_MASK (~0177)
+#else
#define UMASK 022
+#define E_MASK (~0)
+#endif
/*
* Exercise hardlink recreation.
@@ -36,16 +43,16 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_hardlink.c,v 1.2 200
*/
DEFINE_TEST(test_write_disk_hardlink)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("archive_write_disk_hardlink tests");
+#if defined(__HAIKU__)
+ skipping("archive_write_disk_hardlink; hardlinks are not supported on bfs");
#else
static const char data[]="abcdefghijklmnopqrstuvwxyz";
struct archive *ad;
struct archive_entry *ae;
- struct stat st, st2;
+ int r;
/* Force the umask to something predictable. */
- umask(UMASK);
+ assertUmask(UMASK);
/* Write entries to disk. */
assert((ad = archive_write_disk_new()) != NULL);
@@ -61,21 +68,55 @@ DEFINE_TEST(test_write_disk_hardlink)
archive_entry_set_mode(ae, S_IFREG | 0755);
archive_entry_set_size(ae, sizeof(data));
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
- assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
archive_entry_free(ae);
- /* Link. */
+ /* Link. Size of zero means this doesn't carry data. */
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "link1b");
- archive_entry_set_mode(ae, S_IFREG | 0600);
+ archive_entry_set_mode(ae, S_IFREG | 0642);
archive_entry_set_size(ae, 0);
archive_entry_copy_hardlink(ae, "link1a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r >= ARCHIVE_WARN) {
+ assertEqualInt(ARCHIVE_WARN,
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ }
+ archive_entry_free(ae);
+
+ /*
+ * Repeat tar approach test, but use unset to mark the
+ * hardlink as having no data.
+ */
+
+ /* Regular file. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2a");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
- assertEqualInt(0, archive_write_data(ad, data, sizeof(data)));
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
archive_entry_free(ae);
+ /* Link. Unset size means this doesn't carry data. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2b");
+ archive_entry_set_mode(ae, S_IFREG | 0642);
+ archive_entry_unset_size(ae);
+ archive_entry_copy_hardlink(ae, "link2a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r >= ARCHIVE_WARN) {
+ assertEqualInt(ARCHIVE_WARN,
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ }
+ archive_entry_free(ae);
+
/*
* Second, try an old-cpio-like approach; a regular file, then
* another identical one (which has been marked hardlink).
@@ -83,7 +124,7 @@ DEFINE_TEST(test_write_disk_hardlink)
/* Regular file. */
assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "link2a");
+ archive_entry_copy_pathname(ae, "link3a");
archive_entry_set_mode(ae, S_IFREG | 0600);
archive_entry_set_size(ae, sizeof(data));
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
@@ -93,13 +134,16 @@ DEFINE_TEST(test_write_disk_hardlink)
/* Link. */
assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "link2b");
+ archive_entry_copy_pathname(ae, "link3b");
archive_entry_set_mode(ae, S_IFREG | 0755);
archive_entry_set_size(ae, sizeof(data));
- archive_entry_copy_hardlink(ae, "link2a");
- assertEqualIntA(ad, 0, archive_write_header(ad, ae));
- assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
- assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_copy_hardlink(ae, "link3a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r > ARCHIVE_WARN) {
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ }
archive_entry_free(ae);
/*
@@ -109,7 +153,7 @@ DEFINE_TEST(test_write_disk_hardlink)
/* Regular file. */
assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "link3a");
+ archive_entry_copy_pathname(ae, "link4a");
archive_entry_set_mode(ae, S_IFREG | 0600);
archive_entry_set_size(ae, 0);
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
@@ -123,51 +167,53 @@ DEFINE_TEST(test_write_disk_hardlink)
/* Link. */
assert((ae = archive_entry_new()) != NULL);
- archive_entry_copy_pathname(ae, "link3b");
+ archive_entry_copy_pathname(ae, "link4b");
archive_entry_set_mode(ae, S_IFREG | 0755);
archive_entry_set_size(ae, sizeof(data));
- archive_entry_copy_hardlink(ae, "link3a");
- assertEqualIntA(ad, 0, archive_write_header(ad, ae));
- assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
- assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_copy_hardlink(ae, "link4a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r > ARCHIVE_FAILED) {
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ }
archive_entry_free(ae);
assertEqualInt(0, archive_write_finish(ad));
/* Test the entries on disk. */
- assert(0 == stat("link1a", &st));
- assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st.st_size, sizeof(data));
- assertEqualInt(st.st_nlink, 2);
-
- assert(0 == stat("link1b", &st2));
- assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st2.st_size, sizeof(data));
- assertEqualInt(st2.st_nlink, 2);
- assertEqualInt(st.st_ino, st2.st_ino);
- assertEqualInt(st.st_dev, st2.st_dev);
-
- assert(0 == stat("link2a", &st));
- assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st.st_size, sizeof(data));
- assertEqualInt(st.st_nlink, 2);
-
- assert(0 == stat("link2b", &st2));
- assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st2.st_size, sizeof(data));
- assertEqualInt(st2.st_nlink, 2);
- assertEqualInt(st.st_ino, st2.st_ino);
- assertEqualInt(st.st_dev, st2.st_dev);
-
- assert(0 == stat("link3a", &st));
- assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st.st_size, sizeof(data));
- assertEqualInt(st.st_nlink, 2);
-
- assert(0 == stat("link3b", &st2));
- assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
- assertEqualInt(st2.st_size, sizeof(data));
- assertEqualInt(st2.st_nlink, 2);
- assertEqualInt(st.st_ino, st2.st_ino);
- assertEqualInt(st.st_dev, st2.st_dev);
+
+ /* Test #1 */
+ /* If the hardlink was successfully created and the archive
+ * doesn't carry data for it, we consider it to be
+ * non-authoritive for meta data as well. This is consistent
+ * with GNU tar and BSD pax. */
+ assertIsReg("link1a", 0755 & ~UMASK);
+ assertFileSize("link1a", sizeof(data));
+ assertFileNLinks("link1a", 2);
+ assertIsHardlink("link1a", "link1b");
+
+ /* Test #2: Should produce identical results to test #1 */
+ /* Note that marking a hardlink with size = 0 is treated the
+ * same as having an unset size. This is partly for backwards
+ * compatibility (we used to not have unset tracking, so
+ * relied on size == 0) and partly to match the model used by
+ * common file formats that store a size of zero for
+ * hardlinks. */
+ assertIsReg("link2a", 0755 & ~UMASK);
+ assertFileSize("link2a", sizeof(data));
+ assertFileNLinks("link2a", 2);
+ assertIsHardlink("link2a", "link2b");
+
+ /* Test #3 */
+ assertIsReg("link3a", 0755 & ~UMASK);
+ assertFileSize("link3a", sizeof(data));
+ assertFileNLinks("link3a", 2);
+ assertIsHardlink("link3a", "link3b");
+
+ /* Test #4 */
+ assertIsReg("link4a", 0755 & ~UMASK);
+ assertFileNLinks("link4a", 2);
+ assertFileSize("link4a", sizeof(data));
+ assertIsHardlink("link4a", "link4b");
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
index 2e872a1e359..207444833e7 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
@@ -23,9 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.9 2008/06/15 10:35:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_perms.c 201247 2009-12-30 05:59:21Z kientzle $");
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000 && (!defined(_WIN32) || defined(__CYGWIN__))
#define UMASK 022
@@ -60,7 +60,7 @@ searchgid(void)
_searched = 1;
/* Create a file on disk in the current default dir. */
- fd = open("test_gid", O_CREAT, 0664);
+ fd = open("test_gid", O_CREAT | O_BINARY, 0664);
failure("Couldn't create a file for gid testing.");
assert(fd > 0);
@@ -125,13 +125,15 @@ defaultgid(void)
DEFINE_TEST(test_write_disk_perms)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000 || (defined(_WIN32) && !defined(__CYGWIN__))
skipping("archive_write_disk interface");
#else
struct archive *a;
struct archive_entry *ae;
struct stat st;
+ assertUmask(UMASK);
+
/*
* Set ownership of the current directory to the group of this
* process. Otherwise, the SGID tests below fail if the
@@ -182,7 +184,7 @@ DEFINE_TEST(test_write_disk_perms)
/* Overwrite an existing dir. */
/* For dir, the first perms should get left. */
- assert(mkdir("dir_overwrite_0744", 0744) == 0);
+ assertMakeDir("dir_overwrite_0744", 0744);
/* Check original perms. */
assert(0 == stat("dir_overwrite_0744", &st));
failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode);
@@ -272,7 +274,7 @@ DEFINE_TEST(test_write_disk_perms)
* Current user must belong to at least two groups or
* else we can't test setting the GID to another group.
*/
- printf("Current user can't test gid restore: must belong to more than one group.\n");
+ skipping("Current user can't test gid restore: must belong to more than one group.");
} else {
/*
* Write a regular file with ARCHIVE_EXTRACT_PERM & SGID bit
@@ -363,10 +365,10 @@ DEFINE_TEST(test_write_disk_perms)
assertEqualIntA(a,ARCHIVE_WARN,archive_write_finish_entry(a));
}
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assert(0 == archive_write_finish(a));
#endif
archive_entry_free(ae);
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_secure.c b/archivers/libarchive/files/libarchive/test/test_write_disk_secure.c
index 2bcc95762c3..c14dadccfa6 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk_secure.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_secure.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_secure.c,v 1.4 2008/06/15 10:35:22 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_secure.c 201247 2009-12-30 05:59:21Z kientzle $");
#define UMASK 022
@@ -34,15 +34,15 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_secure.c,v 1.4 2008/
DEFINE_TEST(test_write_disk_secure)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("archive_write_disk interface");
-#else
+#elif !defined(_WIN32) || defined(__CYGWIN__)
struct archive *a;
struct archive_entry *ae;
struct stat st;
/* Start with a known umask. */
- umask(UMASK);
+ assertUmask(UMASK);
/* Create an archive_write_disk object. */
assert((a = archive_write_disk_new()) != NULL);
@@ -80,7 +80,7 @@ DEFINE_TEST(test_write_disk_secure)
archive_entry_set_mode(ae, S_IFREG | 0777);
archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS);
failure("Extracting a file through a symlink should fail here.");
- assertEqualInt(ARCHIVE_WARN, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae));
archive_entry_free(ae);
assert(0 == archive_write_finish_entry(a));
@@ -105,12 +105,80 @@ DEFINE_TEST(test_write_disk_secure)
archive_entry_free(ae);
assert(0 == archive_write_finish_entry(a));
+ /*
+ * Without security checks, extracting a dir over a link to a
+ * dir should follow the link.
+ */
+ /* Create a symlink to a dir. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link_to_dir3");
+ archive_entry_set_mode(ae, S_IFLNK | 0777);
+ archive_entry_set_symlink(ae, "dir");
+ archive_write_disk_set_options(a, 0);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Extract a dir whose name matches the symlink. */
+ assert(archive_entry_clear(ae) != NULL);
+ archive_entry_copy_pathname(ae, "link_to_dir3");
+ archive_entry_set_mode(ae, S_IFDIR | 0777);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Verify link was followed. */
+ assertEqualInt(0, lstat("link_to_dir3", &st));
+ assert(S_ISLNK(st.st_mode));
+ archive_entry_free(ae);
+
+ /*
+ * As above, but a broken link, so the link should get replaced.
+ */
+ /* Create a symlink to a dir. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link_to_dir4");
+ archive_entry_set_mode(ae, S_IFLNK | 0777);
+ archive_entry_set_symlink(ae, "nonexistent_dir");
+ archive_write_disk_set_options(a, 0);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Extract a dir whose name matches the symlink. */
+ assert(archive_entry_clear(ae) != NULL);
+ archive_entry_copy_pathname(ae, "link_to_dir4");
+ archive_entry_set_mode(ae, S_IFDIR | 0777);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Verify link was replaced. */
+ assertEqualInt(0, lstat("link_to_dir4", &st));
+ assert(S_ISDIR(st.st_mode));
+ archive_entry_free(ae);
+
+ /*
+ * As above, but a link to a non-dir, so the link should get replaced.
+ */
+ /* Create a regular file and a symlink to it */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "non_dir");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_write_disk_set_options(a, 0);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Create symlink to the file. */
+ archive_entry_copy_pathname(ae, "link_to_dir5");
+ archive_entry_set_mode(ae, S_IFLNK | 0777);
+ archive_entry_set_symlink(ae, "non_dir");
+ archive_write_disk_set_options(a, 0);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Extract a dir whose name matches the symlink. */
+ assert(archive_entry_clear(ae) != NULL);
+ archive_entry_copy_pathname(ae, "link_to_dir5");
+ archive_entry_set_mode(ae, S_IFDIR | 0777);
+ assert(0 == archive_write_header(a, ae));
+ assert(0 == archive_write_finish_entry(a));
+ /* Verify link was replaced. */
+ assertEqualInt(0, lstat("link_to_dir5", &st));
+ assert(S_ISDIR(st.st_mode));
+ archive_entry_free(ae);
-#if ARCHIVE_API_VERSION > 1
assert(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
-#endif
/* Test the entries on disk. */
assert(0 == lstat("dir", &st));
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_sparse.c b/archivers/libarchive/files/libarchive/test/test_write_disk_sparse.c
new file mode 100644
index 00000000000..638f0a4b26d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_sparse.c
@@ -0,0 +1,280 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_sparse.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Write a file using archive_write_data call, read the file
+ * back and verify the contents. The data written includes large
+ * blocks of nulls, so it should exercise the sparsification logic
+ * if ARCHIVE_EXTRACT_SPARSE is enabled.
+ */
+static void
+verify_write_data(struct archive *a, int sparse)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct stat st;
+ struct archive_entry *ae;
+ size_t buff_size = 64 * 1024;
+ char *buff, *p;
+ const char *msg = sparse ? "sparse" : "non-sparse";
+ FILE *f;
+
+ buff = malloc(buff_size);
+ assert(buff != NULL);
+
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_size(ae, 8 * buff_size);
+ archive_entry_set_pathname(ae, "test_write_data");
+ archive_entry_set_mode(ae, AE_IFREG | 0755);
+ assertEqualIntA(a, 0, archive_write_header(a, ae));
+
+ /* Use archive_write_data() to write three relatively sparse blocks. */
+
+ /* First has non-null data at beginning. */
+ memset(buff, 0, buff_size);
+ memcpy(buff, data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(buff_size, archive_write_data(a, buff, buff_size));
+
+ /* Second has non-null data in the middle. */
+ memset(buff, 0, buff_size);
+ memcpy(buff + buff_size / 2 - 3, data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(buff_size, archive_write_data(a, buff, buff_size));
+
+ /* Third has non-null data at the end. */
+ memset(buff, 0, buff_size);
+ memcpy(buff + buff_size - sizeof(data), data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(buff_size, archive_write_data(a, buff, buff_size));
+
+ failure("%s", msg);
+ assertEqualIntA(a, 0, archive_write_finish_entry(a));
+
+ /* Test the entry on disk. */
+ assert(0 == stat(archive_entry_pathname(ae), &st));
+ assertEqualInt(st.st_size, 8 * buff_size);
+ f = fopen(archive_entry_pathname(ae), "rb");
+ if (!assert(f != NULL))
+ return;
+
+ /* Check first block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ failure("%s", msg);
+ assertEqualMem(buff, data, sizeof(data));
+ for (p = buff + sizeof(data); p < buff + buff_size; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check second block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ for (p = buff; p < buff + buff_size; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (p == buff + buff_size / 2 - 3) {
+ assertEqualMem(p, data, sizeof(data));
+ p += sizeof(data);
+ } else if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check third block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ for (p = buff; p < buff + buff_size - sizeof(data); ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+ failure("%s", msg);
+ assertEqualMem(buff + buff_size - sizeof(data), data, sizeof(data));
+
+ /* XXX more XXX */
+
+ assertEqualInt(0, fclose(f));
+ archive_entry_free(ae);
+ free(buff);
+}
+
+/*
+ * As above, but using the archive_write_data_block() call.
+ */
+static void
+verify_write_data_block(struct archive *a, int sparse)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct stat st;
+ struct archive_entry *ae;
+ size_t buff_size = 64 * 1024;
+ char *buff, *p;
+ const char *msg = sparse ? "sparse" : "non-sparse";
+ FILE *f;
+
+ buff = malloc(buff_size);
+ assert(buff != NULL);
+
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_size(ae, 8 * buff_size);
+ archive_entry_set_pathname(ae, "test_write_data_block");
+ archive_entry_set_mode(ae, AE_IFREG | 0755);
+ assertEqualIntA(a, 0, archive_write_header(a, ae));
+
+ /* Use archive_write_data_block() to write three
+ relatively sparse blocks. */
+
+ /* First has non-null data at beginning. */
+ memset(buff, 0, buff_size);
+ memcpy(buff, data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(ARCHIVE_OK,
+ archive_write_data_block(a, buff, buff_size, 100));
+
+ /* Second has non-null data in the middle. */
+ memset(buff, 0, buff_size);
+ memcpy(buff + buff_size / 2 - 3, data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(ARCHIVE_OK,
+ archive_write_data_block(a, buff, buff_size, buff_size + 200));
+
+ /* Third has non-null data at the end. */
+ memset(buff, 0, buff_size);
+ memcpy(buff + buff_size - sizeof(data), data, sizeof(data));
+ failure("%s", msg);
+ assertEqualInt(ARCHIVE_OK,
+ archive_write_data_block(a, buff, buff_size, buff_size * 2 + 300));
+
+ failure("%s", msg);
+ assertEqualIntA(a, 0, archive_write_finish_entry(a));
+
+ /* Test the entry on disk. */
+ assert(0 == stat(archive_entry_pathname(ae), &st));
+ assertEqualInt(st.st_size, 8 * buff_size);
+ f = fopen(archive_entry_pathname(ae), "rb");
+ if (!assert(f != NULL))
+ return;
+
+ /* Check 100-byte gap at beginning */
+ assertEqualInt(100, fread(buff, 1, 100, f));
+ failure("%s", msg);
+ for (p = buff; p < buff + 100; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check first block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ failure("%s", msg);
+ assertEqualMem(buff, data, sizeof(data));
+ for (p = buff + sizeof(data); p < buff + buff_size; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check 100-byte gap */
+ assertEqualInt(100, fread(buff, 1, 100, f));
+ failure("%s", msg);
+ for (p = buff; p < buff + 100; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check second block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ for (p = buff; p < buff + buff_size; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (p == buff + buff_size / 2 - 3) {
+ assertEqualMem(p, data, sizeof(data));
+ p += sizeof(data);
+ } else if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check 100-byte gap */
+ assertEqualInt(100, fread(buff, 1, 100, f));
+ failure("%s", msg);
+ for (p = buff; p < buff + 100; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+ /* Check third block. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ for (p = buff; p < buff + buff_size - sizeof(data); ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+ failure("%s", msg);
+ assertEqualMem(buff + buff_size - sizeof(data), data, sizeof(data));
+
+ /* Check another block size beyond last we wrote. */
+ assertEqualInt(buff_size, fread(buff, 1, buff_size, f));
+ failure("%s", msg);
+ for (p = buff; p < buff + buff_size; ++p) {
+ failure("offset: %d, %s", (int)(p - buff), msg);
+ if (!assertEqualInt(0, *p))
+ break;
+ }
+
+
+ /* XXX more XXX */
+
+ assertEqualInt(0, fclose(f));
+ free(buff);
+ archive_entry_free(ae);
+}
+
+DEFINE_TEST(test_write_disk_sparse)
+{
+ struct archive *ad;
+
+
+ /*
+ * The return values, etc, of the write data functions
+ * shouldn't change regardless of whether we've requested
+ * sparsification. (The performance and pattern of actual
+ * write calls to the disk should vary, of course, but the
+ * client program shouldn't see any difference.)
+ */
+ assert((ad = archive_write_disk_new()) != NULL);
+ archive_write_disk_set_options(ad, 0);
+ verify_write_data(ad, 0);
+ verify_write_data_block(ad, 0);
+ assertEqualInt(0, archive_write_finish(ad));
+
+ assert((ad = archive_write_disk_new()) != NULL);
+ archive_write_disk_set_options(ad, ARCHIVE_EXTRACT_SPARSE);
+ verify_write_data(ad, 1);
+ verify_write_data_block(ad, 1);
+ assertEqualInt(0, archive_write_finish(ad));
+
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_symlink.c b/archivers/libarchive/files/libarchive/test/test_write_disk_symlink.c
new file mode 100644
index 00000000000..60d0bdcbb0e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_symlink.c
@@ -0,0 +1,117 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_symlink.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Exercise symlink recreation.
+ */
+DEFINE_TEST(test_write_disk_symlink)
+{
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct archive *ad;
+ struct archive_entry *ae;
+ int r;
+
+ if (!canSymlink()) {
+ skipping("Symlinks not supported");
+ return;
+ }
+
+ /* Write entries to disk. */
+ assert((ad = archive_write_disk_new()) != NULL);
+
+ /*
+ * First, create a regular file then a symlink to that file.
+ */
+
+ /* Regular file: link1a */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link1a");
+ archive_entry_set_mode(ae, AE_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /* Symbolic Link: link1b -> link1a */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link1b");
+ archive_entry_set_mode(ae, AE_IFLNK | 0642);
+ archive_entry_set_size(ae, 0);
+ archive_entry_copy_symlink(ae, "link1a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r >= ARCHIVE_WARN)
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /*
+ * We should be able to do this in the other order as well,
+ * of course.
+ */
+
+ /* Symbolic link: link2b -> link2a */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2b");
+ archive_entry_set_mode(ae, AE_IFLNK | 0642);
+ archive_entry_unset_size(ae);
+ archive_entry_copy_symlink(ae, "link2a");
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
+ if (r >= ARCHIVE_WARN) {
+ assertEqualInt(ARCHIVE_WARN,
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ }
+ archive_entry_free(ae);
+
+ /* File: link2a */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2a");
+ archive_entry_set_mode(ae, AE_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data),
+ archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(ad));
+
+ /* Test the entries on disk. */
+
+ /* Test #1 */
+ assertIsReg("link1a", -1);
+ assertFileSize("link1a", sizeof(data));
+ assertFileNLinks("link1a", 1);
+ assertIsSymlink("link1b", "link1a");
+
+ /* Test #2: Should produce identical results to test #1 */
+ assertIsReg("link2a", -1);
+ assertFileSize("link2a", sizeof(data));
+ assertFileNLinks("link2a", 1);
+ assertIsSymlink("link2b", "link2a");
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_times.c b/archivers/libarchive/files/libarchive/test/test_write_disk_times.c
new file mode 100644
index 00000000000..9ecbff69b56
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_times.c
@@ -0,0 +1,167 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_times.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+/*
+ * Exercise time restores in archive_write_disk(), including
+ * correct handling of omitted time values.
+ * On FreeBSD, we also test birthtime and high-res time restores.
+ */
+
+DEFINE_TEST(test_write_disk_times)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+
+ /* Create an archive_write_disk object. */
+ assert((a = archive_write_disk_new()) != NULL);
+ assertEqualInt(ARCHIVE_OK,
+ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_TIME));
+
+ /*
+ * Easy case: mtime and atime both specified.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file1");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_atime(ae, 123456, 0);
+ archive_entry_set_mtime(ae, 234567, 0);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify */
+ assertFileAtime("file1", 123456, 0);
+ assertFileMtime("file1", 234567, 0);
+
+ /*
+ * mtime specified, but not atime
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file2");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_mtime(ae, 234567, 0);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ assertFileMtime("file2", 234567, 0);
+ assertFileAtimeRecent("file2");
+
+ /*
+ * atime specified, but not mtime
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file3");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_atime(ae, 345678, 0);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify: Current mtime and atime as specified. */
+ assertFileAtime("file3", 345678, 0);
+ assertFileMtimeRecent("file3");
+
+ /*
+ * Neither atime nor mtime specified.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file4");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify: Current mtime and atime. */
+ assertFileAtimeRecent("file4");
+ assertFileMtimeRecent("file4");
+
+#if defined(__FreeBSD__)
+ /*
+ * High-res mtime and atime on FreeBSD.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file10");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_atime(ae, 1234567, 23456);
+ archive_entry_set_mtime(ae, 2345678, 4567);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify */
+ assertFileMtime("file10", 2345678, 4567);
+ assertFileAtime("file10", 1234567, 23456);
+
+ /*
+ * Birthtime, mtime and atime on FreeBSD
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file11");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_atime(ae, 1234567, 23456);
+ archive_entry_set_birthtime(ae, 3456789, 12345);
+ /* mtime must be later than birthtime! */
+ archive_entry_set_mtime(ae, 12345678, 4567);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify */
+ assertFileAtime("file11", 1234567, 23456);
+ assertFileBirthtime("file11", 3456789, 12345);
+ assertFileMtime("file11", 12345678, 4567);
+
+ /*
+ * Birthtime only on FreeBSD.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file12");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_birthtime(ae, 3456789, 12345);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify */
+ assertFileAtimeRecent("file12");
+ assertFileBirthtime("file12", 3456789, 12345);
+ assertFileMtimeRecent("file12");
+
+ /*
+ * mtime only on FreeBSD.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file13");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+ archive_entry_set_mtime(ae, 4567890, 23456);
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish_entry(a));
+ archive_entry_free(ae);
+ /* Verify */
+ assertFileAtimeRecent("file13");
+ assertFileBirthtime("file13", 4567890, 23456);
+ assertFileMtime("file13", 4567890, 23456);
+#else
+ skipping("Platform-specific time restore tests");
+#endif
+
+ archive_write_finish(a);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_ar.c b/archivers/libarchive/files/libarchive/test/test_write_format_ar.c
index a60a0cd8800..5822b3f3817 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_ar.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_ar.c
@@ -26,7 +26,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_ar.c,v 1.7 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_ar.c 189308 2009-03-03 17:02:51Z kientzle $");
char buff[4096];
char buff2[64];
@@ -34,7 +34,7 @@ static char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o
DEFINE_TEST(test_write_format_ar)
{
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
skipping("ar write support");
#else
struct archive_entry *ae;
@@ -46,7 +46,6 @@ DEFINE_TEST(test_write_format_ar)
*/
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ar_svr4(a));
- assertA(0 == archive_write_set_compression_gzip(a));
assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
/* write the filename table */
@@ -73,8 +72,8 @@ DEFINE_TEST(test_write_format_ar)
archive_entry_copy_pathname(ae, "ggghhhjjjrrrttt.o");
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, 7);
- assertA(0 == archive_write_header(a, ae));
- assertA(7 == archive_write_data(a, "7777777", 7));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualIntA(a, 7, archive_write_data(a, "7777777", 7));
archive_entry_free(ae);
/* test full pathname */
@@ -82,8 +81,8 @@ DEFINE_TEST(test_write_format_ar)
archive_entry_copy_pathname(ae, "/usr/home/xx/iiijjjdddsssppp.o");
archive_entry_set_mode(ae, S_IFREG | 0755);
archive_entry_set_size(ae, 8);
- assertA(0 == archive_write_header(a, ae));
- assertA(8 == archive_write_data(a, "88877766", 8));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualIntA(a, 8, archive_write_data(a, "88877766", 8));
archive_entry_free(ae);
/* trailing "/" should be rejected */
@@ -102,49 +101,49 @@ DEFINE_TEST(test_write_format_ar)
archive_entry_free(ae);
archive_write_close(a);
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertEqualInt(0, archive_write_finish(a));
#endif
/*
* Now, read the data back.
*/
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_open_memory(a, buff, used));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
- assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualInt(0, archive_entry_mtime(ae));
assertEqualString("//", archive_entry_pathname(ae));
assertEqualInt(0, archive_entry_size(ae));
- assertA(0 == archive_read_next_header(a, &ae));
- assert(1 == archive_entry_mtime(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
assertEqualString("abcdefghijklmn.o", archive_entry_pathname(ae));
- assert(8 == archive_entry_size(ae));
- assertA(8 == archive_read_data(a, buff2, 10));
- assert(0 == memcmp(buff2, "87654321", 8));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "87654321", 8);
- assert(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ggghhhjjjrrrttt.o", archive_entry_pathname(ae));
- assert(7 == archive_entry_size(ae));
- assertA(7 == archive_read_data(a, buff2, 11));
- assert(0 == memcmp(buff2, "7777777", 7));
+ assertEqualInt(7, archive_entry_size(ae));
+ assertEqualIntA(a, 7, archive_read_data(a, buff2, 11));
+ assertEqualMem(buff2, "7777777", 7);
- assert(0 == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualString("iiijjjdddsssppp.o", archive_entry_pathname(ae));
- assert(8 == archive_entry_size(ae));
- assertA(8 == archive_read_data(a, buff2, 17));
- assert(0 == memcmp(buff2, "88877766", 8));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 17));
+ assertEqualMem(buff2, "88877766", 8);
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+ assertEqualIntA(a, 0, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(0, archive_read_finish(a));
#endif
/*
@@ -152,18 +151,17 @@ DEFINE_TEST(test_write_format_ar)
*/
memset(buff, 0, sizeof(buff));
assert((a = archive_write_new()) != NULL);
- assertA(0 == archive_write_set_format_ar_bsd(a));
- assertA(0 == archive_write_set_compression_bzip2(a));
- assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ar_bsd(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, sizeof(buff), &used));
/* write a entry need long name extension */
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, "ttttyyyyuuuuiiii.o");
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, 5);
- assertA(0 == archive_write_header(a, ae));
- assertA(5 == archive_entry_size(ae));
- assertA(5 == archive_write_data(a, "12345", 7));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualInt(5, archive_entry_size(ae));
+ assertEqualIntA(a, 5, archive_write_data(a, "12345", 7));
archive_entry_free(ae);
/* write a entry with a short name */
@@ -171,41 +169,41 @@ DEFINE_TEST(test_write_format_ar)
archive_entry_copy_pathname(ae, "ttyy.o");
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, 6);
- assertA(0 == archive_write_header(a, ae));
- assertA(6 == archive_write_data(a, "555555", 7));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ assertEqualIntA(a, 6, archive_write_data(a, "555555", 7));
archive_entry_free(ae);
archive_write_close(a);
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertEqualInt(0, archive_write_finish(a));
#endif
/* Now, Read the data back */
assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_support_compression_all(a));
- assertA(0 == archive_read_open_memory(a, buff, used));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualString("ttttyyyyuuuuiiii.o", archive_entry_pathname(ae));
assertEqualInt(5, archive_entry_size(ae));
- assertA(5 == archive_read_data(a, buff2, 10));
- assert(0 == memcmp(buff2, "12345", 5));
+ assertEqualIntA(a, 5, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345", 5);
- assert(0 == archive_read_next_header(a, &ae));
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualString("ttyy.o", archive_entry_pathname(ae));
- assert(6 == archive_entry_size(ae));
- assertA(6 == archive_read_data(a, buff2, 10));
- assert(0 == memcmp(buff2, "555555", 6));
+ assertEqualInt(6, archive_entry_size(ae));
+ assertEqualIntA(a, 6, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "555555", 6);
/* Test EOF */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
- assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+ assertEqualIntA(a, 0, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assertEqualInt(0, archive_read_finish(a));
#endif
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
index dbb9775597a..7bf2a41a528 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
@@ -23,10 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio.c,v 1.4 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio.c 185672 2008-12-06 06:02:26Z kientzle $");
/* The version stamp macro was introduced after cpio write support. */
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
static void
test_format(int (*set_format)(struct archive *))
{
@@ -104,14 +104,16 @@ test_format(int (*set_format)(struct archive *))
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/*
* Damage the second entry to test the search-ahead recovery.
+ * TODO: Move the damage-recovery checking to a separate test;
+ * it doesn't really belong in this write test.
*/
{
int i;
@@ -124,7 +126,7 @@ test_format(int (*set_format)(struct archive *))
}
}
failure("Unable to locate the second header for damage-recovery test.");
- assert(damaged = 1);
+ assert(damaged == 1);
/*
* Now, read the data back.
@@ -134,7 +136,10 @@ test_format(int (*set_format)(struct archive *))
assertA(0 == archive_read_support_compression_all(a));
assertA(0 == archive_read_open_memory(a, buff, used));
- assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ if (!assertEqualIntA(a, 0, archive_read_next_header(a, &ae))) {
+ archive_read_finish(a);
+ return;
+ }
assertEqualInt(1, archive_entry_mtime(ae));
/* Not the same as above: cpio doesn't store hi-res times. */
@@ -148,28 +153,14 @@ test_format(int (*set_format)(struct archive *))
assert(0 == memcmp(filedata, "12345678", 8));
/*
- * Read the second file back.
+ * The second file can't be read because we damaged its header.
*/
- if (!damaged) {
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt(1, archive_entry_mtime(ae));
- /* Not the same as above: cpio doesn't store hi-res times. */
- assert(0 == archive_entry_mtime_nsec(ae));
- assert(0 == archive_entry_atime(ae));
- assert(0 == archive_entry_ctime(ae));
- assertEqualString("file2", archive_entry_pathname(ae));
- assert((S_IFREG | 0755) == archive_entry_mode(ae));
- assertEqualInt(4, archive_entry_size(ae));
- assertEqualIntA(a, 4, archive_read_data(a, filedata, 10));
- assert(0 == memcmp(filedata, "1234", 4));
- }
/*
* Read the dir entry back.
+ * ARCHIVE_WARN here because the damaged entry was skipped.
*/
- assertEqualIntA(a,
- damaged ? ARCHIVE_WARN : ARCHIVE_OK,
- archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae));
assertEqualInt(11, archive_entry_mtime(ae));
assert(0 == archive_entry_mtime_nsec(ae));
assert(0 == archive_entry_atime(ae));
@@ -182,10 +173,10 @@ test_format(int (*set_format)(struct archive *))
/* Verify the end of the archive. */
assertEqualIntA(a, 1, archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
free(buff);
@@ -194,7 +185,7 @@ test_format(int (*set_format)(struct archive *))
DEFINE_TEST(test_write_format_cpio)
{
-#if ARCHIVE_VERSION_STAMP >= 1009000
+#if ARCHIVE_VERSION_NUMBER >= 1009000
test_format(archive_write_set_format_cpio);
test_format(archive_write_set_format_cpio_newc);
#else
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_empty.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_empty.c
index 61c49211d07..131ac24617d 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_empty.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_empty.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio_empty.c,v 1.2 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_empty.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Check that an "empty" cpio archive is correctly created.
@@ -62,14 +62,14 @@ DEFINE_TEST(test_write_format_cpio_empty)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
failure("Empty cpio archive should be exactly 87 bytes, was %d.", used);
assert(used == 87);
failure("Empty cpio archive is incorrectly formatted.");
- assert(memcmp(buff, ref, 87) == 0);
+ assertEqualMem(buff, ref, 87);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
index 431097b2476..1c3c330b0e9 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio_newc.c,v 1.2 2008/01/23 05:43:26 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_newc.c 201247 2009-12-30 05:59:21Z kientzle $");
static int
@@ -52,7 +52,7 @@ DEFINE_TEST(test_write_format_cpio_newc)
{
struct archive *a;
struct archive_entry *entry;
- char *buff, *e;
+ char *buff, *e, *file;
size_t buffsize = 100000;
size_t used;
@@ -99,7 +99,8 @@ DEFINE_TEST(test_write_format_cpio_newc)
assert((entry = archive_entry_new()) != NULL);
archive_entry_set_mtime(entry, 3, 30);
archive_entry_set_pathname(entry, "lnk");
- archive_entry_set_mode(entry, S_IFLNK | 0664);
+ archive_entry_set_mode(entry, 0664);
+ archive_entry_set_filetype(entry, AE_IFLNK);
archive_entry_set_size(entry, 0);
archive_entry_set_uid(entry, 83);
archive_entry_set_gid(entry, 93);
@@ -111,10 +112,10 @@ DEFINE_TEST(test_write_format_cpio_newc)
archive_entry_free(entry);
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assert(0 == archive_write_finish(a));
#endif
/*
@@ -123,9 +124,10 @@ DEFINE_TEST(test_write_format_cpio_newc)
e = buff;
/* First entry is "file" */
+ file = e;
assert(is_hex(e, 110)); /* Entire header is hex digits. */
assertEqualMem(e + 0, "070701", 6); /* Magic */
- assertEqualMem(e + 6, "00000059", 8); /* ino */
+ assert(memcmp(e + 6, "00000000", 8) != 0); /* ino != 0 */
assertEqualMem(e + 14, "000081b4", 8); /* Mode */
assertEqualMem(e + 22, "00000050", 8); /* uid */
assertEqualMem(e + 30, "0000005a", 8); /* gid */
@@ -166,7 +168,8 @@ DEFINE_TEST(test_write_format_cpio_newc)
/* Third entry is "lnk" */
assert(is_hex(e, 110)); /* Entire header is hex digits. */
assertEqualMem(e + 0, "070701", 6); /* Magic */
- assertEqualMem(e + 6, "00000058", 8); /* ino */
+ assert(memcmp(e + 6, file + 6, 8) != 0); /* ino != file ino */
+ assert(memcmp(e + 6, "00000000", 8) != 0); /* ino != 0 */
assertEqualMem(e + 14, "0000a1b4", 8); /* Mode */
assertEqualMem(e + 22, "00000053", 8); /* uid */
assertEqualMem(e + 30, "0000005d", 8); /* gid */
@@ -205,7 +208,7 @@ DEFINE_TEST(test_write_format_cpio_newc)
assertEqualMem(e + 121, "\0\0\0", 3); /* Pad to multiple of 4 bytes */
e += 124; /* Must be multiple of four here! */
- assertEqualInt(used, e - buff);
+ assertEqualInt((int)used, e - buff);
free(buff);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
index e6ed7eed778..e2136f87cfb 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio_odc.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_odc.c 201247 2009-12-30 05:59:21Z kientzle $");
static int
@@ -46,7 +46,7 @@ DEFINE_TEST(test_write_format_cpio_odc)
{
struct archive *a;
struct archive_entry *entry;
- char *buff, *e;
+ char *buff, *e, *file;
size_t buffsize = 100000;
size_t used;
@@ -109,7 +109,8 @@ DEFINE_TEST(test_write_format_cpio_odc)
assert((entry = archive_entry_new()) != NULL);
archive_entry_set_mtime(entry, 3, 30);
archive_entry_set_pathname(entry, "symlink");
- archive_entry_set_mode(entry, S_IFLNK | 0664);
+ archive_entry_set_mode(entry, 0664);
+ archive_entry_set_filetype(entry, AE_IFLNK);
archive_entry_set_symlink(entry,"file");
archive_entry_set_size(entry, 0);
archive_entry_set_uid(entry, 88);
@@ -122,22 +123,37 @@ DEFINE_TEST(test_write_format_cpio_odc)
/* Write of data to symlink should fail == zero bytes get written. */
assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assert(0 == archive_write_finish(a));
#endif
/*
* Verify the archive format.
+ *
+ * Notes on the ino validation: cpio does not actually require
+ * that the ino values written to the archive match those read
+ * from disk. It really requires that:
+ * * matching non-zero ino values be written as matching
+ * non-zero values
+ * * non-matching non-zero ino values be written as non-matching
+ * non-zero values
+ * Libarchive further ensures that zero ino values get written
+ * as zeroes. This allows the cpio writer to generate
+ * synthetic ino values for the archive that may be different
+ * than those on disk in order to avoid problems due to truncation.
+ * This is especially needed for odc (POSIX format) that
+ * only supports 18-bit ino values.
*/
e = buff;
/* "file" */
+ file = e; /* Remember where this starts... */
assert(is_octal(e, 76)); /* Entire header is octal digits. */
assertEqualMem(e + 0, "070707", 6); /* Magic */
assertEqualMem(e + 6, "000014", 6); /* dev */
- assertEqualMem(e + 12, "000131", 6); /* ino */
+ assert(memcmp(e + 12, "000000", 6) != 0); /* ino must be != 0 */
assertEqualMem(e + 18, "100664", 6); /* Mode */
assertEqualMem(e + 24, "000120", 6); /* uid */
assertEqualMem(e + 30, "000132", 6); /* gid */
@@ -154,7 +170,7 @@ DEFINE_TEST(test_write_format_cpio_odc)
assert(is_octal(e, 76)); /* Entire header is octal digits. */
assertEqualMem(e + 0, "070707", 6); /* Magic */
assertEqualMem(e + 6, "000014", 6); /* dev */
- assertEqualMem(e + 12, "000131", 6); /* ino */
+ assertEqualMem(e + 12, file + 12, 6); /* ino must match above */
assertEqualMem(e + 18, "100664", 6); /* Mode */
assertEqualMem(e + 24, "000120", 6); /* uid */
assertEqualMem(e + 30, "000132", 6); /* gid */
@@ -187,7 +203,8 @@ DEFINE_TEST(test_write_format_cpio_odc)
assert(is_octal(e, 76)); /* Entire header is octal digits. */
assertEqualMem(e + 0, "070707", 6); /* Magic */
assertEqualMem(e + 6, "000014", 6); /* dev */
- assertEqualMem(e + 12, "000132", 6); /* ino */
+ assert(memcmp(e + 12, file + 12, 6) != 0); /* ino must != file ino */
+ assert(memcmp(e + 12, "000000", 6) != 0); /* ino must != 0 */
assertEqualMem(e + 18, "120664", 6); /* Mode */
assertEqualMem(e + 24, "000130", 6); /* uid */
assertEqualMem(e + 30, "000142", 6); /* gid */
@@ -218,7 +235,7 @@ DEFINE_TEST(test_write_format_cpio_odc)
assertEqualMem(e + 76, "TRAILER!!!\0", 11); /* Name */
e += 87;
- assertEqualInt(used, e - buff);
+ assertEqualInt((int)used, e - buff);
free(buff);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_mtree.c b/archivers/libarchive/files/libarchive/test/test_write_format_mtree.c
new file mode 100644
index 00000000000..e0b78f55716
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_mtree.c
@@ -0,0 +1,155 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_mtree.c 191183 2009-04-17 01:06:31Z kientzle $");
+
+static char buff[4096];
+static struct {
+ const char *path;
+ mode_t mode;
+ time_t mtime;
+ uid_t uid;
+ gid_t gid;
+} entries[] = {
+ { "./Makefile", S_IFREG | 0644, 1233041050, 1001, 1001 },
+ { "./NEWS", S_IFREG | 0644, 1231975636, 1001, 1001 },
+ { "./PROJECTS", S_IFREG | 0644, 1231975636, 1001, 1001 },
+ { "./README", S_IFREG | 0644, 1231975636, 1001, 1001 },
+ { "./COPYING", S_IFREG | 0644, 1231975636, 1001, 1001 },
+ { "./subdir", S_IFDIR | 0755, 1233504586, 1001, 1001 },
+ { "./subdir/README", S_IFREG | 0664, 1231975636, 1002, 1001 },
+ { "./subdir/config", S_IFREG | 0664, 1232266273, 1003, 1003 },
+ { "./subdir2", S_IFDIR | 0755, 1233504586, 1001, 1001 },
+ { "./subdir3", S_IFDIR | 0755, 1233504586, 1001, 1001 },
+ { "./subdir3/mtree", S_IFREG | 0664, 1232266273, 1003, 1003 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static void
+test_write_format_mtree_sub(int use_set, int dironly)
+{
+ struct archive_entry *ae;
+ struct archive* a;
+ size_t used;
+ int i;
+
+ /* Create a mtree format archive. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_mtree(a));
+ if (use_set)
+ assertA(0 == archive_write_set_options(a, "use-set"));
+ if (dironly)
+ assertA(0 == archive_write_set_options(a, "dironly"));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff)-1, &used));
+
+ /* Write entries */
+ for (i = 0; entries[i].path != NULL; i++) {
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, entries[i].mtime, 0);
+ assert(entries[i].mtime == archive_entry_mtime(ae));
+ archive_entry_set_mode(ae, entries[i].mode);
+ assert(entries[i].mode == archive_entry_mode(ae));
+ archive_entry_set_uid(ae, entries[i].uid);
+ assert(entries[i].uid == archive_entry_uid(ae));
+ archive_entry_set_gid(ae, entries[i].gid);
+ assert(entries[i].gid == archive_entry_gid(ae));
+ archive_entry_copy_pathname(ae, entries[i].path);
+ if ((entries[i].mode & AE_IFMT) != S_IFDIR)
+ archive_entry_set_size(ae, 8);
+ assertA(0 == archive_write_header(a, ae));
+ if ((entries[i].mode & AE_IFMT) != S_IFDIR)
+ assertA(8 == archive_write_data(a, "Hello012", 15));
+ archive_entry_free(ae);
+ }
+ archive_write_close(a);
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
+ assertEqualInt(0, archive_write_finish(a));
+#endif
+ if (use_set) {
+ const char *p;
+
+ buff[used] = '\0';
+ assert(NULL != (p = strstr(buff, "\n/set ")));
+ if (p != NULL) {
+ char *r;
+ const char *o;
+ p++;
+ r = strchr(p, '\n');
+ if (r != NULL)
+ *r = '\0';
+ if (dironly)
+ o = "/set type=dir uid=1001 gid=1001 mode=755";
+ else
+ o = "/set type=file uid=1001 gid=1001 mode=644";
+ assertEqualString(o, p);
+ if (r != NULL)
+ *r = '\n';
+ }
+ }
+
+ /*
+ * Read the data and check it.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
+
+ /* Read entries */
+ for (i = 0; entries[i].path != NULL; i++) {
+ if (dironly && (entries[i].mode & AE_IFMT) != S_IFDIR)
+ continue;
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(entries[i].mtime, archive_entry_mtime(ae));
+ assertEqualInt(entries[i].mode, archive_entry_mode(ae));
+ assertEqualInt(entries[i].uid, archive_entry_uid(ae));
+ assertEqualInt(entries[i].gid, archive_entry_gid(ae));
+ assertEqualString(entries[i].path, archive_entry_pathname(ae));
+ if ((entries[i].mode & AE_IFMT) != S_IFDIR)
+ assertEqualInt(8, archive_entry_size(ae));
+ }
+ assertEqualIntA(a, 0, archive_read_close(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
+ assertEqualInt(0, archive_read_finish(a));
+#endif
+}
+
+DEFINE_TEST(test_write_format_mtree)
+{
+ /* Default setting */
+ test_write_format_mtree_sub(0, 0);
+ /* Directory only */
+ test_write_format_mtree_sub(0, 1);
+ /* Use /set keyword */
+ test_write_format_mtree_sub(1, 0);
+ /* Use /set keyword with directory only */
+ test_write_format_mtree_sub(1, 1);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_pax.c b/archivers/libarchive/files/libarchive/test/test_write_format_pax.c
new file mode 100644
index 00000000000..06cfca6fe99
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_pax.c
@@ -0,0 +1,146 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+char buff2[64];
+
+DEFINE_TEST(test_write_format_pax)
+{
+ size_t buffsize = 1000000;
+ char *buff;
+ struct archive_entry *ae;
+ struct archive *a;
+ size_t used;
+
+ buff = malloc(buffsize); /* million bytes of work area */
+ assert(buff != NULL);
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_pax(a));
+ assertA(0 == archive_write_set_compression_none(a));
+ assertA(0 == archive_write_open_memory(a, buff, buffsize, &used));
+
+ /*
+ * "file" has a bunch of attributes and 8 bytes of data.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_atime(ae, 2, 20);
+ archive_entry_set_birthtime(ae, 3, 30);
+ archive_entry_set_ctime(ae, 4, 40);
+ archive_entry_set_mtime(ae, 5, 50);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+ /*
+ * "file2" is similar but has birthtime later than mtime.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_atime(ae, 2, 20);
+ archive_entry_set_birthtime(ae, 8, 80);
+ archive_entry_set_ctime(ae, 4, 40);
+ archive_entry_set_mtime(ae, 5, 50);
+ archive_entry_copy_pathname(ae, "file2");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+ /*
+ * XXX TODO XXX Archive directory, other file types.
+ * Archive extended attributes, ACLs, other metadata.
+ * Verify they get read back correctly.
+ */
+
+ /* Close out the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ *
+ * Now, read the data back.
+ *
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, 0, archive_read_support_format_all(a));
+ assertEqualIntA(a, 0, archive_read_support_compression_all(a));
+ assertEqualIntA(a, 0, archive_read_open_memory(a, buff, used));
+
+ /*
+ * Read "file"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(20, archive_entry_atime_nsec(ae));
+ assertEqualInt(3, archive_entry_birthtime(ae));
+ assertEqualInt(30, archive_entry_birthtime_nsec(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(40, archive_entry_ctime_nsec(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualInt(50, archive_entry_mtime_nsec(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
+
+ /*
+ * Read "file2"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assert(archive_entry_atime_is_set(ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(20, archive_entry_atime_nsec(ae));
+ /* Birthtime > mtime above, so it doesn't get stored at all. */
+ assert(!archive_entry_birthtime_is_set(ae));
+ assertEqualInt(0, archive_entry_birthtime(ae));
+ assertEqualInt(0, archive_entry_birthtime_nsec(ae));
+ assert(archive_entry_ctime_is_set(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(40, archive_entry_ctime_nsec(ae));
+ assert(archive_entry_mtime_is_set(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualInt(50, archive_entry_mtime_nsec(ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
+
+ /*
+ * Verify the end of the archive.
+ */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_finish(a));
+
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_shar_empty.c b/archivers/libarchive/files/libarchive/test/test_write_format_shar_empty.c
index c43e23b3c56..14ee3889a36 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_shar_empty.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_shar_empty.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_shar_empty.c,v 1.2 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_shar_empty.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
/*
* Check that an "empty" shar archive is correctly created as an empty file.
@@ -47,10 +47,10 @@ DEFINE_TEST(test_write_format_shar_empty)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
failure("Empty shar archive should be exactly 0 bytes, was %d.", used);
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_tar.c b/archivers/libarchive/files/libarchive/test/test_write_format_tar.c
index a23d05ca209..372fef1f023 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_tar.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_tar.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_tar.c,v 1.3 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar.c 189308 2009-03-03 17:02:51Z kientzle $");
char buff[1000000];
char buff2[64];
@@ -42,8 +42,8 @@ DEFINE_TEST(test_write_format_tar)
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ustar(a));
assertA(0 == archive_write_set_compression_none(a));
- assertA(0 == archive_write_set_bytes_per_block(a, blocksize));
- assertA(0 == archive_write_set_bytes_in_last_block(a, blocksize));
+ assertA(0 == archive_write_set_bytes_per_block(a, (int)blocksize));
+ assertA(0 == archive_write_set_bytes_in_last_block(a, (int)blocksize));
assertA(blocksize == (size_t)archive_write_get_bytes_in_last_block(a));
assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
assertA(blocksize == (size_t)archive_write_get_bytes_in_last_block(a));
@@ -72,10 +72,10 @@ DEFINE_TEST(test_write_format_tar)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
/* This calculation gives "the smallest multiple of
* the block size that is at least 2048 bytes". */
@@ -105,10 +105,10 @@ DEFINE_TEST(test_write_format_tar)
/* Verify the end of the archive. */
assert(1 == archive_read_next_header(a, &ae));
assert(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_read_finish(a);
+#else
+ assert(0 == archive_read_finish(a));
#endif
}
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_tar_empty.c b/archivers/libarchive/files/libarchive/test/test_write_format_tar_empty.c
index 1d4d35449d5..6b40f0767f3 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_tar_empty.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_tar_empty.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_tar_empty.c,v 1.3 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar_empty.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Check that an "empty" tar archive is correctly created.
@@ -46,13 +46,13 @@ DEFINE_TEST(test_write_format_tar_empty)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Earlier versions wrote 0-length files for empty tar archives. */
skipping("empty tar archive size");
#else
@@ -73,17 +73,17 @@ DEFINE_TEST(test_write_format_tar_empty)
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assertA(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assertA(0 == archive_write_finish(a));
#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Earlier versions wrote 0-length files for empty tar archives. */
skipping("empty tar archive size");
#else
- assertEqualInt(used, 1024);
+ assertEqualInt((int)used, 1024);
#endif
for (i = 0; i < used; i++) {
failure("Empty tar archive should be all nulls.");
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_tar_ustar.c b/archivers/libarchive/files/libarchive/test/test_write_format_tar_ustar.c
index 53eb07cf7d9..29968dfb331 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_tar_ustar.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_tar_ustar.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar_ustar.c 201247 2009-12-30 05:59:21Z kientzle $");
static int
is_null(const char *p, size_t l)
@@ -133,7 +133,8 @@ DEFINE_TEST(test_write_format_tar_ustar)
assert((entry = archive_entry_new()) != NULL);
archive_entry_set_mtime(entry, 3, 30);
archive_entry_set_pathname(entry, "symlink");
- archive_entry_set_mode(entry, S_IFLNK | 0664);
+ archive_entry_set_mode(entry, 0664);
+ archive_entry_set_filetype(entry, AE_IFLNK);
archive_entry_set_symlink(entry,"file");
archive_entry_set_size(entry, 0);
archive_entry_set_uid(entry, 88);
@@ -188,7 +189,11 @@ DEFINE_TEST(test_write_format_tar_ustar)
assertEqualIntA(a, 0, archive_write_header(a, entry));
archive_entry_free(entry);
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
assert(0 == archive_write_finish(a));
+#endif
/*
* Verify the archive format.
@@ -336,7 +341,7 @@ DEFINE_TEST(test_write_format_tar_ustar)
assert(is_null(e, 1024));
e += 1024;
- assertEqualInt(used, e - buff);
+ assertEqualInt((int)used, e - buff);
free(buff);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_zip.c b/archivers/libarchive/files/libarchive/test/test_write_format_zip.c
new file mode 100644
index 00000000000..250ddba9131
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_zip.c
@@ -0,0 +1,180 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2008 Anselm Strauss
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Development supported by Google Summer of Code 2008.
+ */
+
+/* TODO: reader does not yet restore permissions. */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+DEFINE_TEST(test_write_format_zip)
+{
+ char filedata[64];
+ struct archive_entry *ae;
+ struct archive *a;
+ size_t used;
+ size_t buffsize = 1000000;
+ char *buff;
+ const char *compression_type;
+
+ buff = malloc(buffsize);
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
+#ifdef HAVE_ZLIB_H
+ compression_type = "zip:compression=deflate";
+#else
+ compression_type = "zip:compression=store";
+#endif
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_format_options(a, compression_type));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, buffsize, &used));
+
+ /*
+ * Write a file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 1, 10);
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(10, archive_entry_mtime_nsec(ae));
+ archive_entry_copy_pathname(ae, "file");
+ assertEqualString("file", archive_entry_pathname(ae));
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae));
+ archive_entry_set_size(ae, 8);
+
+ assertEqualInt(0, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualInt(8, archive_write_data(a, "12345678", 9));
+ assertEqualInt(0, archive_write_data(a, "1", 1));
+
+ /*
+ * Write another file to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 1, 10);
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(10, archive_entry_mtime_nsec(ae));
+ archive_entry_copy_pathname(ae, "file2");
+ assertEqualString("file2", archive_entry_pathname(ae));
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae));
+ archive_entry_set_size(ae, 4);
+
+ assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualInt(4, archive_write_data(a, "1234", 5));
+
+ /*
+ * Write a directory to it.
+ */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(ae, 11, 110);
+ archive_entry_copy_pathname(ae, "dir");
+ archive_entry_set_mode(ae, S_IFDIR | 0755);
+ archive_entry_set_size(ae, 512);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ failure("size should be zero so that applications know not to write");
+ assertEqualInt(0, archive_entry_size(ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 0, archive_write_data(a, "12345678", 9));
+
+ /* Close out the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+ /*
+ * Now, read the data back.
+ */
+ ae = NULL;
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, buff, used));
+
+ /*
+ * Read and verify first file.
+ */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_entry_mtime(ae));
+ /* Zip doesn't store high-resolution mtime. */
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
+ //assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualIntA(a, 8,
+ archive_read_data(a, filedata, sizeof(filedata)));
+ assertEqualMem(filedata, "12345678", 8);
+
+
+ /*
+ * Read the second file back.
+ */
+ if (!assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae))){
+ free(buff);
+ return;
+ }
+ assertEqualInt(1, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ //assert((S_IFREG | 0755) == archive_entry_mode(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualIntA(a, 4,
+ archive_read_data(a, filedata, sizeof(filedata)));
+ assertEqualMem(filedata, "1234", 4);
+
+ /*
+ * Read the dir entry back.
+ */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(11, archive_entry_mtime(ae));
+ assertEqualInt(0, archive_entry_mtime_nsec(ae));
+ assertEqualInt(0, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_ctime(ae));
+ assertEqualString("dir/", archive_entry_pathname(ae));
+ //assertEqualInt((S_IFDIR | 0755), archive_entry_mode(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualIntA(a, 0, archive_read_data(a, filedata, 10));
+
+ /* Verify the end of the archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+ free(buff);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_zip_empty.c b/archivers/libarchive/files/libarchive/test/test_write_format_zip_empty.c
new file mode 100644
index 00000000000..459664e2347
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_zip_empty.c
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2008 Anselm Strauss
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Development supported by Google Summer of Code 2008.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_empty.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+DEFINE_TEST(test_write_format_zip_empty)
+{
+ struct archive *a;
+ char buff[256];
+ size_t used;
+
+ /* Zip format: Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_zip(a));
+ assertA(0 == archive_write_set_compression_none(a));
+ assertA(0 == archive_write_set_bytes_per_block(a, 1));
+ assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+
+ /* Close out the archive without writing anything. */
+ assertA(0 == archive_write_close(a));
+ assertA(0 == archive_write_finish(a));
+
+ /* Verify the correct format for an empy Zip archive. */
+ assertEqualInt(used, 22);
+ assertEqualMem(buff,
+ "PK\005\006\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
+ 22);
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_zip_no_compression.c b/archivers/libarchive/files/libarchive/test/test_write_format_zip_no_compression.c
new file mode 100644
index 00000000000..4a61a76eb6a
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_zip_no_compression.c
@@ -0,0 +1,304 @@
+/*-
+ * Copyright (c) 2008 Anselm Strauss
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Development supported by Google Summer of Code 2008.
+ */
+
+#include "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_no_compression.c 201247 2009-12-30 05:59:21Z kientzle $");
+
+static unsigned long
+bitcrc32(unsigned long c, void *_p, size_t s)
+{
+ /* This is a drop-in replacement for crc32() from zlib.
+ * Libarchive should be able to correctly generate
+ * uncompressed zip archives (including correct CRCs) even
+ * when zlib is unavailable, and this function helps us verify
+ * that. Yes, this is very, very slow and unsuitable for
+ * production use, but it's correct, compact, and works well
+ * enough for this particular usage. Libarchive internally
+ * uses a much more efficient implementation. */
+ const unsigned char *p = _p;
+ int bitctr;
+
+ if (p == NULL)
+ return (0);
+
+ for (; s > 0; --s) {
+ c ^= *p++;
+ for (bitctr = 8; bitctr > 0; --bitctr) {
+ if (c & 1) c = (c >> 1);
+ else c = (c >> 1) ^ 0xedb88320;
+ c ^= 0x80000000;
+ }
+ }
+ return (c);
+}
+
+/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
+static int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
+static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); }
+
+DEFINE_TEST(test_write_format_zip_no_compression)
+{
+ /* Buffer data */
+ struct archive *a;
+ struct archive_entry *entry;
+ char buff[100000];
+ const char *buffend;
+ /* p is the pointer to walk over the central directory,
+ * q walks over the local headers, the data and the data descriptors. */
+ const char *p, *q;
+ size_t used;
+
+ /* File data */
+ char file_name[] = "file";
+ char file_data1[] = {'1', '2', '3', '4', '5'};
+ char file_data2[] = {'6', '7', '8', '9', '0'};
+ int file_perm = 00644;
+ short file_uid = 10;
+ short file_gid = 20;
+
+ /* Folder data */
+ char folder_name[] = "folder/";
+ int folder_perm = 00755;
+ short folder_uid = 30;
+ short folder_gid = 40;
+
+ /* Time data */
+ time_t t = time(NULL);
+ struct tm *tm = localtime(&t);
+
+ /* Misc variables */
+ unsigned long crc;
+
+ /* Create new ZIP archive in memory without padding. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_zip(a));
+ assertA(0 == archive_write_set_format_options(a, "zip:compression=store"));
+ assertA(0 == archive_write_set_compression_none(a));
+ assertA(0 == archive_write_set_bytes_per_block(a, 1));
+ assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+
+ /* Write entries. */
+
+ /* Regular file */
+ assert((entry = archive_entry_new()) != NULL);
+ archive_entry_set_pathname(entry, file_name);
+ archive_entry_set_mode(entry, S_IFREG | 0644);
+ archive_entry_set_size(entry, sizeof(file_data1) + sizeof(file_data2));
+ archive_entry_set_uid(entry, file_uid);
+ archive_entry_set_gid(entry, file_gid);
+ archive_entry_set_mtime(entry, t, 0);
+ archive_entry_set_atime(entry, t, 0);
+ archive_entry_set_ctime(entry, t, 0);
+ assertEqualIntA(a, 0, archive_write_header(a, entry));
+ assertEqualIntA(a, sizeof(file_data1), archive_write_data(a, file_data1, sizeof(file_data1)));
+ assertEqualIntA(a, sizeof(file_data2), archive_write_data(a, file_data2, sizeof(file_data2)));
+ archive_entry_free(entry);
+
+ /* Folder */
+ assert((entry = archive_entry_new()) != NULL);
+ archive_entry_set_pathname(entry, folder_name);
+ archive_entry_set_mode(entry, S_IFDIR | folder_perm);
+ archive_entry_set_size(entry, 0);
+ archive_entry_set_uid(entry, folder_uid);
+ archive_entry_set_gid(entry, folder_gid);
+ archive_entry_set_mtime(entry, t, 0);
+ archive_entry_set_atime(entry, t, 0);
+ archive_entry_set_ctime(entry, t, 0);
+ assertEqualIntA(a, 0, archive_write_header(a, entry));
+ archive_entry_free(entry);
+
+ /* Close the archive . */
+ assertA(0 == archive_write_close(a));
+ assertA(0 == archive_write_finish(a));
+
+ /* Remember the end of the archive in memory. */
+ buffend = buff + used;
+
+ /* Verify "End of Central Directory" record. */
+ /* Get address of end-of-central-directory record. */
+ p = buffend - 22; /* Assumes there is no zip comment field. */
+ failure("End-of-central-directory begins with PK\\005\\006 signature");
+ assertEqualMem(p, "PK\005\006", 4);
+ failure("This must be disk 0");
+ assertEqualInt(i2(p + 4), 0);
+ failure("Central dir must start on disk 0");
+ assertEqualInt(i2(p + 6), 0);
+ failure("All central dir entries are on this disk");
+ assertEqualInt(i2(p + 8), i2(p + 10));
+ failure("CD start (%d) + CD length (%d) should == archive size - 22",
+ i4(p + 12), i4(p + 16));
+ assertEqualInt(i4(p + 12) + i4(p + 16), used - 22);
+ failure("no zip comment");
+ assertEqualInt(i2(p + 20), 0);
+
+ /* Get address of first entry in central directory. */
+ p = buff + i4(buffend - 6);
+ failure("Central file record at offset %d should begin with"
+ " PK\\001\\002 signature",
+ i4(buffend - 10));
+
+ /* Verify file entry in central directory. */
+ assertEqualMem(p, "PK\001\002", 4); /* Signature */
+ assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
+ assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
+ assertEqualInt(i2(p + 8), 8); /* Flags */
+ assertEqualInt(i2(p + 10), 0); /* Compression method */
+ assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
+ assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
+ crc = bitcrc32(0, file_data1, sizeof(file_data1));
+ crc = bitcrc32(crc, file_data2, sizeof(file_data2));
+ assertEqualInt(i4(p + 16), crc); /* CRC-32 */
+ assertEqualInt(i4(p + 20), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
+ assertEqualInt(i4(p + 24), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
+ assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
+ assertEqualInt(i2(p + 30), 13); /* Extra field length */
+ assertEqualInt(i2(p + 32), 0); /* File comment length */
+ assertEqualInt(i2(p + 34), 0); /* Disk number start */
+ assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
+ assertEqualInt(i4(p + 38) >> 16 & 01777, file_perm); /* External file attrs */
+ assertEqualInt(i4(p + 42), 0); /* Offset of local header */
+ assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
+ p = p + 46 + strlen(file_name);
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 7); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
+ p = p + 9;
+ assertEqualInt(i2(p), 0x7855); /* 'Ux' extension header */
+ assertEqualInt(i2(p + 2), 0); /* 'Ux' size */
+ p = p + 4;
+
+ /* Verify local header of file entry. */
+ q = buff;
+ assertEqualMem(q, "PK\003\004", 4); /* Signature */
+ assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
+ assertEqualInt(i2(q + 6), 8); /* Flags */
+ assertEqualInt(i2(q + 8), 0); /* Compression method */
+ assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
+ assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
+ assertEqualInt(i4(q + 14), 0); /* CRC-32 */
+ assertEqualInt(i4(q + 18), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
+ assertEqualInt(i4(q + 22), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
+ assertEqualInt(i2(q + 26), strlen(file_name)); /* Pathname length */
+ assertEqualInt(i2(q + 28), 25); /* Extra field length */
+ assertEqualMem(q + 30, file_name, strlen(file_name)); /* Pathname */
+ q = q + 30 + strlen(file_name);
+ assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(q + 2), 13); /* 'UT' size */
+ assertEqualInt(q[4], 7); /* 'UT' flags */
+ assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
+ assertEqualInt(i4(q + 9), t); /* 'UT' atime */
+ assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
+ q = q + 17;
+ assertEqualInt(i2(q), 0x7855); /* 'Ux' extension header */
+ assertEqualInt(i2(q + 2), 4); /* 'Ux' size */
+ assertEqualInt(i2(q + 4), file_uid); /* 'Ux' UID */
+ assertEqualInt(i2(q + 6), file_gid); /* 'Ux' GID */
+ q = q + 8;
+
+ /* Verify data of file entry. */
+ assertEqualMem(q, file_data1, sizeof(file_data1));
+ assertEqualMem(q + sizeof(file_data1), file_data2, sizeof(file_data2));
+ q = q + sizeof(file_data1) + sizeof(file_data2);
+
+ /* Verify data descriptor of file entry. */
+ assertEqualMem(q, "PK\007\010", 4); /* Signature */
+ assertEqualInt(i4(q + 4), crc); /* CRC-32 */
+ assertEqualInt(i4(q + 8), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
+ assertEqualInt(i4(q + 12), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
+ q = q + 16;
+
+ /* Verify folder entry in central directory. */
+ assertEqualMem(p, "PK\001\002", 4); /* Signature */
+ assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
+ assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
+ assertEqualInt(i2(p + 8), 8); /* Flags */
+ assertEqualInt(i2(p + 10), 0); /* Compression method */
+ assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
+ assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
+ crc = 0;
+ assertEqualInt(i4(p + 16), crc); /* CRC-32 */
+ assertEqualInt(i4(p + 20), 0); /* Compressed size */
+ assertEqualInt(i4(p + 24), 0); /* Uncompressed size */
+ assertEqualInt(i2(p + 28), strlen(folder_name)); /* Pathname length */
+ assertEqualInt(i2(p + 30), 13); /* Extra field length */
+ assertEqualInt(i2(p + 32), 0); /* File comment length */
+ assertEqualInt(i2(p + 34), 0); /* Disk number start */
+ assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
+ assertEqualInt(i4(p + 38) >> 16 & 01777, folder_perm); /* External file attrs */
+ assertEqualInt(i4(p + 42), q - buff); /* Offset of local header */
+ assertEqualMem(p + 46, folder_name, strlen(folder_name)); /* Pathname */
+ p = p + 46 + strlen(folder_name);
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 7); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
+ p = p + 9;
+ assertEqualInt(i2(p), 0x7855); /* 'Ux' extension header */
+ assertEqualInt(i2(p + 2), 0); /* 'Ux' size */
+ p = p + 4;
+
+ /* Verify local header of folder entry. */
+ assertEqualMem(q, "PK\003\004", 4); /* Signature */
+ assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
+ assertEqualInt(i2(q + 6), 8); /* Flags */
+ assertEqualInt(i2(q + 8), 0); /* Compression method */
+ assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
+ assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
+ assertEqualInt(i4(q + 14), 0); /* CRC-32 */
+ assertEqualInt(i4(q + 18), 0); /* Compressed size */
+ assertEqualInt(i4(q + 22), 0); /* Uncompressed size */
+ assertEqualInt(i2(q + 26), strlen(folder_name)); /* Pathname length */
+ assertEqualInt(i2(q + 28), 25); /* Extra field length */
+ assertEqualMem(q + 30, folder_name, strlen(folder_name)); /* Pathname */
+ q = q + 30 + strlen(folder_name);
+ assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(q + 2), 13); /* 'UT' size */
+ assertEqualInt(q[4], 7); /* 'UT' flags */
+ assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
+ assertEqualInt(i4(q + 9), t); /* 'UT' atime */
+ assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
+ q = q + 17;
+ assertEqualInt(i2(q), 0x7855); /* 'Ux' extension header */
+ assertEqualInt(i2(q + 2), 4); /* 'Ux' size */
+ assertEqualInt(i2(q + 4), folder_uid); /* 'Ux' UID */
+ assertEqualInt(i2(q + 6), folder_gid); /* 'Ux' GID */
+ q = q + 8;
+
+ /* There should not be any data in the folder entry,
+ * meaning next is the data descriptor header. */
+
+ /* Verify data descriptor of folder entry. */
+ assertEqualMem(q, "PK\007\010", 4); /* Signature */
+ assertEqualInt(i4(q + 4), crc); /* CRC-32 */
+ assertEqualInt(i4(q + 8), 0); /* Compressed size */
+ assertEqualInt(i4(q + 12), 0); /* Uncompressed size */
+ q = q + 16;
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_open_memory.c b/archivers/libarchive/files/libarchive/test/test_write_open_memory.c
index 2e58fff4af5..696db6c963a 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_open_memory.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_open_memory.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_open_memory.c,v 1.3 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_open_memory.c 189308 2009-03-03 17:02:51Z kientzle $");
/* Try to force archive_write_open_memory.c to write past the end of an array. */
static unsigned char buff[16384];
@@ -50,7 +50,7 @@ DEFINE_TEST(test_write_open_memory)
assert((a = archive_write_new()) != NULL);
assertA(0 == archive_write_set_format_ustar(a));
assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
- assertA(0 == archive_write_set_bytes_per_block(a, blocksize));
+ assertA(0 == archive_write_set_bytes_per_block(a, (int)blocksize));
buff[i] = 0xAE;
assertA(0 == archive_write_open_memory(a, buff, i, &s));
/* If buffer is smaller than a tar header, this should fail. */
@@ -64,10 +64,10 @@ DEFINE_TEST(test_write_open_memory)
assertA(ARCHIVE_FATAL == archive_write_close(a));
else
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_write_finish(a));
-#else
+#if ARCHIVE_VERSION_NUMBER < 2000000
archive_write_finish(a);
+#else
+ assert(0 == archive_write_finish(a));
#endif
assert(buff[i] == 0xAE);
assert(s <= i);
diff --git a/archivers/libarchive/files/libarchive_fe/err.c b/archivers/libarchive/files/libarchive_fe/err.c
new file mode 100644
index 00000000000..eb3f9f3eb5e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/err.c
@@ -0,0 +1,74 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "lafe_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "err.h"
+
+const char *lafe_progname;
+
+static void
+lafe_vwarnc(int code, const char *fmt, va_list ap)
+{
+ fprintf(stderr, "%s: ", lafe_progname);
+ vfprintf(stderr, fmt, ap);
+ if (code != 0)
+ fprintf(stderr, ": %s", strerror(code));
+ fprintf(stderr, "\n");
+}
+
+void
+lafe_warnc(int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ lafe_vwarnc(code, fmt, ap);
+ va_end(ap);
+}
+
+void
+lafe_errc(int eval, int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ lafe_vwarnc(code, fmt, ap);
+ va_end(ap);
+ exit(eval);
+}
diff --git a/archivers/libarchive/files/libarchive_fe/err.h b/archivers/libarchive/files/libarchive_fe/err.h
new file mode 100644
index 00000000000..dd794481391
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/err.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2009 Joerg Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LAFE_ERR_H
+#define LAFE_ERR_H
+
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_DEAD __attribute__((__noreturn__))
+#else
+#define __LA_DEAD
+#endif
+
+extern const char *lafe_progname;
+
+void lafe_warnc(int code, const char *fmt, ...);
+void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD;
+
+#endif
diff --git a/archivers/libarchive/files/libarchive_fe/lafe_platform.h b/archivers/libarchive/files/libarchive_fe/lafe_platform.h
new file mode 100644
index 00000000000..557124b9f84
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/lafe_platform.h
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/usr.bin/cpio/cpio_platform.h,v 1.2 2008/12/06 07:15:42 kientzle Exp $
+ */
+
+/*
+ * This header is the first thing included in any of the libarchive_fe
+ * source files. As far as possible, platform-specific issues should
+ * be dealt with here and not within individual source files.
+ */
+
+#ifndef LAFE_PLATFORM_H_INCLUDED
+#define LAFE_PLATFORM_H_INCLUDED
+
+#if defined(PLATFORM_CONFIG_H)
+/* Use hand-built config.h in environments that need it. */
+#include PLATFORM_CONFIG_H
+#else
+/* Read config.h or die trying. */
+#include "config.h"
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#endif
diff --git a/archivers/libarchive/files/libarchive_fe/line_reader.c b/archivers/libarchive/files/libarchive_fe/line_reader.c
new file mode 100644
index 00000000000..4af60de4c07
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/line_reader.c
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "lafe_platform.h"
+__FBSDID("$FreeBSD$");
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "err.h"
+#include "line_reader.h"
+
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__)
+#define strdup _strdup
+#endif
+
+/*
+ * Read lines from file and do something with each one. If option_null
+ * is set, lines are terminated with zero bytes; otherwise, they're
+ * terminated with newlines.
+ *
+ * This uses a self-sizing buffer to handle arbitrarily-long lines.
+ */
+struct lafe_line_reader {
+ FILE *f;
+ char *buff, *buff_end, *line_start, *line_end, *p;
+ char *pathname;
+ size_t buff_length;
+ int nullSeparator; /* Lines separated by null, not CR/CRLF/etc. */
+ int ret;
+};
+
+struct lafe_line_reader *
+lafe_line_reader(const char *pathname, int nullSeparator)
+{
+ struct lafe_line_reader *lr;
+
+ lr = calloc(1, sizeof(*lr));
+ if (lr == NULL)
+ lafe_errc(1, ENOMEM, "Can't open %s", pathname);
+
+ lr->nullSeparator = nullSeparator;
+ lr->pathname = strdup(pathname);
+
+ if (strcmp(pathname, "-") == 0)
+ lr->f = stdin;
+ else
+ lr->f = fopen(pathname, "r");
+ if (lr->f == NULL)
+ lafe_errc(1, errno, "Couldn't open %s", pathname);
+ lr->buff_length = 8192;
+ lr->buff = malloc(lr->buff_length);
+ if (lr->buff == NULL)
+ lafe_errc(1, ENOMEM, "Can't read %s", pathname);
+ lr->line_start = lr->line_end = lr->buff_end = lr->buff;
+
+ return (lr);
+}
+
+const char *
+lafe_line_reader_next(struct lafe_line_reader *lr)
+{
+ size_t bytes_wanted, bytes_read, new_buff_size;
+ char *line_start, *p;
+
+ for (;;) {
+ /* If there's a line in the buffer, return it immediately. */
+ while (lr->line_end < lr->buff_end) {
+ if (lr->nullSeparator) {
+ if (*lr->line_end == '\0') {
+ line_start = lr->line_start;
+ lr->line_start = lr->line_end + 1;
+ lr->line_end = lr->line_start;
+ return (line_start);
+ }
+ } else if (*lr->line_end == '\x0a' || *lr->line_end == '\x0d') {
+ *lr->line_end = '\0';
+ line_start = lr->line_start;
+ lr->line_start = lr->line_end + 1;
+ lr->line_end = lr->line_start;
+ if (line_start[0] != '\0')
+ return (line_start);
+ }
+ lr->line_end++;
+ }
+
+ /* If we're at end-of-file, process the final data. */
+ if (lr->f == NULL) {
+ /* If there's more text, return one last line. */
+ if (lr->line_end > lr->line_start) {
+ *lr->line_end = '\0';
+ line_start = lr->line_start;
+ lr->line_start = lr->line_end + 1;
+ lr->line_end = lr->line_start;
+ return (line_start);
+ }
+ /* Otherwise, we're done. */
+ return (NULL);
+ }
+
+ /* Buffer only has part of a line. */
+ if (lr->line_start > lr->buff) {
+ /* Move a leftover fractional line to the beginning. */
+ memmove(lr->buff, lr->line_start,
+ lr->buff_end - lr->line_start);
+ lr->buff_end -= lr->line_start - lr->buff;
+ lr->line_end -= lr->line_start - lr->buff;
+ lr->line_start = lr->buff;
+ } else {
+ /* Line is too big; enlarge the buffer. */
+ new_buff_size = lr->buff_length * 2;
+ if (new_buff_size <= lr->buff_length)
+ lafe_errc(1, ENOMEM,
+ "Line too long in %s", lr->pathname);
+ lr->buff_length = new_buff_size;
+ p = realloc(lr->buff, new_buff_size);
+ if (p == NULL)
+ lafe_errc(1, ENOMEM,
+ "Line too long in %s", lr->pathname);
+ lr->buff_end = p + (lr->buff_end - lr->buff);
+ lr->line_end = p + (lr->line_end - lr->buff);
+ lr->line_start = lr->buff = p;
+ }
+
+ /* Get some more data into the buffer. */
+ bytes_wanted = lr->buff + lr->buff_length - lr->buff_end;
+ bytes_read = fread(lr->buff_end, 1, bytes_wanted, lr->f);
+ lr->buff_end += bytes_read;
+
+ if (ferror(lr->f))
+ lafe_errc(1, errno, "Can't read %s", lr->pathname);
+ if (feof(lr->f)) {
+ if (lr->f != stdin)
+ fclose(lr->f);
+ lr->f = NULL;
+ }
+ }
+}
+
+void
+lafe_line_reader_free(struct lafe_line_reader *lr)
+{
+ free(lr->buff);
+ free(lr->pathname);
+ free(lr);
+}
diff --git a/archivers/libarchive/files/libarchive_fe/line_reader.h b/archivers/libarchive/files/libarchive_fe/line_reader.h
new file mode 100644
index 00000000000..d092c051f60
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/line_reader.h
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2009 Joerg Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LAFE_LINE_READER_H
+#define LAFE_LINE_READER_H
+
+struct lafe_line_reader;
+
+struct lafe_line_reader *lafe_line_reader(const char *, int nullSeparator);
+const char *lafe_line_reader_next(struct lafe_line_reader *);
+void lafe_line_reader_free(struct lafe_line_reader *);
+
+#endif
diff --git a/archivers/libarchive/files/libarchive_fe/matching.c b/archivers/libarchive/files/libarchive_fe/matching.c
new file mode 100644
index 00000000000..bdfd07b7df4
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/matching.c
@@ -0,0 +1,284 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "lafe_platform.h"
+__FBSDID("$FreeBSD: src/usr.bin/cpio/matching.c,v 1.2 2008/06/21 02:20:20 kientzle Exp $");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "err.h"
+#include "line_reader.h"
+#include "matching.h"
+#include "pathmatch.h"
+
+struct match {
+ struct match *next;
+ int matches;
+ char pattern[1];
+};
+
+struct lafe_matching {
+ struct match *exclusions;
+ int exclusions_count;
+ struct match *inclusions;
+ int inclusions_count;
+ int inclusions_unmatched_count;
+};
+
+static void add_pattern(struct match **list, const char *pattern);
+static void initialize_matching(struct lafe_matching **);
+static int match_exclusion(struct match *, const char *pathname);
+static int match_inclusion(struct match *, const char *pathname);
+
+/*
+ * The matching logic here needs to be re-thought. I started out to
+ * try to mimic gtar's matching logic, but it's not entirely
+ * consistent. In particular 'tar -t' and 'tar -x' interpret patterns
+ * on the command line as anchored, but --exclude doesn't.
+ */
+
+/*
+ * Utility functions to manage exclusion/inclusion patterns
+ */
+
+int
+lafe_exclude(struct lafe_matching **matching, const char *pattern)
+{
+
+ if (*matching == NULL)
+ initialize_matching(matching);
+ add_pattern(&((*matching)->exclusions), pattern);
+ (*matching)->exclusions_count++;
+ return (0);
+}
+
+int
+lafe_exclude_from_file(struct lafe_matching **matching, const char *pathname)
+{
+ struct lafe_line_reader *lr;
+ const char *p;
+ int ret = 0;
+
+ lr = lafe_line_reader(pathname, '\n');
+ while ((p = lafe_line_reader_next(lr)) != NULL) {
+ if (lafe_exclude(matching, p) != 0)
+ ret = -1;
+ }
+ lafe_line_reader_free(lr);
+ return (ret);
+}
+
+int
+lafe_include(struct lafe_matching **matching, const char *pattern)
+{
+
+ if (*matching == NULL)
+ initialize_matching(matching);
+ add_pattern(&((*matching)->inclusions), pattern);
+ (*matching)->inclusions_count++;
+ (*matching)->inclusions_unmatched_count++;
+ return (0);
+}
+
+int
+lafe_include_from_file(struct lafe_matching **matching, const char *pathname,
+ int nullSeparator)
+{
+ struct lafe_line_reader *lr;
+ const char *p;
+ int ret = 0;
+
+ lr = lafe_line_reader(pathname, nullSeparator);
+ while ((p = lafe_line_reader_next(lr)) != NULL) {
+ if (lafe_include(matching, p) != 0)
+ ret = -1;
+ }
+ lafe_line_reader_free(lr);
+ return (ret);
+}
+
+static void
+add_pattern(struct match **list, const char *pattern)
+{
+ struct match *match;
+ size_t len;
+
+ len = strlen(pattern);
+ match = malloc(sizeof(*match) + len + 1);
+ if (match == NULL)
+ lafe_errc(1, errno, "Out of memory");
+ strcpy(match->pattern, pattern);
+ /* Both "foo/" and "foo" should match "foo/bar". */
+ if (len && match->pattern[len - 1] == '/')
+ match->pattern[strlen(match->pattern)-1] = '\0';
+ match->next = *list;
+ *list = match;
+ match->matches = 0;
+}
+
+
+int
+lafe_excluded(struct lafe_matching *matching, const char *pathname)
+{
+ struct match *match;
+ struct match *matched;
+
+ if (matching == NULL)
+ return (0);
+
+ /* Exclusions take priority */
+ for (match = matching->exclusions; match != NULL; match = match->next){
+ if (match_exclusion(match, pathname))
+ return (1);
+ }
+
+ /* Then check for inclusions */
+ matched = NULL;
+ for (match = matching->inclusions; match != NULL; match = match->next){
+ if (match_inclusion(match, pathname)) {
+ /*
+ * If this pattern has never been matched,
+ * then we're done.
+ */
+ if (match->matches == 0) {
+ match->matches++;
+ matching->inclusions_unmatched_count--;
+ return (0);
+ }
+ /*
+ * Otherwise, remember the match but keep checking
+ * in case we can tick off an unmatched pattern.
+ */
+ matched = match;
+ }
+ }
+ /*
+ * We didn't find a pattern that had never been matched, but
+ * we did find a match, so count it and exit.
+ */
+ if (matched != NULL) {
+ matched->matches++;
+ return (0);
+ }
+
+ /* If there were inclusions, default is to exclude. */
+ if (matching->inclusions != NULL)
+ return (1);
+
+ /* No explicit inclusions, default is to match. */
+ return (0);
+}
+
+/*
+ * This is a little odd, but it matches the default behavior of
+ * gtar. In particular, 'a*b' will match 'foo/a1111/222b/bar'
+ *
+ */
+static int
+match_exclusion(struct match *match, const char *pathname)
+{
+ return (lafe_pathmatch(match->pattern,
+ pathname,
+ PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
+}
+
+/*
+ * Again, mimic gtar: inclusions are always anchored (have to match
+ * the beginning of the path) even though exclusions are not anchored.
+ */
+static int
+match_inclusion(struct match *match, const char *pathname)
+{
+#if 0
+ return (lafe_pathmatch(match->pattern, pathname, 0));
+#else
+ return (lafe_pathmatch(match->pattern, pathname, PATHMATCH_NO_ANCHOR_END));
+#endif
+}
+
+void
+lafe_cleanup_exclusions(struct lafe_matching **matching)
+{
+ struct match *p, *q;
+
+ if (*matching == NULL)
+ return;
+
+ for (p = (*matching)->inclusions; p != NULL; ) {
+ q = p;
+ p = p->next;
+ free(q);
+ }
+
+ for (p = (*matching)->exclusions; p != NULL; ) {
+ q = p;
+ p = p->next;
+ free(q);
+ }
+
+ free(*matching);
+ *matching = NULL;
+}
+
+static void
+initialize_matching(struct lafe_matching **matching)
+{
+ *matching = calloc(sizeof(**matching), 1);
+ if (*matching == NULL)
+ lafe_errc(1, errno, "No memory");
+}
+
+int
+lafe_unmatched_inclusions(struct lafe_matching *matching)
+{
+
+ if (matching == NULL)
+ return (0);
+ return (matching->inclusions_unmatched_count);
+}
+
+int
+lafe_unmatched_inclusions_warn(struct lafe_matching *matching, const char *msg)
+{
+ struct match *p;
+
+ if (matching == NULL)
+ return (0);
+
+ for (p = matching->inclusions; p != NULL; p = p->next) {
+ if (p->matches == 0)
+ lafe_warnc(0, "%s: %s", p->pattern, msg);
+ }
+
+ return (matching->inclusions_unmatched_count);
+}
diff --git a/archivers/libarchive/files/libarchive_fe/matching.h b/archivers/libarchive/files/libarchive_fe/matching.h
new file mode 100644
index 00000000000..f4edebd4399
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/matching.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef MATCHING_H
+#define MATCHING_H
+
+struct lafe_matching;
+
+int lafe_exclude(struct lafe_matching **matching, const char *pattern);
+int lafe_exclude_from_file(struct lafe_matching **matching,
+ const char *pathname);
+int lafe_include(struct lafe_matching **matching, const char *pattern);
+int lafe_include_from_file(struct lafe_matching **matching,
+ const char *pathname, int nullSeparator);
+
+int lafe_excluded(struct lafe_matching *, const char *pathname);
+void lafe_cleanup_exclusions(struct lafe_matching **);
+int lafe_unmatched_inclusions(struct lafe_matching *);
+int lafe_unmatched_inclusions_warn(struct lafe_matching *, const char *msg);
+
+#endif
diff --git a/archivers/libarchive/files/libarchive_fe/pathmatch.c b/archivers/libarchive/files/libarchive_fe/pathmatch.c
new file mode 100644
index 00000000000..85074bdb30b
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/pathmatch.c
@@ -0,0 +1,255 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "lafe_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "pathmatch.h"
+
+/*
+ * Check whether a character 'c' is matched by a list specification [...]:
+ * * Leading '!' negates the class.
+ * * <char>-<char> is a range of characters
+ * * \<char> removes any special meaning for <char>
+ *
+ * Some interesting boundary cases:
+ * a-d-e is one range (a-d) followed by two single characters - and e.
+ * \a-\d is same as a-d
+ * a\-d is three single characters: a, d, -
+ * Trailing - is not special (so [a-] is two characters a and -).
+ * Initial - is not special ([a-] is same as [-a] is same as [\\-a])
+ * This function never sees a trailing \.
+ * [] always fails
+ * [!] always succeeds
+ */
+static int
+pm_list(const char *start, const char *end, const char c, int flags)
+{
+ const char *p = start;
+ char rangeStart = '\0', nextRangeStart;
+ int match = 1, nomatch = 0;
+
+ /* This will be used soon... */
+ (void)flags; /* UNUSED */
+
+ /* If this is a negated class, return success for nomatch. */
+ if (*p == '!' && p < end) {
+ match = 0;
+ nomatch = 1;
+ ++p;
+ }
+
+ while (p < end) {
+ nextRangeStart = '\0';
+ switch (*p) {
+ case '-':
+ /* Trailing or initial '-' is not special. */
+ if ((rangeStart == '\0') || (p == end - 1)) {
+ if (*p == c)
+ return (match);
+ } else {
+ char rangeEnd = *++p;
+ if (rangeEnd == '\\')
+ rangeEnd = *++p;
+ if ((rangeStart <= c) && (c <= rangeEnd))
+ return (match);
+ }
+ break;
+ case '\\':
+ ++p;
+ /* Fall through */
+ default:
+ if (*p == c)
+ return (match);
+ nextRangeStart = *p; /* Possible start of range. */
+ }
+ rangeStart = nextRangeStart;
+ ++p;
+ }
+ return (nomatch);
+}
+
+/*
+ * If s is pointing to "./", ".//", "./././" or the like, skip it.
+ */
+static const char *
+pm_slashskip(const char *s) {
+ while ((*s == '/')
+ || (s[0] == '.' && s[1] == '/')
+ || (s[0] == '.' && s[1] == '\0'))
+ ++s;
+ return (s);
+}
+
+static int
+pm(const char *p, const char *s, int flags)
+{
+ const char *end;
+
+ /*
+ * Ignore leading './', './/', '././', etc.
+ */
+ if (s[0] == '.' && s[1] == '/')
+ s = pm_slashskip(s + 1);
+ if (p[0] == '.' && p[1] == '/')
+ p = pm_slashskip(p + 1);
+
+ for (;;) {
+ switch (*p) {
+ case '\0':
+ if (s[0] == '/') {
+ if (flags & PATHMATCH_NO_ANCHOR_END)
+ return (1);
+ /* "dir" == "dir/" == "dir/." */
+ s = pm_slashskip(s);
+ }
+ return (*s == '\0');
+ case '?':
+ /* ? always succeds, unless we hit end of 's' */
+ if (*s == '\0')
+ return (0);
+ break;
+ case '*':
+ /* "*" == "**" == "***" ... */
+ while (*p == '*')
+ ++p;
+ /* Trailing '*' always succeeds. */
+ if (*p == '\0')
+ return (1);
+ while (*s) {
+ if (lafe_pathmatch(p, s, flags))
+ return (1);
+ ++s;
+ }
+ return (0);
+ case '[':
+ /*
+ * Find the end of the [...] character class,
+ * ignoring \] that might occur within the class.
+ */
+ end = p + 1;
+ while (*end != '\0' && *end != ']') {
+ if (*end == '\\' && end[1] != '\0')
+ ++end;
+ ++end;
+ }
+ if (*end == ']') {
+ /* We found [...], try to match it. */
+ if (!pm_list(p + 1, end, *s, flags))
+ return (0);
+ p = end; /* Jump to trailing ']' char. */
+ break;
+ } else
+ /* No final ']', so just match '['. */
+ if (*p != *s)
+ return (0);
+ break;
+ case '\\':
+ /* Trailing '\\' matches itself. */
+ if (p[1] == '\0') {
+ if (*s != '\\')
+ return (0);
+ } else {
+ ++p;
+ if (*p != *s)
+ return (0);
+ }
+ break;
+ case '/':
+ if (*s != '/' && *s != '\0')
+ return (0);
+ /* Note: pattern "/\./" won't match "/";
+ * pm_slashskip() correctly stops at backslash. */
+ p = pm_slashskip(p);
+ s = pm_slashskip(s);
+ if (*p == '\0' && (flags & PATHMATCH_NO_ANCHOR_END))
+ return (1);
+ --p; /* Counteract the increment below. */
+ --s;
+ break;
+ case '$':
+ /* '$' is special only at end of pattern and only
+ * if PATHMATCH_NO_ANCHOR_END is specified. */
+ if (p[1] == '\0' && (flags & PATHMATCH_NO_ANCHOR_END)){
+ /* "dir" == "dir/" == "dir/." */
+ return (*pm_slashskip(s) == '\0');
+ }
+ /* Otherwise, '$' is not special. */
+ /* FALL THROUGH */
+ default:
+ if (*p != *s)
+ return (0);
+ break;
+ }
+ ++p;
+ ++s;
+ }
+}
+
+/* Main entry point. */
+int
+lafe_pathmatch(const char *p, const char *s, int flags)
+{
+ /* Empty pattern only matches the empty string. */
+ if (p == NULL || *p == '\0')
+ return (s == NULL || *s == '\0');
+
+ /* Leading '^' anchors the start of the pattern. */
+ if (*p == '^') {
+ ++p;
+ flags &= ~PATHMATCH_NO_ANCHOR_START;
+ }
+
+ if (*p == '/' && *s != '/')
+ return (0);
+
+ /* Certain patterns and file names anchor implicitly. */
+ if (*p == '*' || *p == '/' || *p == '/') {
+ while (*p == '/')
+ ++p;
+ while (*s == '/')
+ ++s;
+ return (pm(p, s, flags));
+ }
+
+ /* If start is unanchored, try to match start of each path element. */
+ if (flags & PATHMATCH_NO_ANCHOR_START) {
+ for ( ; s != NULL; s = strchr(s, '/')) {
+ if (*s == '/')
+ s++;
+ if (pm(p, s, flags))
+ return (1);
+ }
+ return (0);
+ }
+
+ /* Default: Match from beginning. */
+ return (pm(p, s, flags));
+}
diff --git a/archivers/libarchive/files/libarchive_fe/pathmatch.h b/archivers/libarchive/files/libarchive_fe/pathmatch.h
new file mode 100644
index 00000000000..a92f3aef215
--- /dev/null
+++ b/archivers/libarchive/files/libarchive_fe/pathmatch.h
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef LAFE_PATHMATCH_H
+#define LAFE_PATHMATCH_H
+
+/* Don't anchor at beginning unless the pattern starts with "^" */
+#define PATHMATCH_NO_ANCHOR_START 1
+/* Don't anchor at end unless the pattern ends with "$" */
+#define PATHMATCH_NO_ANCHOR_END 2
+
+/* Note that "^" and "$" are not special unless you set the corresponding
+ * flag above. */
+
+int lafe_pathmatch(const char *p, const char *s, int flags);
+
+#endif
diff --git a/archivers/libarchive/files/tar/CMakeLists.txt b/archivers/libarchive/files/tar/CMakeLists.txt
new file mode 100644
index 00000000000..2ed8161d985
--- /dev/null
+++ b/archivers/libarchive/files/tar/CMakeLists.txt
@@ -0,0 +1,55 @@
+############################################
+#
+# How to build bsdtar
+#
+############################################
+IF (ENABLE_TAR)
+
+ SET(bsdtar_SOURCES
+ bsdtar.c
+ bsdtar.h
+ bsdtar_platform.h
+ cmdline.c
+ getdate.c
+ read.c
+ subst.c
+ tree.c
+ tree.h
+ util.c
+ write.c
+ ../libarchive_fe/err.c
+ ../libarchive_fe/err.h
+ ../libarchive_fe/lafe_platform.h
+ ../libarchive_fe/line_reader.c
+ ../libarchive_fe/line_reader.h
+ ../libarchive_fe/matching.c
+ ../libarchive_fe/matching.h
+ ../libarchive_fe/pathmatch.c
+ ../libarchive_fe/pathmatch.h
+ )
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)
+ IF(WIN32 AND NOT CYGWIN)
+ LIST(APPEND bsdtar_SOURCES bsdtar_windows.c)
+ LIST(APPEND bsdtar_SOURCES bsdtar_windows.h)
+ ENDIF(WIN32 AND NOT CYGWIN)
+
+ # bsdtar documentation
+ SET(bsdtar_MANS bsdtar.1)
+
+ # How to build bsdtar
+ ADD_EXECUTABLE(bsdtar ${bsdtar_SOURCES})
+ IF(ENABLE_TAR_SHARED)
+ TARGET_LINK_LIBRARIES(bsdtar archive ${ADDITIONAL_LIBS})
+ ELSE(ENABLE_TAR_SHARED)
+ TARGET_LINK_LIBRARIES(bsdtar archive_static ${ADDITIONAL_LIBS})
+ SET_TARGET_PROPERTIES(bsdtar PROPERTIES COMPILE_DEFINITIONS
+ LIBARCHIVE_STATIC)
+ ENDIF(ENABLE_TAR_SHARED)
+ GET_TARGET_PROPERTY(BSDTAR bsdtar LOCATION)
+
+ # Installation rules
+ INSTALL(TARGETS bsdtar RUNTIME DESTINATION bin)
+ INSTALL_MAN(${bsdtar_MANS})
+ENDIF(ENABLE_TAR)
+
+add_subdirectory(test)
diff --git a/archivers/libarchive/files/tar/bsdtar.1 b/archivers/libarchive/files/tar/bsdtar.1
index e790d60ccb9..67cac1099a0 100644
--- a/archivers/libarchive/files/tar/bsdtar.1
+++ b/archivers/libarchive/files/tar/bsdtar.1
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/usr.bin/tar/bsdtar.1,v 1.43 2008/05/26 17:10:10 kientzle Exp $
+.\" $FreeBSD: src/usr.bin/tar/bsdtar.1,v 1.46 2008/12/06 07:37:55 kientzle Exp $
.\"
-.Dd May 15, 2008
+.Dd Oct 12, 2009
.Dt BSDTAR 1
.Os
.Sh NAME
@@ -37,12 +37,12 @@
.Nm
.Brq Fl c
.Op Ar options
-.Op Ar files | directories
+.Op Ar files | Ar directories
.Nm
.Brq Fl r | Fl u
.Fl f Ar archive-file
.Op Ar options
-.Op Ar files | directories
+.Op Ar files | Ar directories
.Nm
.Brq Fl t | Fl x
.Op Ar options
@@ -144,21 +144,21 @@ In c and r mode, this changes the directory before adding
the following files.
In x mode, change directories after opening the archive
but before extracting entries from the archive.
-.It Fl -check-links ( Fl W Cm check-links )
+.It Fl -check-links
(c and r modes only)
Issue a warning message unless all links to each file are archived.
-.It Fl -chroot ( Fl W Cm chroot )
+.It Fl -chroot
(x mode only)
.Fn chroot
to the current directory after processing any
.Fl C
options and before extracting any files.
-.It Fl -exclude Ar pattern ( Fl W Cm exclude Ns = Ns Ar pattern )
+.It Fl -exclude Ar pattern
Do not process files or directories that match the
specified pattern.
Note that exclusions take precedence over patterns or filenames
specified on the command line.
-.It Fl -format Ar format ( Fl W Cm format Ns = Ns Ar format )
+.It Fl -format Ar format
(c, r, u mode only)
Use the specified format for the created archive.
Supported formats include
@@ -193,7 +193,7 @@ Synonym for
.It Fl I
Synonym for
.Fl T .
-.It Fl -include Ar pattern ( Fl W Cm include Ns = Ns Ar pattern )
+.It Fl -include Ar pattern
Process only files or directories that match the specified pattern.
Note that exclusions specified with
.Fl -exclude
@@ -225,7 +225,7 @@ automatically when reading archives.
Do not overwrite existing files.
In particular, if a file appears more than once in an archive,
later copies will not overwrite earlier copies.
-.It Fl -keep-newer-files ( Fl W Cm keep-newer-files )
+.It Fl -keep-newer-files
(x mode only)
Do not overwrite existing files that are newer than the
versions appearing in the archive being extracted.
@@ -245,28 +245,28 @@ By default, the modification time is set to the time stored in the archive.
.It Fl n
(c, r, u modes only)
Do not recursively archive the contents of directories.
-.It Fl -newer Ar date ( Fl W Cm newer Ns = Ns Ar date )
+.It Fl -newer Ar date
(c, r, u modes only)
Only include files and directories newer than the specified date.
This compares ctime entries.
-.It Fl -newer-mtime Ar date ( Fl W Cm newer-mtime Ns = Ns Ar date )
+.It Fl -newer-mtime Ar date
(c, r, u modes only)
Like
.Fl -newer ,
except it compares mtime entries instead of ctime entries.
-.It Fl -newer-than Pa file ( Fl W Cm newer-than Ns = Ns Pa file )
+.It Fl -newer-than Pa file
(c, r, u modes only)
Only include files and directories newer than the specified file.
This compares ctime entries.
-.It Fl -newer-mtime-than Pa file ( Fl W Cm newer-mtime-than Ns = Ns Pa file )
+.It Fl -newer-mtime-than Pa file
(c, r, u modes only)
Like
.Fl -newer-than ,
except it compares mtime entries instead of ctime entries.
-.It Fl -nodump ( Fl W Cm nodump )
+.It Fl -nodump
(c and r modes only)
Honor the nodump file flag by skipping this file.
-.It Fl -null ( Fl W Cm null )
+.It Fl -null
(use with
.Fl I ,
.Fl T ,
@@ -302,9 +302,80 @@ the archive will be discarded.
(c, r, u mode)
A synonym for
.Fl -format Ar ustar
-.It Fl -one-file-system ( Fl W Cm one-file-system )
+.It Fl -one-file-system
(c, r, and u modes)
Do not cross mount points.
+.It Fl -options Ar options
+Select optional behaviors for particular modules.
+The argument is a text string containing comma-separated
+keywords and values.
+These are passed to the modules that handle particular
+formats to control how those formats will behave.
+Each option has one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar key=value
+The key will be set to the specified value in every module that supports it.
+Modules that do not support this key will ignore it.
+.It Ar key
+The key will be enabled in every module that supports it.
+This is equivalent to
+.Ar key Ns Cm =1 .
+.It Ar !key
+The key will be disabled in every module that supports it.
+.It Ar module:key=value , Ar module:key , Ar module:!key
+As above, but the corresponding key and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The currently supported modules and keys are:
+.Bl -tag -compact -width indent
+.It Cm iso9660:joliet
+Support Joliet extensions.
+This is enabled by default, use
+.Cm !joliet
+or
+.Cm iso9660:!joliet
+to disable.
+.It Cm iso9660:rockridge
+Support Rock Ridge extensions.
+This is enabled by default, use
+.Cm !rockridge
+or
+.Cm iso9660:!rockridge
+to disable.
+.It Cm gzip:compression-level
+A decimal integer from 0 to 9 specifying the gzip compression level.
+.It Cm xz:compression-level
+A decimal integer from 0 to 9 specifying the xz compression level.
+.It Cm mtree: Ns Ar keyword
+The mtree writer module allows you to specify which mtree keywords
+will be included in the output.
+Supported keywords include:
+.Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent ,
+.Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 ,
+.Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname .
+The default is equivalent to:
+.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
+.It Cm mtree:all
+Enables all of the above keywords.
+You can also use
+.Cm mtree:!all
+to disable all keywords.
+.It Cm mtree:use-set
+Enable generation of
+.Cm /set
+lines in the output.
+.It Cm mtree:indent
+Produce human-readable output by indenting options and splitting lines
+to fit into 80 columns.
+.It Cm zip:compression Ns = Ns Ar type
+Use
+.Ar type
+as compression method.
+Supported values are store (uncompressed) and deflate (gzip algorithm).
+.El
+If a provided option is not supported by any module, that
+is a fatal error.
.It Fl P
Preserve pathnames.
By default, absolute pathnames (those that begin with a /
@@ -345,8 +416,8 @@ Extract files as sparse files.
For every block on disk, check first if it contains only NULL bytes and seek
over it otherwise.
This works similiar to the conv=sparse option of dd.
-.It Fl -strip-components Ar count ( Fl W Cm strip-components Ns = Ns Ar count )
-(x and t mode only)
+.It Fl -strip-components Ar count
+(x mode only)
Remove the specified number of leading path elements.
Pathnames with fewer elements will be silently skipped.
Note that the pathname is edited after checking inclusion/exclusion patterns
@@ -354,10 +425,20 @@ but before security checks.
.It Fl s Ar pattern
Modify file or archive member names according to
.Pa pattern .
-The pattern has the format /old/new/[gps].
-old is a basic regular expression.
-If it doesn't apply, the pattern is skipped.
-new is the replacement string of the matched part.
+The pattern has the format
+.Ar /old/new/ Ns Op gps
+where
+.Ar old
+is a basic regular expression,
+.Ar new
+is the replacement string of the matched part,
+and the optional trailing letters modify
+how the replacement is handled.
+If
+.Ar old
+is not matched, the pattern is skipped.
+Within
+.Ar new ,
~ is substituted with the match, \1 to \9 with the content of
the corresponding captured group.
The optional trailing g specifies that matching should continue
@@ -412,16 +493,12 @@ will produce output similar to that of
Additional
.Fl v
options will provide additional detail.
-.It Fl W Ar longopt=value
-Long options (preceded by
-.Fl - )
-are only supported directly on systems that have the
-.Xr getopt_long 3
-function.
-The
-.Fl W
-option can be used to access long options on systems that
-do not support this function.
+.It Fl -version
+Print version of
+.Nm
+and
+.Nm libarchive ,
+and exit.
.It Fl w
Ask for confirmation for every action.
.It Fl X Ar filename
@@ -544,6 +621,7 @@ format can be used to create an output archive with arbitrary ownership,
permissions, or names that differ from existing data on disk:
.Pp
.Dl $ cat input.mtree
+.Dl #mtree
.Dl usr/bin uid=0 gid=0 mode=0755 type=dir
.Dl usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
.Dl $ tar -cvf output.tar @input.mtree
@@ -558,6 +636,27 @@ switches accept a variety of common date and time specifications, including
.Dq 5 minutes ago ,
and
.Dq 19:14 PST May 1 .
+.Pp
+The
+.Fl -options
+argument can be used to control various details of archive generation
+or reading.
+For example, you can generate mtree output which only contains
+.Cm type , Cm time ,
+and
+.Cm uid
+keywords:
+.Dl Nm Fl cf Pa file.tar Fl -format=mtree Fl -options='!all,type,time,uid' Pa dir
+or you can set the compression level used by gzip or xz compression:
+.Dl Nm Fl czf Pa file.tar Fl -options='compression-level=9' .
+For more details, see the explanation of the
+.Fn archive_read_set_options
+and
+.Fn archive_write_set_options
+API calls that are described in
+.Xr archive_read 3
+and
+.Xr archive_write 3 .
.Sh COMPATIBILITY
The bundled-arguments format is supported for compatibility
with historic implementations.
@@ -610,8 +709,8 @@ and
.Cm w
options.
.Pp
-On systems that support getopt_long(), additional long options
-are available to improve compatibility with other tar implementations.
+Additional long options are provided to improve compatibility with other
+tar implementations.
.Sh SECURITY
Certain security issues are common to many archiving programs, including
.Nm .
diff --git a/archivers/libarchive/files/tar/bsdtar.c b/archivers/libarchive/files/tar/bsdtar.c
index 1c13cc6bfbe..d8f8286842e 100644
--- a/archivers/libarchive/files/tar/bsdtar.c
+++ b/archivers/libarchive/files/tar/bsdtar.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.91 2008/05/26 17:10:10 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.93 2008/11/08 04:43:24 kientzle Exp $");
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
@@ -38,18 +38,6 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.91 2008/05/26 17:10:10 kientzle
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_GETOPT_LONG
-#include <getopt.h>
-#else
-struct option {
- const char *name;
- int has_arg;
- int *flag;
- int val;
-};
-#define no_argument 0
-#define required_argument 1
-#endif
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif
@@ -59,6 +47,9 @@ struct option {
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -77,14 +68,7 @@ struct option {
#endif
#include "bsdtar.h"
-
-#if !HAVE_DECL_OPTARG
-extern int optarg;
-#endif
-
-#if !HAVE_DECL_OPTIND
-extern int optind;
-#endif
+#include "err.h"
/*
* Per POSIX.1-1988, tar defaults to reading/writing archives to/from
@@ -93,140 +77,53 @@ extern int optind;
#ifdef __linux
#define _PATH_DEFTAPE "/dev/st0"
#endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define _PATH_DEFTAPE "\\\\.\\tape0"
+#endif
#ifndef _PATH_DEFTAPE
#define _PATH_DEFTAPE "/dev/tape"
#endif
-/* External function to parse a date/time string (from getdate.y) */
-time_t get_date(const char *);
+#ifdef __MINGW32__
+int _CRT_glob = 0; /* Disable broken CRT globbing. */
+#endif
-static int bsdtar_getopt(struct bsdtar *, const char *optstring,
- const struct option **poption);
-static void long_help(struct bsdtar *);
-static void only_mode(struct bsdtar *, const char *opt,
- const char *valid);
-static char ** rewrite_argv(struct bsdtar *,
- int *argc, char ** src_argv,
- const char *optstring);
-static void set_mode(struct bsdtar *, char opt);
-static void version(void);
+static struct bsdtar *_bsdtar;
-/*
- * The leading '+' here forces the GNU version of getopt() (as well as
- * both the GNU and BSD versions of getopt_long) to stop at the first
- * non-option. Otherwise, GNU getopt() permutes the arguments and
- * screws up -C processing.
- */
-static const char *tar_opts = "+Bb:C:cf:HhI:jkLlmnOoPprts:ST:UuvW:wX:xyZz";
+#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1))
+static volatile int siginfo_occurred;
-/*
- * Most of these long options are deliberately not documented. They
- * are provided only to make life easier for people who also use GNU tar.
- * The only long options documented in the manual page are the ones
- * with no corresponding short option, such as --exclude, --nodump,
- * and --fast-read.
- *
- * On systems that lack getopt_long, long options can be specified
- * using -W longopt and -W longopt=value, e.g. "-W nodump" is the same
- * as "--nodump" and "-W exclude=pattern" is the same as "--exclude
- * pattern". This does not rely the GNU getopt() "W;" extension, so
- * should work correctly on any system with a POSIX-compliant getopt().
- */
+static void
+siginfo_handler(int sig)
+{
+ (void)sig; /* UNUSED */
+ siginfo_occurred = 1;
+}
+
+int
+need_report(void)
+{
+ int r = siginfo_occurred;
+ siginfo_occurred = 0;
+ return (r);
+}
+#else
+int
+need_report(void)
+{
+ return (0);
+}
+#endif
-/* Fake short equivalents for long options that otherwise lack them. */
-enum {
- OPTION_CHECK_LINKS = 1,
- OPTION_CHROOT,
- OPTION_EXCLUDE,
- OPTION_FORMAT,
- OPTION_HELP,
- OPTION_INCLUDE,
- OPTION_KEEP_NEWER_FILES,
- OPTION_NEWER_CTIME,
- OPTION_NEWER_CTIME_THAN,
- OPTION_NEWER_MTIME,
- OPTION_NEWER_MTIME_THAN,
- OPTION_NODUMP,
- OPTION_NO_SAME_OWNER,
- OPTION_NO_SAME_PERMISSIONS,
- OPTION_NULL,
- OPTION_NUMERIC_OWNER,
- OPTION_ONE_FILE_SYSTEM,
- OPTION_POSIX,
- OPTION_STRIP_COMPONENTS,
- OPTION_TOTALS,
- OPTION_USE_COMPRESS_PROGRAM,
- OPTION_VERSION
-};
+/* External function to parse a date/time string */
+time_t get_date(time_t, const char *);
-/*
- * If you add anything, be very careful to keep this list properly
- * sorted, as the -W logic relies on it.
- */
-static const struct option tar_longopts[] = {
- { "absolute-paths", no_argument, NULL, 'P' },
- { "append", no_argument, NULL, 'r' },
- { "block-size", required_argument, NULL, 'b' },
- { "bunzip2", no_argument, NULL, 'j' },
- { "bzip", no_argument, NULL, 'j' },
- { "bzip2", no_argument, NULL, 'j' },
- { "cd", required_argument, NULL, 'C' },
- { "check-links", no_argument, NULL, OPTION_CHECK_LINKS },
- { "chroot", no_argument, NULL, OPTION_CHROOT },
- { "compress", no_argument, NULL, 'Z' },
- { "confirmation", no_argument, NULL, 'w' },
- { "create", no_argument, NULL, 'c' },
- { "dereference", no_argument, NULL, 'L' },
- { "directory", required_argument, NULL, 'C' },
- { "exclude", required_argument, NULL, OPTION_EXCLUDE },
- { "exclude-from", required_argument, NULL, 'X' },
- { "extract", no_argument, NULL, 'x' },
- { "fast-read", no_argument, NULL, 'q' },
- { "file", required_argument, NULL, 'f' },
- { "files-from", required_argument, NULL, 'T' },
- { "format", required_argument, NULL, OPTION_FORMAT },
- { "gunzip", no_argument, NULL, 'z' },
- { "gzip", no_argument, NULL, 'z' },
- { "help", no_argument, NULL, OPTION_HELP },
- { "include", required_argument, NULL, OPTION_INCLUDE },
- { "interactive", no_argument, NULL, 'w' },
- { "insecure", no_argument, NULL, 'P' },
- { "keep-newer-files", no_argument, NULL, OPTION_KEEP_NEWER_FILES },
- { "keep-old-files", no_argument, NULL, 'k' },
- { "list", no_argument, NULL, 't' },
- { "modification-time", no_argument, NULL, 'm' },
- { "newer", required_argument, NULL, OPTION_NEWER_CTIME },
- { "newer-ctime", required_argument, NULL, OPTION_NEWER_CTIME },
- { "newer-ctime-than", required_argument, NULL, OPTION_NEWER_CTIME_THAN },
- { "newer-mtime", required_argument, NULL, OPTION_NEWER_MTIME },
- { "newer-mtime-than", required_argument, NULL, OPTION_NEWER_MTIME_THAN },
- { "newer-than", required_argument, NULL, OPTION_NEWER_CTIME_THAN },
- { "nodump", no_argument, NULL, OPTION_NODUMP },
- { "norecurse", no_argument, NULL, 'n' },
- { "no-recursion", no_argument, NULL, 'n' },
- { "no-same-owner", no_argument, NULL, OPTION_NO_SAME_OWNER },
- { "no-same-permissions",no_argument, NULL, OPTION_NO_SAME_PERMISSIONS },
- { "null", no_argument, NULL, OPTION_NULL },
- { "numeric-owner", no_argument, NULL, OPTION_NUMERIC_OWNER },
- { "one-file-system", no_argument, NULL, OPTION_ONE_FILE_SYSTEM },
- { "posix", no_argument, NULL, OPTION_POSIX },
- { "preserve-permissions", no_argument, NULL, 'p' },
- { "read-full-blocks", no_argument, NULL, 'B' },
- { "same-permissions", no_argument, NULL, 'p' },
- { "strip-components", required_argument, NULL, OPTION_STRIP_COMPONENTS },
- { "to-stdout", no_argument, NULL, 'O' },
- { "totals", no_argument, NULL, OPTION_TOTALS },
- { "uncompress", no_argument, NULL, 'Z' },
- { "unlink", no_argument, NULL, 'U' },
- { "unlink-first", no_argument, NULL, 'U' },
- { "update", no_argument, NULL, 'u' },
- { "use-compress-program",
- required_argument, NULL, OPTION_USE_COMPRESS_PROGRAM },
- { "verbose", no_argument, NULL, 'v' },
- { "version", no_argument, NULL, OPTION_VERSION },
- { NULL, 0, NULL, 0 }
-};
+static void long_help(void);
+static void only_mode(struct bsdtar *, const char *opt,
+ const char *valid);
+static void set_mode(struct bsdtar *, char opt);
+static void version(void);
/* A basic set of security flags to request from libarchive. */
#define SECURITY \
@@ -237,34 +134,61 @@ int
main(int argc, char **argv)
{
struct bsdtar *bsdtar, bsdtar_storage;
- const struct option *option;
int opt, t;
char option_o;
char possible_help_request;
char buff[16];
+ time_t now;
/*
* Use a pointer for consistency, but stack-allocated storage
* for ease of cleanup.
*/
- bsdtar = &bsdtar_storage;
+ _bsdtar = bsdtar = &bsdtar_storage;
memset(bsdtar, 0, sizeof(*bsdtar));
bsdtar->fd = -1; /* Mark as "unused" */
option_o = 0;
- /* Need bsdtar->progname before calling bsdtar_warnc. */
+#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1))
+ { /* Catch SIGINFO and SIGUSR1, if they exist. */
+ struct sigaction sa;
+ sa.sa_handler = siginfo_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+#ifdef SIGINFO
+ if (sigaction(SIGINFO, &sa, NULL))
+ lafe_errc(1, errno, "sigaction(SIGINFO) failed");
+#endif
+#ifdef SIGUSR1
+ /* ... and treat SIGUSR1 the same way as SIGINFO. */
+ if (sigaction(SIGUSR1, &sa, NULL))
+ lafe_errc(1, errno, "sigaction(SIGUSR1) failed");
+#endif
+ }
+#endif
+
+
+ /* Need lafe_progname before calling lafe_warnc. */
if (*argv == NULL)
- bsdtar->progname = "bsdtar";
+ lafe_progname = "bsdtar";
else {
- bsdtar->progname = strrchr(*argv, '/');
- if (bsdtar->progname != NULL)
- bsdtar->progname++;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ lafe_progname = strrchr(*argv, '\\');
+#else
+ lafe_progname = strrchr(*argv, '/');
+#endif
+ if (lafe_progname != NULL)
+ lafe_progname++;
else
- bsdtar->progname = *argv;
+ lafe_progname = *argv;
}
+ time(&now);
+
+#if HAVE_SETLOCALE
if (setlocale(LC_ALL, "") == NULL)
- bsdtar_warnc(bsdtar, 0, "Failed to set default locale");
+ lafe_warnc(0, "Failed to set default locale");
+#endif
#if defined(HAVE_NL_LANGINFO) && defined(HAVE_D_MD_ORDER)
bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd');
#endif
@@ -284,7 +208,9 @@ main(int argc, char **argv)
/* Default: Perform basic security checks. */
bsdtar->extract_flags |= SECURITY;
- /* Defaults for root user: */
+#ifndef _WIN32
+ /* On POSIX systems, assume --same-owner and -p when run by
+ * the root user. This doesn't make any sense on Windows. */
if (bsdtar->user_uid == 0) {
/* --same-owner */
bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER;
@@ -294,34 +220,31 @@ main(int argc, char **argv)
bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
}
-
- /* Rewrite traditional-style tar arguments, if used. */
- argv = rewrite_argv(bsdtar, &argc, argv, tar_opts);
+#endif
bsdtar->argv = argv;
bsdtar->argc = argc;
- /* Process all remaining arguments now. */
/*
* Comments following each option indicate where that option
* originated: SUSv2, POSIX, GNU tar, star, etc. If there's
* no such comment, then I don't know of anyone else who
* implements that option.
*/
- while ((opt = bsdtar_getopt(bsdtar, tar_opts, &option)) != -1) {
+ while ((opt = bsdtar_getopt(bsdtar)) != -1) {
switch (opt) {
case 'B': /* GNU tar */
/* libarchive doesn't need this; just ignore it. */
break;
case 'b': /* SUSv2 */
- t = atoi(optarg);
- if (t <= 0 || t > 1024)
- bsdtar_errc(bsdtar, 1, 0,
- "Argument to -b is out of range (1..1024)");
+ t = atoi(bsdtar->optarg);
+ if (t <= 0 || t > 8192)
+ lafe_errc(1, 0,
+ "Argument to -b is out of range (1..8192)");
bsdtar->bytes_per_block = 512 * t;
break;
case 'C': /* GNU tar */
- set_chdir(bsdtar, optarg);
+ set_chdir(bsdtar, bsdtar->optarg);
break;
case 'c': /* SUSv2 */
set_mode(bsdtar, opt);
@@ -333,15 +256,18 @@ main(int argc, char **argv)
bsdtar->option_chroot = 1;
break;
case OPTION_EXCLUDE: /* GNU tar */
- if (exclude(bsdtar, optarg))
- bsdtar_errc(bsdtar, 1, 0,
- "Couldn't exclude %s\n", optarg);
+ if (lafe_exclude(&bsdtar->matching, bsdtar->optarg))
+ lafe_errc(1, 0,
+ "Couldn't exclude %s\n", bsdtar->optarg);
break;
case OPTION_FORMAT: /* GNU tar, others */
- bsdtar->create_format = optarg;
+ bsdtar->create_format = bsdtar->optarg;
+ break;
+ case OPTION_OPTIONS:
+ bsdtar->option_options = bsdtar->optarg;
break;
case 'f': /* SUSv2 */
- bsdtar->filename = optarg;
+ bsdtar->filename = bsdtar->optarg;
if (strcmp(bsdtar->filename, "-") == 0)
bsdtar->filename = NULL;
break;
@@ -354,7 +280,7 @@ main(int argc, char **argv)
possible_help_request = 1;
break;
case OPTION_HELP: /* GNU tar, others */
- long_help(bsdtar);
+ long_help();
exit(0);
break;
case 'I': /* GNU tar */
@@ -368,7 +294,7 @@ main(int argc, char **argv)
* permissions without having to create those
* permissions on disk.
*/
- bsdtar->names_from_file = optarg;
+ bsdtar->names_from_file = bsdtar->optarg;
break;
case OPTION_INCLUDE:
/*
@@ -376,22 +302,24 @@ main(int argc, char **argv)
* noone else needs this to filter entries
* when transforming archives.
*/
- if (include(bsdtar, optarg))
- bsdtar_errc(bsdtar, 1, 0,
+ if (lafe_include(&bsdtar->matching, bsdtar->optarg))
+ lafe_errc(1, 0,
"Failed to add %s to inclusion list",
- optarg);
+ bsdtar->optarg);
break;
case 'j': /* GNU tar */
-#if HAVE_LIBBZ2
if (bsdtar->create_compression != '\0')
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
+ "Can't specify both -%c and -%c", opt,
+ bsdtar->create_compression);
+ bsdtar->create_compression = opt;
+ break;
+ case 'J': /* GNU tar 1.21 and later */
+ if (bsdtar->create_compression != '\0')
+ lafe_errc(1, 0,
"Can't specify both -%c and -%c", opt,
bsdtar->create_compression);
bsdtar->create_compression = opt;
-#else
- bsdtar_warnc(bsdtar, 0, "-j compression not supported by this version of bsdtar");
- usage(bsdtar);
-#endif
break;
case 'k': /* GNU tar */
bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE;
@@ -406,6 +334,13 @@ main(int argc, char **argv)
/* GNU tar 1.13 used -l for --one-file-system */
bsdtar->option_warn_links = 1;
break;
+ case OPTION_LZMA:
+ if (bsdtar->create_compression != '\0')
+ lafe_errc(1, 0,
+ "Can't specify both -%c and -%c", opt,
+ bsdtar->create_compression);
+ bsdtar->create_compression = opt;
+ break;
case 'm': /* SUSv2 */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;
break;
@@ -420,28 +355,28 @@ main(int argc, char **argv)
* TODO: Add corresponding "older" options to reverse these.
*/
case OPTION_NEWER_CTIME: /* GNU tar */
- bsdtar->newer_ctime_sec = get_date(optarg);
+ bsdtar->newer_ctime_sec = get_date(now, bsdtar->optarg);
break;
case OPTION_NEWER_CTIME_THAN:
{
struct stat st;
- if (stat(optarg, &st) != 0)
- bsdtar_errc(bsdtar, 1, 0,
- "Can't open file %s", optarg);
+ if (stat(bsdtar->optarg, &st) != 0)
+ lafe_errc(1, 0,
+ "Can't open file %s", bsdtar->optarg);
bsdtar->newer_ctime_sec = st.st_ctime;
bsdtar->newer_ctime_nsec =
ARCHIVE_STAT_CTIME_NANOS(&st);
}
break;
case OPTION_NEWER_MTIME: /* GNU tar */
- bsdtar->newer_mtime_sec = get_date(optarg);
+ bsdtar->newer_mtime_sec = get_date(now, bsdtar->optarg);
break;
case OPTION_NEWER_MTIME_THAN:
{
struct stat st;
- if (stat(optarg, &st) != 0)
- bsdtar_errc(bsdtar, 1, 0,
- "Can't open file %s", optarg);
+ if (stat(bsdtar->optarg, &st) != 0)
+ lafe_errc(1, 0,
+ "Can't open file %s", bsdtar->optarg);
bsdtar->newer_mtime_sec = st.st_mtime;
bsdtar->newer_mtime_nsec =
ARCHIVE_STAT_MTIME_NANOS(&st);
@@ -509,17 +444,21 @@ main(int argc, char **argv)
break;
case 's': /* NetBSD pax-as-tar */
#if HAVE_REGEX_H
- add_substitution(bsdtar, optarg);
+ add_substitution(bsdtar, bsdtar->optarg);
#else
- bsdtar_warnc(bsdtar, 0, "-s is not supported by this version of bsdtar");
- usage(bsdtar);
+ lafe_warnc(0,
+ "-s is not supported by this version of bsdtar");
+ usage();
#endif
break;
+ case OPTION_SAME_OWNER: /* GNU tar */
+ bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER;
+ break;
case OPTION_STRIP_COMPONENTS: /* GNU tar 1.15 */
- bsdtar->strip_components = atoi(optarg);
+ bsdtar->strip_components = atoi(bsdtar->optarg);
break;
case 'T': /* GNU tar */
- bsdtar->names_from_file = optarg;
+ bsdtar->names_from_file = bsdtar->optarg;
break;
case 't': /* SUSv2 */
set_mode(bsdtar, opt);
@@ -544,59 +483,49 @@ main(int argc, char **argv)
#if 0
/*
* The -W longopt feature is handled inside of
- * bsdtar_getop(), so -W is not available here.
+ * bsdtar_getopt(), so -W is not available here.
*/
- case 'W': /* Obscure, but useful GNU convention. */
+ case 'W': /* Obscure GNU convention. */
break;
#endif
case 'w': /* SUSv2 */
bsdtar->option_interactive = 1;
break;
case 'X': /* GNU tar */
- if (exclude_from_file(bsdtar, optarg))
- bsdtar_errc(bsdtar, 1, 0,
+ if (lafe_exclude_from_file(&bsdtar->matching, bsdtar->optarg))
+ lafe_errc(1, 0,
"failed to process exclusions from file %s",
- optarg);
+ bsdtar->optarg);
break;
case 'x': /* SUSv2 */
set_mode(bsdtar, opt);
break;
case 'y': /* FreeBSD version of GNU tar */
-#if HAVE_LIBBZ2
if (bsdtar->create_compression != '\0')
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Can't specify both -%c and -%c", opt,
bsdtar->create_compression);
bsdtar->create_compression = opt;
-#else
- bsdtar_warnc(bsdtar, 0, "-y compression not supported by this version of bsdtar");
- usage(bsdtar);
-#endif
break;
case 'Z': /* GNU tar */
if (bsdtar->create_compression != '\0')
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Can't specify both -%c and -%c", opt,
bsdtar->create_compression);
bsdtar->create_compression = opt;
break;
case 'z': /* GNU tar, star, many others */
-#if HAVE_LIBZ
if (bsdtar->create_compression != '\0')
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Can't specify both -%c and -%c", opt,
bsdtar->create_compression);
bsdtar->create_compression = opt;
-#else
- bsdtar_warnc(bsdtar, 0, "-z compression not supported by this version of bsdtar");
- usage(bsdtar);
-#endif
break;
case OPTION_USE_COMPRESS_PROGRAM:
- bsdtar->compress_program = optarg;
+ bsdtar->compress_program = bsdtar->optarg;
break;
default:
- usage(bsdtar);
+ usage();
}
}
@@ -606,13 +535,13 @@ main(int argc, char **argv)
/* If no "real" mode was specified, treat -h as --help. */
if ((bsdtar->mode == '\0') && possible_help_request) {
- long_help(bsdtar);
+ long_help();
exit(0);
}
/* Otherwise, a mode is required. */
if (bsdtar->mode == '\0')
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Must specify one of -c, -r, -t, -u, -x");
/* Check boolean options only permitted in certain modes. */
@@ -668,9 +597,6 @@ main(int argc, char **argv)
if (bsdtar->strip_components != 0)
only_mode(bsdtar, "--strip-components", "xt");
- bsdtar->argc -= optind;
- bsdtar->argv += optind;
-
switch(bsdtar->mode) {
case 'c':
tar_mode_c(bsdtar);
@@ -689,13 +615,13 @@ main(int argc, char **argv)
break;
}
- cleanup_exclusions(bsdtar);
+ lafe_cleanup_exclusions(&bsdtar->matching);
#if HAVE_REGEX_H
cleanup_substitution(bsdtar);
#endif
if (bsdtar->return_value != 0)
- bsdtar_warnc(bsdtar, 0,
+ lafe_warnc(0,
"Error exit delayed from previous errors.");
return (bsdtar->return_value);
}
@@ -704,7 +630,7 @@ static void
set_mode(struct bsdtar *bsdtar, char opt)
{
if (bsdtar->mode != '\0' && bsdtar->mode != opt)
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Can't specify both -%c and -%c", opt, bsdtar->mode);
bsdtar->mode = opt;
}
@@ -716,94 +642,24 @@ static void
only_mode(struct bsdtar *bsdtar, const char *opt, const char *valid_modes)
{
if (strchr(valid_modes, bsdtar->mode) == NULL)
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Option %s is not permitted in mode -%c",
opt, bsdtar->mode);
}
-/*-
- * Convert traditional tar arguments into new-style.
- * For example,
- * tar tvfb file.tar 32 --exclude FOO
- * will be converted to
- * tar -t -v -f file.tar -b 32 --exclude FOO
- *
- * This requires building a new argv array. The initial bundled word
- * gets expanded into a new string that looks like "-t\0-v\0-f\0-b\0".
- * The new argv array has pointers into this string intermingled with
- * pointers to the existing arguments. Arguments are moved to
- * immediately follow their options.
- *
- * The optstring argument here is the same one passed to getopt(3).
- * It is used to determine which option letters have trailing arguments.
- */
-char **
-rewrite_argv(struct bsdtar *bsdtar, int *argc, char **src_argv,
- const char *optstring)
-{
- char **new_argv, **dest_argv;
- const char *p;
- char *src, *dest;
-
- if (src_argv[0] == NULL || src_argv[1] == NULL ||
- src_argv[1][0] == '-' || src_argv[1][0] == '\0')
- return (src_argv);
-
- *argc += strlen(src_argv[1]) - 1;
- new_argv = malloc((*argc + 1) * sizeof(new_argv[0]));
- if (new_argv == NULL)
- bsdtar_errc(bsdtar, 1, errno, "No Memory");
-
- dest_argv = new_argv;
- *dest_argv++ = *src_argv++;
-
- dest = malloc(strlen(*src_argv) * 3);
- if (dest == NULL)
- bsdtar_errc(bsdtar, 1, errno, "No memory");
- for (src = *src_argv++; *src != '\0'; src++) {
- *dest_argv++ = dest;
- *dest++ = '-';
- *dest++ = *src;
- *dest++ = '\0';
- /* If option takes an argument, insert that into the list. */
- for (p = optstring; p != NULL && *p != '\0'; p++) {
- if (*p != *src)
- continue;
- if (p[1] != ':') /* No arg required, done. */
- break;
- if (*src_argv == NULL) /* No arg available? Error. */
- bsdtar_errc(bsdtar, 1, 0,
- "Option %c requires an argument",
- *src);
- *dest_argv++ = *src_argv++;
- break;
- }
- }
-
- /* Copy remaining arguments, including trailing NULL. */
- while ((*dest_argv++ = *src_argv++) != NULL)
- ;
-
- return (new_argv);
-}
-
void
-usage(struct bsdtar *bsdtar)
+usage(void)
{
const char *p;
- p = bsdtar->progname;
+ p = lafe_progname;
fprintf(stderr, "Usage:\n");
fprintf(stderr, " List: %s -tf <archive-filename>\n", p);
fprintf(stderr, " Extract: %s -xf <archive-filename>\n", p);
fprintf(stderr, " Create: %s -cf <archive-filename> [filenames...]\n", p);
-#ifdef HAVE_GETOPT_LONG
fprintf(stderr, " Help: %s --help\n", p);
-#else
- fprintf(stderr, " Help: %s -h\n", p);
-#endif
exit(1);
}
@@ -826,13 +682,9 @@ static const char *long_help_msg =
" -w Interactive\n"
"Create: %p -c [options] [<file> | <dir> | @<archive> | -C <dir> ]\n"
" <file>, <dir> add these items to archive\n"
- " -z, -j Compress archive with gzip/bzip2\n"
+ " -z, -j, -J, --lzma Compress archive with gzip/bzip2/xz/lzma\n"
" --format {ustar|pax|cpio|shar} Select archive format\n"
-#ifdef HAVE_GETOPT_LONG
" --exclude <pattern> Skip files that match pattern\n"
-#else
- " -W exclude=<pattern> Skip files that match pattern\n"
-#endif
" -C <dir> Change to <dir> before processing remaining files\n"
" @<archive> Add entries from <archive> to output\n"
"List: %p -t [options] [<patterns>]\n"
@@ -856,12 +708,12 @@ static const char *long_help_msg =
* echo bsdtar; else echo not bsdtar; fi
*/
static void
-long_help(struct bsdtar *bsdtar)
+long_help(void)
{
const char *prog;
const char *p;
- prog = bsdtar->progname;
+ prog = lafe_progname;
fflush(stderr);
@@ -880,80 +732,3 @@ long_help(struct bsdtar *bsdtar)
}
version();
}
-
-static int
-bsdtar_getopt(struct bsdtar *bsdtar, const char *optstring,
- const struct option **poption)
-{
- char *p, *q;
- const struct option *option;
- int opt;
- int option_index;
- size_t option_length;
-
- option_index = -1;
- *poption = NULL;
-
-#ifdef HAVE_GETOPT_LONG
- opt = getopt_long(bsdtar->argc, bsdtar->argv, optstring,
- tar_longopts, &option_index);
- if (option_index > -1)
- *poption = tar_longopts + option_index;
-#else
- opt = getopt(bsdtar->argc, bsdtar->argv, optstring);
-#endif
-
- /* Support long options through -W longopt=value */
- if (opt == 'W') {
- p = optarg;
- q = strchr(optarg, '=');
- if (q != NULL) {
- option_length = (size_t)(q - p);
- optarg = q + 1;
- } else {
- option_length = strlen(p);
- optarg = NULL;
- }
- option = tar_longopts;
- while (option->name != NULL &&
- (strlen(option->name) < option_length ||
- strncmp(p, option->name, option_length) != 0 )) {
- option++;
- }
-
- if (option->name != NULL) {
- *poption = option;
- opt = option->val;
-
- /* If the first match was exact, we're done. */
- if (strncmp(p, option->name, strlen(option->name)) == 0) {
- while (option->name != NULL)
- option++;
- } else {
- /* Check if there's another match. */
- option++;
- while (option->name != NULL &&
- (strlen(option->name) < option_length ||
- strncmp(p, option->name, option_length) != 0)) {
- option++;
- }
- }
- if (option->name != NULL)
- bsdtar_errc(bsdtar, 1, 0,
- "Ambiguous option %s "
- "(matches both %s and %s)",
- p, (*poption)->name, option->name);
-
- if ((*poption)->has_arg == required_argument
- && optarg == NULL)
- bsdtar_errc(bsdtar, 1, 0,
- "Option \"%s\" requires argument", p);
- } else {
- opt = '?';
- /* TODO: Set up a fake 'struct option' for
- * error reporting... ? ? ? */
- }
- }
-
- return (opt);
-}
diff --git a/archivers/libarchive/files/tar/bsdtar.h b/archivers/libarchive/files/tar/bsdtar.h
index 4153a44f946..5e8dc7f89ec 100644
--- a/archivers/libarchive/files/tar/bsdtar.h
+++ b/archivers/libarchive/files/tar/bsdtar.h
@@ -22,12 +22,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/usr.bin/tar/bsdtar.h,v 1.33 2008/05/26 17:10:10 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/bsdtar.h,v 1.37 2008/12/06 07:37:14 kientzle Exp $
*/
#include "bsdtar_platform.h"
#include <stdio.h>
+#include "matching.h"
+
#define DEFAULT_BYTES_PER_BLOCK (20*512)
/*
@@ -60,6 +62,7 @@ struct bsdtar {
char option_chroot; /* --chroot */
char option_dont_traverse_mounts; /* --one-file-system */
char option_fast_read; /* --fast-read */
+ const char *option_options; /* --options */
char option_honor_nodump; /* --nodump */
char option_interactive; /* -w */
char option_no_owner; /* -o */
@@ -76,10 +79,9 @@ struct bsdtar {
int fd;
/* Miscellaneous state information */
- struct archive *archive;
- const char *progname;
int argc;
char **argv;
+ const char *optarg;
size_t gs_width; /* For 'list_item' in read.c */
size_t u_width; /* for 'list_item' in read.c */
uid_t user_uid; /* UID running this program */
@@ -91,45 +93,62 @@ struct bsdtar {
* Data for various subsystems. Full definitions are located in
* the file where they are used.
*/
- struct archive_entry_linkresolver *resolver;
+ struct archive *diskreader; /* for write.c */
+ struct archive_entry_linkresolver *resolver; /* for write.c */
struct archive_dir *archive_dir; /* for write.c */
struct name_cache *gname_cache; /* for write.c */
- struct matching *matching; /* for matching.c */
+ char *buff; /* for write.c */
+ struct lafe_matching *matching; /* for matching.c */
struct security *security; /* for read.c */
struct name_cache *uname_cache; /* for write.c */
struct siginfo_data *siginfo; /* for siginfo.c */
struct substitution *substitution; /* for subst.c */
};
-void bsdtar_errc(struct bsdtar *, int _eval, int _code,
- const char *fmt, ...);
-void bsdtar_warnc(struct bsdtar *, int _code, const char *fmt, ...);
-void cleanup_exclusions(struct bsdtar *);
+/* Fake short equivalents for long options that otherwise lack them. */
+enum {
+ OPTION_CHECK_LINKS = 1,
+ OPTION_CHROOT,
+ OPTION_EXCLUDE,
+ OPTION_FORMAT,
+ OPTION_OPTIONS,
+ OPTION_HELP,
+ OPTION_INCLUDE,
+ OPTION_KEEP_NEWER_FILES,
+ OPTION_LZMA,
+ OPTION_NEWER_CTIME,
+ OPTION_NEWER_CTIME_THAN,
+ OPTION_NEWER_MTIME,
+ OPTION_NEWER_MTIME_THAN,
+ OPTION_NODUMP,
+ OPTION_NO_SAME_OWNER,
+ OPTION_NO_SAME_PERMISSIONS,
+ OPTION_NULL,
+ OPTION_NUMERIC_OWNER,
+ OPTION_ONE_FILE_SYSTEM,
+ OPTION_POSIX,
+ OPTION_SAME_OWNER,
+ OPTION_STRIP_COMPONENTS,
+ OPTION_TOTALS,
+ OPTION_USE_COMPRESS_PROGRAM,
+ OPTION_VERSION
+};
+
+
+int bsdtar_getopt(struct bsdtar *);
void do_chdir(struct bsdtar *);
int edit_pathname(struct bsdtar *, struct archive_entry *);
-int exclude(struct bsdtar *, const char *pattern);
-int exclude_from_file(struct bsdtar *, const char *pathname);
-int excluded(struct bsdtar *, const char *pathname);
-int include(struct bsdtar *, const char *pattern);
-int include_from_file(struct bsdtar *, const char *pathname);
+int need_report(void);
int pathcmp(const char *a, const char *b);
-int process_lines(struct bsdtar *bsdtar, const char *pathname,
- int (*process)(struct bsdtar *, const char *));
void safe_fprintf(FILE *, const char *fmt, ...);
void set_chdir(struct bsdtar *, const char *newdir);
-void siginfo_init(struct bsdtar *);
-void siginfo_setinfo(struct bsdtar *, const char * oper,
- const char * path, int64_t size);
-void siginfo_printinfo(struct bsdtar *, off_t progress);
-void siginfo_done(struct bsdtar *);
+const char *tar_i64toa(int64_t);
void tar_mode_c(struct bsdtar *bsdtar);
void tar_mode_r(struct bsdtar *bsdtar);
void tar_mode_t(struct bsdtar *bsdtar);
void tar_mode_u(struct bsdtar *bsdtar);
void tar_mode_x(struct bsdtar *bsdtar);
-int unmatched_inclusions(struct bsdtar *bsdtar);
-int unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg);
-void usage(struct bsdtar *);
+void usage(void);
int yes(const char *fmt, ...);
#if HAVE_REGEX_H
diff --git a/archivers/libarchive/files/tar/bsdtar_platform.h b/archivers/libarchive/files/tar/bsdtar_platform.h
index ccb9d3c0257..fce9c99815a 100644
--- a/archivers/libarchive/files/tar/bsdtar_platform.h
+++ b/archivers/libarchive/files/tar/bsdtar_platform.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/usr.bin/tar/bsdtar_platform.h,v 1.25 2008/01/02 00:23:00 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/bsdtar_platform.h,v 1.26 2008/12/06 07:37:14 kientzle Exp $
*/
/*
@@ -37,19 +37,18 @@
#if defined(PLATFORM_CONFIG_H)
/* Use hand-built config.h in environments that need it. */
#include PLATFORM_CONFIG_H
-#elif defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../config.h"
#else
-/* Warn if bsdtar hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no built-in configuration in bsdtar_platform.h.
-#endif /* !HAVE_CONFIG_H */
+/* Not having a config.h of some sort is a serious problem. */
+#include "config.h"
+#endif
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
-#else
-/* Just leaving this macro replacement empty leads to a dangling semicolon. */
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
#define __FBSDID(a) struct _undefined_hack
#endif
@@ -63,29 +62,10 @@
#include "archive_entry.h"
#endif
-/*
- * Does this platform have complete-looking POSIX-style ACL support,
- * including some variant of the acl_get_perm() function (which was
- * omitted from the POSIX.1e draft)?
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_PERMSET_T && HAVE_ACL_USER
-#if HAVE_ACL_GET_PERM || HAVE_ACL_GET_PERM_NP
-#define HAVE_POSIX_ACL 1
-#endif
-#endif
-
#ifdef HAVE_LIBACL
#include <acl/libacl.h>
#endif
-#if HAVE_ACL_GET_PERM
-#define ACL_GET_PERM acl_get_perm
-#else
-#if HAVE_ACL_GET_PERM_NP
-#define ACL_GET_PERM acl_get_perm_np
-#endif
-#endif
-
/*
* Include "dirent.h" (or it's equivalent on several different platforms).
*
@@ -115,36 +95,38 @@
# endif
#endif
-
-/*
- * We need to be able to display a filesize using printf(). The type
- * and format string here must be compatible with one another and
- * large enough for any file.
- */
-#if HAVE_UINTMAX_T
-#define BSDTAR_FILESIZE_TYPE uintmax_t
-#define BSDTAR_FILESIZE_PRINTF "%ju"
-#else
-#if HAVE_UNSIGNED_LONG_LONG
-#define BSDTAR_FILESIZE_TYPE unsigned long long
-#define BSDTAR_FILESIZE_PRINTF "%llu"
-#else
-#define BSDTAR_FILESIZE_TYPE unsigned long
-#define BSDTAR_FILESIZE_PRINTF "%lu"
-#endif
-#endif
-
#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctimespec.tv_nsec
#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec
-#else
-#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctim.tv_nsec
#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtim.tv_nsec
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctime_n
+#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtime_n
+#elif HAVE_STRUCT_STAT_ST_UMTIME
+#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_uctime * 1000
+#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_umtime * 1000
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctime_usec * 1000
+#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtime_usec * 1000
#else
#define ARCHIVE_STAT_CTIME_NANOS(st) (0)
#define ARCHIVE_STAT_MTIME_NANOS(st) (0)
#endif
+
+/* How to mark functions that don't return. */
+/* This facilitates use of some newer static code analysis tools. */
+#undef __LA_DEAD
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_DEAD __attribute__((__noreturn__))
+#else
+#define __LA_DEAD
+#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "bsdtar_windows.h"
#endif
#endif /* !BSDTAR_PLATFORM_H_INCLUDED */
diff --git a/archivers/libarchive/files/tar/bsdtar_windows.c b/archivers/libarchive/files/tar/bsdtar_windows.c
new file mode 100644
index 00000000000..4d1205028f3
--- /dev/null
+++ b/archivers/libarchive/files/tar/bsdtar_windows.c
@@ -0,0 +1,298 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#include "bsdtar_platform.h"
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <io.h>
+#include <stddef.h>
+#ifdef HAVE_SYS_UTIME_H
+#include <sys/utime.h>
+#endif
+#include <sys/stat.h>
+#include <process.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <windows.h>
+#include <sddl.h>
+
+#include "bsdtar.h"
+#include "err.h"
+
+/* This may actually not be needed anymore.
+ * TODO: Review the error handling for chdir() failures and
+ * simply dump this if it's not really needed. */
+static void __tar_dosmaperr(unsigned long);
+
+/*
+ * Prepend "\\?\" to the path name and convert it to unicode to permit
+ * an extended-length path for a maximum total path length of 32767
+ * characters.
+ * see also http://msdn.microsoft.com/en-us/library/aa365247.aspx
+ */
+static wchar_t *
+permissive_name(const char *name)
+{
+ wchar_t *wn, *wnp;
+ wchar_t *ws, *wsp;
+ DWORD l, len, slen, alloclen;
+ int unc;
+
+ len = (DWORD)strlen(name);
+ wn = malloc((len + 1) * sizeof(wchar_t));
+ if (wn == NULL)
+ return (NULL);
+ l = MultiByteToWideChar(CP_ACP, 0, name, len, wn, len);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wn[l] = L'\0';
+
+ /* Get a full path names */
+ l = GetFullPathNameW(wn, 0, NULL, NULL);
+ if (l == 0) {
+ free(wn);
+ return (NULL);
+ }
+ wnp = malloc(l * sizeof(wchar_t));
+ if (wnp == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ len = GetFullPathNameW(wn, l, wnp, NULL);
+ free(wn);
+ wn = wnp;
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'?' && wnp[3] == L'\\')
+ /* We have already permissive names. */
+ return (wn);
+
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' &&
+ wnp[2] == L'.' && wnp[3] == L'\\') {
+ /* Device names */
+ if (((wnp[4] >= L'a' && wnp[4] <= L'z') ||
+ (wnp[4] >= L'A' && wnp[4] <= L'Z')) &&
+ wnp[5] == L':' && wnp[6] == L'\\')
+ wnp[2] = L'?';/* Not device names. */
+ return (wn);
+ }
+
+ unc = 0;
+ if (wnp[0] == L'\\' && wnp[1] == L'\\' && wnp[2] != L'\\') {
+ wchar_t *p = &wnp[2];
+
+ /* Skip server-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\') {
+ wchar_t *rp = ++p;
+ /* Skip share-name letters. */
+ while (*p != L'\\' && *p != L'\0')
+ ++p;
+ if (*p == L'\\' && p != rp) {
+ /* Now, match patterns such as
+ * "\\server-name\share-name\" */
+ wnp += 2;
+ len -= 2;
+ unc = 1;
+ }
+ }
+ }
+
+ alloclen = slen = 4 + (unc * 4) + len + 1;
+ ws = wsp = malloc(slen * sizeof(wchar_t));
+ if (ws == NULL) {
+ free(wn);
+ return (NULL);
+ }
+ /* prepend "\\?\" */
+ wcsncpy(wsp, L"\\\\?\\", 4);
+ wsp += 4;
+ slen -= 4;
+ if (unc) {
+ /* append "UNC\" ---> "\\?\UNC\" */
+ wcsncpy(wsp, L"UNC\\", 4);
+ wsp += 4;
+ slen -= 4;
+ }
+ wcsncpy(wsp, wnp, slen);
+ free(wn);
+ ws[alloclen - 1] = L'\0';
+ return (ws);
+}
+
+int
+__tar_chdir(const char *path)
+{
+ wchar_t *ws;
+ int r;
+
+ r = SetCurrentDirectoryA(path);
+ if (r == 0) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ __tar_dosmaperr(GetLastError());
+ return (-1);
+ }
+ } else
+ return (0);
+ ws = permissive_name(path);
+ if (ws == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ r = SetCurrentDirectoryW(ws);
+ free(ws);
+ if (r == 0) {
+ __tar_dosmaperr(GetLastError());
+ return (-1);
+ }
+ return (0);
+}
+
+/*
+ * The following function was modified from PostgreSQL sources and is
+ * subject to the copyright below.
+ */
+/*-------------------------------------------------------------------------
+ *
+ * win32error.c
+ * Map win32 error codes to errno values
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * $PostgreSQL: pgsql/src/port/win32error.c,v 1.4 2008/01/01 19:46:00 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+/*
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+*/
+
+static const struct {
+ DWORD winerr;
+ int doserr;
+} doserrors[] =
+{
+ { ERROR_INVALID_FUNCTION, EINVAL },
+ { ERROR_FILE_NOT_FOUND, ENOENT },
+ { ERROR_PATH_NOT_FOUND, ENOENT },
+ { ERROR_TOO_MANY_OPEN_FILES, EMFILE },
+ { ERROR_ACCESS_DENIED, EACCES },
+ { ERROR_INVALID_HANDLE, EBADF },
+ { ERROR_ARENA_TRASHED, ENOMEM },
+ { ERROR_NOT_ENOUGH_MEMORY, ENOMEM },
+ { ERROR_INVALID_BLOCK, ENOMEM },
+ { ERROR_BAD_ENVIRONMENT, E2BIG },
+ { ERROR_BAD_FORMAT, ENOEXEC },
+ { ERROR_INVALID_ACCESS, EINVAL },
+ { ERROR_INVALID_DATA, EINVAL },
+ { ERROR_INVALID_DRIVE, ENOENT },
+ { ERROR_CURRENT_DIRECTORY, EACCES },
+ { ERROR_NOT_SAME_DEVICE, EXDEV },
+ { ERROR_NO_MORE_FILES, ENOENT },
+ { ERROR_LOCK_VIOLATION, EACCES },
+ { ERROR_SHARING_VIOLATION, EACCES },
+ { ERROR_BAD_NETPATH, ENOENT },
+ { ERROR_NETWORK_ACCESS_DENIED, EACCES },
+ { ERROR_BAD_NET_NAME, ENOENT },
+ { ERROR_FILE_EXISTS, EEXIST },
+ { ERROR_CANNOT_MAKE, EACCES },
+ { ERROR_FAIL_I24, EACCES },
+ { ERROR_INVALID_PARAMETER, EINVAL },
+ { ERROR_NO_PROC_SLOTS, EAGAIN },
+ { ERROR_DRIVE_LOCKED, EACCES },
+ { ERROR_BROKEN_PIPE, EPIPE },
+ { ERROR_DISK_FULL, ENOSPC },
+ { ERROR_INVALID_TARGET_HANDLE, EBADF },
+ { ERROR_INVALID_HANDLE, EINVAL },
+ { ERROR_WAIT_NO_CHILDREN, ECHILD },
+ { ERROR_CHILD_NOT_COMPLETE, ECHILD },
+ { ERROR_DIRECT_ACCESS_HANDLE, EBADF },
+ { ERROR_NEGATIVE_SEEK, EINVAL },
+ { ERROR_SEEK_ON_DEVICE, EACCES },
+ { ERROR_DIR_NOT_EMPTY, ENOTEMPTY },
+ { ERROR_NOT_LOCKED, EACCES },
+ { ERROR_BAD_PATHNAME, ENOENT },
+ { ERROR_MAX_THRDS_REACHED, EAGAIN },
+ { ERROR_LOCK_FAILED, EACCES },
+ { ERROR_ALREADY_EXISTS, EEXIST },
+ { ERROR_FILENAME_EXCED_RANGE, ENOENT },
+ { ERROR_NESTING_NOT_ALLOWED, EAGAIN },
+ { ERROR_NOT_ENOUGH_QUOTA, ENOMEM }
+};
+
+static void
+__tar_dosmaperr(unsigned long e)
+{
+ int i;
+
+ if (e == 0) {
+ errno = 0;
+ return;
+ }
+
+ for (i = 0; i < sizeof(doserrors); i++) {
+ if (doserrors[i].winerr == e) {
+ errno = doserrors[i].doserr;
+ return;
+ }
+ }
+
+ /* fprintf(stderr, "unrecognized win32 error code: %lu", e); */
+ errno = EINVAL;
+ return;
+}
+
+#endif
diff --git a/archivers/libarchive/files/tar/bsdtar_windows.h b/archivers/libarchive/files/tar/bsdtar_windows.h
new file mode 100644
index 00000000000..092ea6959d8
--- /dev/null
+++ b/archivers/libarchive/files/tar/bsdtar_windows.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef BSDTAR_WINDOWS_H
+#define BSDTAR_WINDOWS_H 1
+#include <direct.h>
+#include <windows.h>
+
+#ifndef PRId64
+#define PRId64 "I64"
+#endif
+#define geteuid() 0
+
+#ifndef S_IFIFO
+#define S_IFIFO 0010000 /* pipe */
+#endif
+
+#include <string.h> /* Must include before redefining 'strdup' */
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#endif
+#if !defined(__BORLANDC__)
+#define getcwd _getcwd
+#endif
+
+#define chdir __tar_chdir
+int __tar_chdir(const char *);
+
+#ifndef S_ISREG
+#define S_ISREG(a) (a & _S_IFREG)
+#endif
+#ifndef S_ISBLK
+#define S_ISBLK(a) (0)
+#endif
+
+#endif /* BSDTAR_WINDOWS_H */
diff --git a/archivers/libarchive/files/tar/cmdline.c b/archivers/libarchive/files/tar/cmdline.c
new file mode 100644
index 00000000000..ba3e8a1b2a8
--- /dev/null
+++ b/archivers/libarchive/files/tar/cmdline.c
@@ -0,0 +1,381 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Command line parser for tar.
+ */
+
+#include "bsdtar_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "bsdtar.h"
+#include "err.h"
+
+/*
+ * Short options for tar. Please keep this sorted.
+ */
+static const char *short_options
+ = "Bb:C:cf:HhI:JjkLlmnOoPpqrSs:T:tUuvW:wX:xyZz";
+
+/*
+ * Long options for tar. Please keep this list sorted.
+ *
+ * The symbolic names for options that lack a short equivalent are
+ * defined in bsdtar.h. Also note that so far I've found no need
+ * to support optional arguments to long options. That would be
+ * a small change to the code below.
+ */
+
+static struct option {
+ const char *name;
+ int required; /* 1 if this option requires an argument. */
+ int equivalent; /* Equivalent short option. */
+} tar_longopts[] = {
+ { "absolute-paths", 0, 'P' },
+ { "append", 0, 'r' },
+ { "block-size", 1, 'b' },
+ { "bunzip2", 0, 'j' },
+ { "bzip", 0, 'j' },
+ { "bzip2", 0, 'j' },
+ { "cd", 1, 'C' },
+ { "check-links", 0, OPTION_CHECK_LINKS },
+ { "chroot", 0, OPTION_CHROOT },
+ { "compress", 0, 'Z' },
+ { "confirmation", 0, 'w' },
+ { "create", 0, 'c' },
+ { "dereference", 0, 'L' },
+ { "directory", 1, 'C' },
+ { "exclude", 1, OPTION_EXCLUDE },
+ { "exclude-from", 1, 'X' },
+ { "extract", 0, 'x' },
+ { "fast-read", 0, 'q' },
+ { "file", 1, 'f' },
+ { "files-from", 1, 'T' },
+ { "format", 1, OPTION_FORMAT },
+ { "options", 1, OPTION_OPTIONS },
+ { "gunzip", 0, 'z' },
+ { "gzip", 0, 'z' },
+ { "help", 0, OPTION_HELP },
+ { "include", 1, OPTION_INCLUDE },
+ { "interactive", 0, 'w' },
+ { "insecure", 0, 'P' },
+ { "keep-newer-files", 0, OPTION_KEEP_NEWER_FILES },
+ { "keep-old-files", 0, 'k' },
+ { "list", 0, 't' },
+ { "lzma", 0, OPTION_LZMA },
+ { "modification-time", 0, 'm' },
+ { "newer", 1, OPTION_NEWER_CTIME },
+ { "newer-ctime", 1, OPTION_NEWER_CTIME },
+ { "newer-ctime-than", 1, OPTION_NEWER_CTIME_THAN },
+ { "newer-mtime", 1, OPTION_NEWER_MTIME },
+ { "newer-mtime-than", 1, OPTION_NEWER_MTIME_THAN },
+ { "newer-than", 1, OPTION_NEWER_CTIME_THAN },
+ { "nodump", 0, OPTION_NODUMP },
+ { "norecurse", 0, 'n' },
+ { "no-recursion", 0, 'n' },
+ { "no-same-owner", 0, OPTION_NO_SAME_OWNER },
+ { "no-same-permissions", 0, OPTION_NO_SAME_PERMISSIONS },
+ { "null", 0, OPTION_NULL },
+ { "numeric-owner", 0, OPTION_NUMERIC_OWNER },
+ { "one-file-system", 0, OPTION_ONE_FILE_SYSTEM },
+ { "posix", 0, OPTION_POSIX },
+ { "preserve-permissions", 0, 'p' },
+ { "read-full-blocks", 0, 'B' },
+ { "same-owner", 0, OPTION_SAME_OWNER },
+ { "same-permissions", 0, 'p' },
+ { "strip-components", 1, OPTION_STRIP_COMPONENTS },
+ { "to-stdout", 0, 'O' },
+ { "totals", 0, OPTION_TOTALS },
+ { "uncompress", 0, 'Z' },
+ { "unlink", 0, 'U' },
+ { "unlink-first", 0, 'U' },
+ { "update", 0, 'u' },
+ { "use-compress-program", 1, OPTION_USE_COMPRESS_PROGRAM },
+ { "verbose", 0, 'v' },
+ { "version", 0, OPTION_VERSION },
+ { "xz", 0, 'J' },
+ { NULL, 0, 0 }
+};
+
+/*
+ * This getopt implementation has two key features that common
+ * getopt_long() implementations lack. Apart from those, it's a
+ * straightforward option parser, considerably simplified by not
+ * needing to support the wealth of exotic getopt_long() features. It
+ * has, of course, been shamelessly tailored for bsdtar. (If you're
+ * looking for a generic getopt_long() implementation for your
+ * project, I recommend Gregory Pietsch's public domain getopt_long()
+ * implementation.) The two additional features are:
+ *
+ * Old-style tar arguments: The original tar implementation treated
+ * the first argument word as a list of single-character option
+ * letters. All arguments follow as separate words. For example,
+ * tar xbf 32 /dev/tape
+ * Here, the "xbf" is three option letters, "32" is the argument for
+ * "b" and "/dev/tape" is the argument for "f". We support this usage
+ * if the first command-line argument does not begin with '-'. We
+ * also allow regular short and long options to follow, e.g.,
+ * tar xbf 32 /dev/tape -P --format=pax
+ *
+ * -W long options: There's an obscure GNU convention (only rarely
+ * supported even there) that allows "-W option=argument" as an
+ * alternative way to support long options. This was supported in
+ * early bsdtar as a way to access long options on platforms that did
+ * not support getopt_long() and is preserved here for backwards
+ * compatibility. (Of course, if I'd started with a custom
+ * command-line parser from the beginning, I would have had normal
+ * long option support on every platform so that hack wouldn't have
+ * been necessary. Oh, well. Some mistakes you just have to live
+ * with.)
+ *
+ * TODO: We should be able to use this to pull files and intermingled
+ * options (such as -C) from the command line in write mode. That
+ * will require a little rethinking of the argument handling in
+ * bsdtar.c.
+ *
+ * TODO: If we want to support arbitrary command-line options from -T
+ * input (as GNU tar does), we may need to extend this to handle option
+ * words from sources other than argv/arc. I'm not really sure if I
+ * like that feature of GNU tar, so it's certainly not a priority.
+ */
+
+int
+bsdtar_getopt(struct bsdtar *bsdtar)
+{
+ enum { state_start = 0, state_old_tar, state_next_word,
+ state_short, state_long };
+ static int state = state_start;
+ static char *opt_word;
+
+ const struct option *popt, *match = NULL, *match2 = NULL;
+ const char *p, *long_prefix = "--";
+ size_t optlength;
+ int opt = '?';
+ int required = 0;
+
+ bsdtar->optarg = NULL;
+
+ /* First time through, initialize everything. */
+ if (state == state_start) {
+ /* Skip program name. */
+ ++bsdtar->argv;
+ --bsdtar->argc;
+ if (*bsdtar->argv == NULL)
+ return (-1);
+ /* Decide between "new style" and "old style" arguments. */
+ if (bsdtar->argv[0][0] == '-') {
+ state = state_next_word;
+ } else {
+ state = state_old_tar;
+ opt_word = *bsdtar->argv++;
+ --bsdtar->argc;
+ }
+ }
+
+ /*
+ * We're parsing old-style tar arguments
+ */
+ if (state == state_old_tar) {
+ /* Get the next option character. */
+ opt = *opt_word++;
+ if (opt == '\0') {
+ /* New-style args can follow old-style. */
+ state = state_next_word;
+ } else {
+ /* See if it takes an argument. */
+ p = strchr(short_options, opt);
+ if (p == NULL)
+ return ('?');
+ if (p[1] == ':') {
+ bsdtar->optarg = *bsdtar->argv;
+ if (bsdtar->optarg == NULL) {
+ lafe_warnc(0,
+ "Option %c requires an argument",
+ opt);
+ return ('?');
+ }
+ ++bsdtar->argv;
+ --bsdtar->argc;
+ }
+ }
+ }
+
+ /*
+ * We're ready to look at the next word in argv.
+ */
+ if (state == state_next_word) {
+ /* No more arguments, so no more options. */
+ if (bsdtar->argv[0] == NULL)
+ return (-1);
+ /* Doesn't start with '-', so no more options. */
+ if (bsdtar->argv[0][0] != '-')
+ return (-1);
+ /* "--" marks end of options; consume it and return. */
+ if (strcmp(bsdtar->argv[0], "--") == 0) {
+ ++bsdtar->argv;
+ --bsdtar->argc;
+ return (-1);
+ }
+ /* Get next word for parsing. */
+ opt_word = *bsdtar->argv++;
+ --bsdtar->argc;
+ if (opt_word[1] == '-') {
+ /* Set up long option parser. */
+ state = state_long;
+ opt_word += 2; /* Skip leading '--' */
+ } else {
+ /* Set up short option parser. */
+ state = state_short;
+ ++opt_word; /* Skip leading '-' */
+ }
+ }
+
+ /*
+ * We're parsing a group of POSIX-style single-character options.
+ */
+ if (state == state_short) {
+ /* Peel next option off of a group of short options. */
+ opt = *opt_word++;
+ if (opt == '\0') {
+ /* End of this group; recurse to get next option. */
+ state = state_next_word;
+ return bsdtar_getopt(bsdtar);
+ }
+
+ /* Does this option take an argument? */
+ p = strchr(short_options, opt);
+ if (p == NULL)
+ return ('?');
+ if (p[1] == ':')
+ required = 1;
+
+ /* If it takes an argument, parse that. */
+ if (required) {
+ /* If arg is run-in, opt_word already points to it. */
+ if (opt_word[0] == '\0') {
+ /* Otherwise, pick up the next word. */
+ opt_word = *bsdtar->argv;
+ if (opt_word == NULL) {
+ lafe_warnc(0,
+ "Option -%c requires an argument",
+ opt);
+ return ('?');
+ }
+ ++bsdtar->argv;
+ --bsdtar->argc;
+ }
+ if (opt == 'W') {
+ state = state_long;
+ long_prefix = "-W "; /* For clearer errors. */
+ } else {
+ state = state_next_word;
+ bsdtar->optarg = opt_word;
+ }
+ }
+ }
+
+ /* We're reading a long option, including -W long=arg convention. */
+ if (state == state_long) {
+ /* After this long option, we'll be starting a new word. */
+ state = state_next_word;
+
+ /* Option name ends at '=' if there is one. */
+ p = strchr(opt_word, '=');
+ if (p != NULL) {
+ optlength = (size_t)(p - opt_word);
+ bsdtar->optarg = (char *)(uintptr_t)(p + 1);
+ } else {
+ optlength = strlen(opt_word);
+ }
+
+ /* Search the table for an unambiguous match. */
+ for (popt = tar_longopts; popt->name != NULL; popt++) {
+ /* Short-circuit if first chars don't match. */
+ if (popt->name[0] != opt_word[0])
+ continue;
+ /* If option is a prefix of name in table, record it.*/
+ if (strncmp(opt_word, popt->name, optlength) == 0) {
+ match2 = match; /* Record up to two matches. */
+ match = popt;
+ /* If it's an exact match, we're done. */
+ if (strlen(popt->name) == optlength) {
+ match2 = NULL; /* Forget the others. */
+ break;
+ }
+ }
+ }
+
+ /* Fail if there wasn't a unique match. */
+ if (match == NULL) {
+ lafe_warnc(0,
+ "Option %s%s is not supported",
+ long_prefix, opt_word);
+ return ('?');
+ }
+ if (match2 != NULL) {
+ lafe_warnc(0,
+ "Ambiguous option %s%s (matches --%s and --%s)",
+ long_prefix, opt_word, match->name, match2->name);
+ return ('?');
+ }
+
+ /* We've found a unique match; does it need an argument? */
+ if (match->required) {
+ /* Argument required: get next word if necessary. */
+ if (bsdtar->optarg == NULL) {
+ bsdtar->optarg = *bsdtar->argv;
+ if (bsdtar->optarg == NULL) {
+ lafe_warnc(0,
+ "Option %s%s requires an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
+ ++bsdtar->argv;
+ --bsdtar->argc;
+ }
+ } else {
+ /* Argument forbidden: fail if there is one. */
+ if (bsdtar->optarg != NULL) {
+ lafe_warnc(0,
+ "Option %s%s does not allow an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
+ }
+ return (match->equivalent);
+ }
+
+ return (opt);
+}
diff --git a/archivers/libarchive/files/tar/config_freebsd.h b/archivers/libarchive/files/tar/config_freebsd.h
new file mode 100644
index 00000000000..37aa9dcae17
--- /dev/null
+++ b/archivers/libarchive/files/tar/config_freebsd.h
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/usr.bin/tar/config_freebsd.h,v 1.8 2008/11/29 20:06:53 kientzle Exp $
+ */
+
+/* A default configuration for FreeBSD, used if there is no config.h. */
+
+#include <sys/param.h> /* __FreeBSD_version */
+
+#undef HAVE_ATTR_XATTR_H
+#define HAVE_CHROOT 1
+#define HAVE_DIRENT_D_NAMLEN 1
+#define HAVE_DIRENT_H 1
+#define HAVE_D_MD_ORDER 1
+#define HAVE_ERRNO_H 1
+#undef HAVE_EXT2FS_EXT2_FS_H
+#define HAVE_FCHDIR 1
+#define HAVE_FCNTL_H 1
+#define HAVE_GRP_H 1
+#define HAVE_LANGINFO_H 1
+#undef HAVE_LIBACL
+#define HAVE_LIBARCHIVE 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LINK 1
+#undef HAVE_LINUX_EXT2_FS_H
+#undef HAVE_LINUX_FS_H
+#define HAVE_LOCALE_H 1
+#define HAVE_MBTOWC 1
+#undef HAVE_NDIR_H
+#if __FreeBSD_version >= 450002 /* nl_langinfo introduced */
+#define HAVE_NL_LANGINFO 1
+#endif
+#define HAVE_PATHS_H 1
+#define HAVE_PWD_H 1
+#define HAVE_READLINK 1
+#define HAVE_REGEX_H 1
+#define HAVE_SETLOCALE 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+#undef HAVE_STRUCT_STAT_ST_MTIME_N
+#undef HAVE_STRUCT_STAT_ST_MTIME_USEC
+#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
+#undef HAVE_STRUCT_STAT_ST_UMTIME
+#define HAVE_SYMLINK 1
+#define HAVE_SYS_CDEFS_H 1
+#undef HAVE_SYS_DIR_H
+#define HAVE_SYS_IOCTL_H 1
+#undef HAVE_SYS_NDIR_H
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_UINTMAX_T 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UNSIGNED_LONG_LONG
+#define HAVE_WCTYPE_H 1
+#define HAVE_ZLIB_H 1
+#undef MAJOR_IN_MKDEV
diff --git a/archivers/libarchive/files/tar/getdate.c b/archivers/libarchive/files/tar/getdate.c
index 895320bd670..ffaa679ba1a 100644
--- a/archivers/libarchive/files/tar/getdate.c
+++ b/archivers/libarchive/files/tar/getdate.c
@@ -1,101 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.1. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "2.1"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 0
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- tAGO = 258,
- tDAY = 259,
- tDAYZONE = 260,
- tAMPM = 261,
- tMONTH = 262,
- tMONTH_UNIT = 263,
- tSEC_UNIT = 264,
- tUNUMBER = 265,
- tZONE = 266,
- tDST = 267
- };
-#endif
-/* Tokens. */
-#define tAGO 258
-#define tDAY 259
-#define tDAYZONE 260
-#define tAMPM 261
-#define tMONTH 262
-#define tMONTH_UNIT 263
-#define tSEC_UNIT 264
-#define tUNUMBER 265
-#define tZONE 266
-#define tDST 267
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 1 "getdate.y"
+/*
+ * This code is in the public domain and has no copyright.
+ *
+ * This is a plain C recursive-descent translation of an old
+ * public-domain YACC grammar that has been used for parsing dates in
+ * very many open-source projects.
+ *
+ * Since the original authors were generous enough to donate their
+ * work to the public domain, I feel compelled to match their
+ * generosity.
+ *
+ * Tim Kientzle, February 2009.
+ */
/*
- * March 2005: Further modified and simplified by Tim Kientzle:
- * Eliminate minutes-based calculations (just do everything in
- * seconds), have lexer only recognize unsigned integers (handle '+'
- * and '-' characters in grammar), combine tables into one table with
- * explicit abbreviation notes, do am/pm adjustments in the grammar
- * (eliminate some state variables and post-processing). Among other
- * things, these changes eliminated two shift/reduce conflicts. (Went
- * from 10 to 8.)
- * All of Tim Kientzle's changes to this file are public domain.
+ * Header comment from original getdate.y:
*/
/*
@@ -108,12 +26,10 @@
**
** This code is in the public domain and has no copyright.
*/
-/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
-/* SUPPRESS 288 on yyerrlab *//* Label unused */
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle Exp $");
+__FBSDID("$FreeBSD$");
#endif
#include <ctype.h>
@@ -122,1742 +38,484 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle
#include <string.h>
#include <time.h>
-#define yyparse getdate_yyparse
-#define yylex getdate_yylex
-#define yyerror getdate_yyerror
-
-static int yyparse(void);
-static int yylex(void);
-static int yyerror(const char *);
-
-time_t get_date(char *);
+/* This file defines a single public function. */
+time_t get_date(time_t now, char *);
-#define EPOCH 1970
-#define HOUR(x) ((time_t)(x) * 60)
-#define SECSPERDAY (24L * 60L * 60L)
+/* Basic time units. */
+#define EPOCH 1970
+#define MINUTE (60L)
+#define HOUR (60L * MINUTE)
+#define DAY (24L * HOUR)
-/*
-** Daylight-savings mode: on, off, or not yet known.
-*/
-typedef enum _DSTMODE {
- DSTon, DSToff, DSTmaybe
-} DSTMODE;
-
-/*
-** Meridian: am or pm.
-*/
+/* Daylight-savings mode: on, off, or not yet known. */
+enum DSTMODE { DSTon, DSToff, DSTmaybe };
+/* Meridian: am or pm. */
enum { tAM, tPM };
+/* Token types returned by nexttoken() */
+enum { tAGO = 260, tDAY, tDAYZONE, tAMPM, tMONTH, tMONTH_UNIT, tSEC_UNIT,
+ tUNUMBER, tZONE, tDST };
+struct token { int token; time_t value; };
/*
-** Global variables. We could get rid of most of these by using a good
-** union as the yacc stack. (This routine was originally written before
-** yacc had the %union construct.) Maybe someday; right now we only use
-** the %union very rarely.
-*/
-static char *yyInput;
-
-static DSTMODE yyDSTmode;
-static time_t yyDayOrdinal;
-static time_t yyDayNumber;
-static int yyHaveDate;
-static int yyHaveDay;
-static int yyHaveRel;
-static int yyHaveTime;
-static int yyHaveZone;
-static time_t yyTimezone;
-static time_t yyDay;
-static time_t yyHour;
-static time_t yyMinutes;
-static time_t yyMonth;
-static time_t yySeconds;
-static time_t yyYear;
-static time_t yyRelMonth;
-static time_t yyRelSeconds;
-
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 92 "getdate.y"
-typedef union YYSTYPE {
- time_t Number;
-} YYSTYPE;
-/* Line 196 of yacc.c. */
-#line 204 "tar/getdate.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 219 of yacc.c. */
-#line 216 "tar/getdate.c"
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#ifndef YY_
-# if YYENABLE_NLS
-# if ENABLE_NLS
-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(msgid) msgid
-# endif
-#endif
-
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYINCLUDED_STDLIB_H
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
-# endif
-# ifdef __cplusplus
-extern "C" {
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifdef __cplusplus
-}
-# endif
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short int yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 2
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 50
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 18
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 11
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 41
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 59
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 267
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 13, 16, 14, 2, 17, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 15, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned char yyprhs[] =
-{
- 0, 0, 3, 4, 7, 9, 11, 13, 15, 17,
- 19, 22, 24, 27, 31, 35, 39, 45, 47, 49,
- 52, 54, 57, 60, 64, 70, 76, 82, 85, 90,
- 93, 97, 100, 102, 106, 110, 113, 115, 119, 123,
- 126, 128
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
- 19, 0, -1, -1, 19, 20, -1, 21, -1, 23,
- -1, 25, -1, 24, -1, 26, -1, 28, -1, 10,
- 6, -1, 22, -1, 22, 6, -1, 22, 13, 10,
- -1, 22, 14, 10, -1, 10, 15, 10, -1, 10,
- 15, 10, 15, 10, -1, 11, -1, 5, -1, 11,
- 12, -1, 4, -1, 4, 16, -1, 10, 4, -1,
- 10, 17, 10, -1, 10, 17, 10, 17, 10, -1,
- 10, 14, 10, 14, 10, -1, 10, 14, 7, 14,
- 10, -1, 7, 10, -1, 7, 10, 16, 10, -1,
- 10, 7, -1, 10, 7, 10, -1, 27, 3, -1,
- 27, -1, 14, 10, 9, -1, 13, 10, 9, -1,
- 10, 9, -1, 9, -1, 14, 10, 8, -1, 13,
- 10, 8, -1, 10, 8, -1, 8, -1, 10, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short int yyrline[] =
-{
- 0, 104, 104, 105, 108, 109, 110, 111, 112, 113,
- 116, 126, 129, 136, 141, 148, 153, 160, 164, 168,
- 174, 178, 183, 190, 195, 214, 220, 233, 238, 244,
- 249, 257, 261, 264, 268, 272, 276, 280, 284, 288,
- 292, 298
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tAMPM",
- "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tUNUMBER", "tZONE", "tDST", "'+'",
- "'-'", "':'", "','", "'/'", "$accept", "spec", "item", "time",
- "bare_time", "zone", "day", "date", "rel", "relunit", "number", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 43, 45, 58, 44, 47
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 18, 19, 19, 20, 20, 20, 20, 20, 20,
- 21, 21, 21, 21, 21, 22, 22, 23, 23, 23,
- 24, 24, 24, 25, 25, 25, 25, 25, 25, 25,
- 25, 26, 26, 27, 27, 27, 27, 27, 27, 27,
- 27, 28
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
- 2, 1, 2, 3, 3, 3, 5, 1, 1, 2,
- 1, 2, 2, 3, 5, 5, 5, 2, 4, 2,
- 3, 2, 1, 3, 3, 2, 1, 3, 3, 2,
- 1, 1
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const unsigned char yydefact[] =
-{
- 2, 0, 1, 20, 18, 0, 40, 36, 41, 17,
- 0, 0, 3, 4, 11, 5, 7, 6, 8, 32,
- 9, 21, 27, 22, 10, 29, 39, 35, 0, 0,
- 0, 19, 0, 0, 12, 0, 0, 31, 0, 30,
- 0, 0, 15, 23, 38, 34, 37, 33, 13, 14,
- 28, 0, 0, 0, 0, 26, 25, 16, 24
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
-{
- -1, 1, 12, 13, 14, 15, 16, 17, 18, 19,
- 20
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -8
-static const yysigned_char yypact[] =
-{
- -8, 0, -8, 14, -8, 2, -8, -8, 11, 15,
- 19, 21, -8, -8, 10, -8, -8, -8, -8, 29,
- -8, -8, 17, -8, -8, 24, -8, -8, -4, 25,
- 26, -8, -7, 13, -8, 27, 28, -8, 30, -8,
- 31, 32, 33, 22, -8, -8, -8, -8, -8, -8,
- -8, 34, 37, 39, 40, -8, -8, -8, -8
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
-{
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
-{
- 2, 44, 45, 40, 3, 4, 41, 5, 6, 7,
- 8, 9, 22, 10, 11, 23, 34, 24, 25, 26,
- 27, 46, 47, 35, 36, 28, 29, 31, 30, 32,
- 21, 33, 37, 38, 39, 42, 43, 48, 49, 54,
- 50, 0, 0, 0, 55, 51, 52, 56, 53, 57,
- 58
-};
-
-static const yysigned_char yycheck[] =
-{
- 0, 8, 9, 7, 4, 5, 10, 7, 8, 9,
- 10, 11, 10, 13, 14, 4, 6, 6, 7, 8,
- 9, 8, 9, 13, 14, 14, 15, 12, 17, 10,
- 16, 10, 3, 16, 10, 10, 10, 10, 10, 17,
- 10, -1, -1, -1, 10, 14, 14, 10, 15, 10,
- 10
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 19, 0, 4, 5, 7, 8, 9, 10, 11,
- 13, 14, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 16, 10, 4, 6, 7, 8, 9, 14, 15,
- 17, 12, 10, 10, 6, 13, 14, 3, 16, 10,
- 7, 10, 10, 10, 8, 9, 8, 9, 10, 10,
- 10, 14, 14, 15, 17, 10, 10, 10, 10
+ * Parser state.
+ */
+struct gdstate {
+ struct token *tokenp; /* Pointer to next token. */
+ /* HaveXxxx counts how many of this kind of phrase we've seen;
+ * it's a fatal error to have more than one time, zone, day,
+ * or date phrase. */
+ int HaveYear;
+ int HaveMonth;
+ int HaveDay;
+ int HaveWeekDay; /* Day of week */
+ int HaveTime; /* Hour/minute/second */
+ int HaveZone; /* timezone and/or DST info */
+ int HaveRel; /* time offset; we can have more than one */
+ /* Absolute time values. */
+ time_t Timezone; /* Seconds offset from GMT */
+ time_t Day;
+ time_t Hour;
+ time_t Minutes;
+ time_t Month;
+ time_t Seconds;
+ time_t Year;
+ /* DST selection */
+ enum DSTMODE DSTmode;
+ /* Day of week accounting, e.g., "3rd Tuesday" */
+ time_t DayOrdinal; /* "3" in "3rd Tuesday" */
+ time_t DayNumber; /* "Tuesday" in "3rd Tuesday" */
+ /* Relative time values: hour/day/week offsets are measured in
+ * seconds, month/year are counted in months. */
+ time_t RelMonth;
+ time_t RelSeconds;
};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-
-#define YYFAIL goto yyerrlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (N) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (0)
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short int *bottom, short int *top)
-#else
-static void
-yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
-#endif
-{
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- size_t yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-#endif /* YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol. */
-int yychar;
-
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
+/*
+ * A series of functions that recognize certain common time phrases.
+ * Each function returns 1 if it managed to make sense of some of the
+ * tokens, zero otherwise.
+ */
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
-#else
-int
-yyparse ()
- ;
-#endif
-#endif
+/*
+ * hour:minute or hour:minute:second with optional AM, PM, or numeric
+ * timezone offset
+ */
+static int
+timephrase(struct gdstate *gds)
{
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- short int *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK (yyvsp--, yyssp--)
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short int *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- short int *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a look-ahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to look-ahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
- goto yydefault;
-
- /* Not known => get a look-ahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 4:
-#line 108 "getdate.y"
- { yyHaveTime++; }
- break;
-
- case 5:
-#line 109 "getdate.y"
- { yyHaveZone++; }
- break;
-
- case 6:
-#line 110 "getdate.y"
- { yyHaveDate++; }
- break;
-
- case 7:
-#line 111 "getdate.y"
- { yyHaveDay++; }
- break;
-
- case 8:
-#line 112 "getdate.y"
- { yyHaveRel++; }
- break;
-
- case 10:
-#line 116 "getdate.y"
- {
- /* "7am" */
- yyHour = (yyvsp[-1].Number);
- if (yyHour == 12)
- yyHour = 0;
- yyMinutes = 0;
- yySeconds = 0;
- if ((yyvsp[0].Number) == tPM)
- yyHour += 12;
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == ':'
+ && gds->tokenp[2].token == tUNUMBER
+ && gds->tokenp[3].token == ':'
+ && gds->tokenp[4].token == tUNUMBER) {
+ /* "12:14:18" or "22:08:07" */
+ ++gds->HaveTime;
+ gds->Hour = gds->tokenp[0].value;
+ gds->Minutes = gds->tokenp[2].value;
+ gds->Seconds = gds->tokenp[4].value;
+ gds->tokenp += 5;
}
- break;
-
- case 11:
-#line 126 "getdate.y"
- {
- /* "7:12:18" "19:17" */
+ else if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == ':'
+ && gds->tokenp[2].token == tUNUMBER) {
+ /* "12:14" or "22:08" */
+ ++gds->HaveTime;
+ gds->Hour = gds->tokenp[0].value;
+ gds->Minutes = gds->tokenp[2].value;
+ gds->Seconds = 0;
+ gds->tokenp += 3;
+ }
+ else if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tAMPM) {
+ /* "7" is a time if it's followed by "am" or "pm" */
+ ++gds->HaveTime;
+ gds->Hour = gds->tokenp[0].value;
+ gds->Minutes = gds->Seconds = 0;
+ /* We'll handle the AM/PM below. */
+ gds->tokenp += 1;
+ } else {
+ /* We can't handle this. */
+ return 0;
}
- break;
- case 12:
-#line 129 "getdate.y"
- {
+ if (gds->tokenp[0].token == tAMPM) {
/* "7:12pm", "12:20:13am" */
- if (yyHour == 12)
- yyHour = 0;
- if ((yyvsp[0].Number) == tPM)
- yyHour += 12;
+ if (gds->Hour == 12)
+ gds->Hour = 0;
+ if (gds->tokenp[0].value == tPM)
+ gds->Hour += 12;
+ gds->tokenp += 1;
}
- break;
-
- case 13:
-#line 136 "getdate.y"
- {
+ if (gds->tokenp[0].token == '+'
+ && gds->tokenp[1].token == tUNUMBER) {
/* "7:14+0700" */
- yyDSTmode = DSToff;
- yyTimezone = - ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
+ gds->HaveZone++;
+ gds->DSTmode = DSToff;
+ gds->Timezone = - ((gds->tokenp[1].value / 100) * HOUR
+ + (gds->tokenp[1].value % 100) * MINUTE);
+ gds->tokenp += 2;
}
- break;
-
- case 14:
-#line 141 "getdate.y"
- {
+ if (gds->tokenp[0].token == '-'
+ && gds->tokenp[1].token == tUNUMBER) {
/* "19:14:12-0530" */
- yyDSTmode = DSToff;
- yyTimezone = + ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
- }
- break;
-
- case 15:
-#line 148 "getdate.y"
- {
- yyHour = (yyvsp[-2].Number);
- yyMinutes = (yyvsp[0].Number);
- yySeconds = 0;
- }
- break;
-
- case 16:
-#line 153 "getdate.y"
- {
- yyHour = (yyvsp[-4].Number);
- yyMinutes = (yyvsp[-2].Number);
- yySeconds = (yyvsp[0].Number);
- }
- break;
-
- case 17:
-#line 160 "getdate.y"
- {
- yyTimezone = (yyvsp[0].Number);
- yyDSTmode = DSToff;
+ gds->HaveZone++;
+ gds->DSTmode = DSToff;
+ gds->Timezone = + ((gds->tokenp[1].value / 100) * HOUR
+ + (gds->tokenp[1].value % 100) * MINUTE);
+ gds->tokenp += 2;
}
- break;
-
- case 18:
-#line 164 "getdate.y"
- {
- yyTimezone = (yyvsp[0].Number);
- yyDSTmode = DSTon;
- }
- break;
-
- case 19:
-#line 168 "getdate.y"
- {
- yyTimezone = (yyvsp[-1].Number);
- yyDSTmode = DSTon;
- }
- break;
+ return 1;
+}
- case 20:
-#line 174 "getdate.y"
- {
- yyDayOrdinal = 1;
- yyDayNumber = (yyvsp[0].Number);
- }
- break;
-
- case 21:
-#line 178 "getdate.y"
- {
- /* "tue," "wednesday," */
- yyDayOrdinal = 1;
- yyDayNumber = (yyvsp[-1].Number);
+/*
+ * Timezone name, possibly including DST.
+ */
+static int
+zonephrase(struct gdstate *gds)
+{
+ if (gds->tokenp[0].token == tZONE
+ && gds->tokenp[1].token == tDST) {
+ gds->HaveZone++;
+ gds->Timezone = gds->tokenp[0].value;
+ gds->DSTmode = DSTon;
+ gds->tokenp += 1;
+ return 1;
}
- break;
- case 22:
-#line 183 "getdate.y"
- {
- /* "second tues" "3 wed" */
- yyDayOrdinal = (yyvsp[-1].Number);
- yyDayNumber = (yyvsp[0].Number);
+ if (gds->tokenp[0].token == tZONE) {
+ gds->HaveZone++;
+ gds->Timezone = gds->tokenp[0].value;
+ gds->DSTmode = DSToff;
+ gds->tokenp += 1;
+ return 1;
}
- break;
- case 23:
-#line 190 "getdate.y"
- {
- /* "1/15" */
- yyMonth = (yyvsp[-2].Number);
- yyDay = (yyvsp[0].Number);
+ if (gds->tokenp[0].token == tDAYZONE) {
+ gds->HaveZone++;
+ gds->Timezone = gds->tokenp[0].value;
+ gds->DSTmode = DSTon;
+ gds->tokenp += 1;
+ return 1;
}
- break;
+ return 0;
+}
- case 24:
-#line 195 "getdate.y"
- {
- if ((yyvsp[-4].Number) >= 13) {
+/*
+ * Year/month/day in various combinations.
+ */
+static int
+datephrase(struct gdstate *gds)
+{
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == '/'
+ && gds->tokenp[2].token == tUNUMBER
+ && gds->tokenp[3].token == '/'
+ && gds->tokenp[4].token == tUNUMBER) {
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ if (gds->tokenp[0].value >= 13) {
/* First number is big: 2004/01/29, 99/02/17 */
- yyYear = (yyvsp[-4].Number);
- yyMonth = (yyvsp[-2].Number);
- yyDay = (yyvsp[0].Number);
- } else if (((yyvsp[0].Number) >= 13) || ((yyvsp[-2].Number) >= 13)) {
+ gds->Year = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[2].value;
+ gds->Day = gds->tokenp[4].value;
+ } else if ((gds->tokenp[4].value >= 13)
+ || (gds->tokenp[2].value >= 13)) {
/* Last number is big: 01/07/98 */
/* Middle number is big: 01/29/04 */
- yyMonth = (yyvsp[-4].Number);
- yyDay = (yyvsp[-2].Number);
- yyYear = (yyvsp[0].Number);
+ gds->Month = gds->tokenp[0].value;
+ gds->Day = gds->tokenp[2].value;
+ gds->Year = gds->tokenp[4].value;
} else {
/* No significant clues: 02/03/04 */
- yyMonth = (yyvsp[-4].Number);
- yyDay = (yyvsp[-2].Number);
- yyYear = (yyvsp[0].Number);
+ gds->Month = gds->tokenp[0].value;
+ gds->Day = gds->tokenp[2].value;
+ gds->Year = gds->tokenp[4].value;
}
+ gds->tokenp += 5;
+ return 1;
+ }
+
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == '/'
+ && gds->tokenp[2].token == tUNUMBER) {
+ /* "1/15" */
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Month = gds->tokenp[0].value;
+ gds->Day = gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
- case 25:
-#line 214 "getdate.y"
- {
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == '-'
+ && gds->tokenp[2].token == tUNUMBER
+ && gds->tokenp[3].token == '-'
+ && gds->tokenp[4].token == tUNUMBER) {
/* ISO 8601 format. yyyy-mm-dd. */
- yyYear = (yyvsp[-4].Number);
- yyMonth = (yyvsp[-2].Number);
- yyDay = (yyvsp[0].Number);
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Year = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[2].value;
+ gds->Day = gds->tokenp[4].value;
+ gds->tokenp += 5;
+ return 1;
}
- break;
- case 26:
-#line 220 "getdate.y"
- {
- if ((yyvsp[-4].Number) > 31) {
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == '-'
+ && gds->tokenp[2].token == tMONTH
+ && gds->tokenp[3].token == '-'
+ && gds->tokenp[4].token == tUNUMBER) {
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ if (gds->tokenp[0].value > 31) {
/* e.g. 1992-Jun-17 */
- yyYear = (yyvsp[-4].Number);
- yyMonth = (yyvsp[-2].Number);
- yyDay = (yyvsp[0].Number);
+ gds->Year = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[2].value;
+ gds->Day = gds->tokenp[4].value;
} else {
/* e.g. 17-JUN-1992. */
- yyDay = (yyvsp[-4].Number);
- yyMonth = (yyvsp[-2].Number);
- yyYear = (yyvsp[0].Number);
+ gds->Day = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[2].value;
+ gds->Year = gds->tokenp[4].value;
}
+ gds->tokenp += 5;
+ return 1;
}
- break;
- case 27:
-#line 233 "getdate.y"
- {
- /* "May 3" */
- yyMonth = (yyvsp[-1].Number);
- yyDay = (yyvsp[0].Number);
- }
- break;
-
- case 28:
-#line 238 "getdate.y"
- {
+ if (gds->tokenp[0].token == tMONTH
+ && gds->tokenp[1].token == tUNUMBER
+ && gds->tokenp[2].token == ','
+ && gds->tokenp[3].token == tUNUMBER) {
/* "June 17, 2001" */
- yyMonth = (yyvsp[-3].Number);
- yyDay = (yyvsp[-2].Number);
- yyYear = (yyvsp[0].Number);
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Month = gds->tokenp[0].value;
+ gds->Day = gds->tokenp[1].value;
+ gds->Year = gds->tokenp[3].value;
+ gds->tokenp += 4;
+ return 1;
}
- break;
- case 29:
-#line 244 "getdate.y"
- {
- /* "12 Sept" */
- yyDay = (yyvsp[-1].Number);
- yyMonth = (yyvsp[0].Number);
+ if (gds->tokenp[0].token == tMONTH
+ && gds->tokenp[1].token == tUNUMBER) {
+ /* "May 3" */
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Month = gds->tokenp[0].value;
+ gds->Day = gds->tokenp[1].value;
+ gds->tokenp += 2;
+ return 1;
}
- break;
- case 30:
-#line 249 "getdate.y"
- {
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tMONTH
+ && gds->tokenp[2].token == tUNUMBER) {
/* "12 Sept 1997" */
- yyDay = (yyvsp[-2].Number);
- yyMonth = (yyvsp[-1].Number);
- yyYear = (yyvsp[0].Number);
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Day = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[1].value;
+ gds->Year = gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
- case 31:
-#line 257 "getdate.y"
- {
- yyRelSeconds = -yyRelSeconds;
- yyRelMonth = -yyRelMonth;
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tMONTH) {
+ /* "12 Sept" */
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Day = gds->tokenp[0].value;
+ gds->Month = gds->tokenp[1].value;
+ gds->tokenp += 2;
+ return 1;
}
- break;
- case 33:
-#line 264 "getdate.y"
- {
+ return 0;
+}
+
+/*
+ * Relative time phrase: "tomorrow", "yesterday", "+1 hour", etc.
+ */
+static int
+relunitphrase(struct gdstate *gds)
+{
+ if (gds->tokenp[0].token == '-'
+ && gds->tokenp[1].token == tUNUMBER
+ && gds->tokenp[2].token == tSEC_UNIT) {
/* "-3 hours" */
- yyRelSeconds -= (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelSeconds -= gds->tokenp[1].value * gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
-
- case 34:
-#line 268 "getdate.y"
- {
+ if (gds->tokenp[0].token == '+'
+ && gds->tokenp[1].token == tUNUMBER
+ && gds->tokenp[2].token == tSEC_UNIT) {
/* "+1 minute" */
- yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelSeconds += gds->tokenp[1].value * gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
-
- case 35:
-#line 272 "getdate.y"
- {
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tSEC_UNIT) {
/* "1 day" */
- yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelSeconds += gds->tokenp[1].value * gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
-
- case 36:
-#line 276 "getdate.y"
- {
- /* "hour" */
- yyRelSeconds += (yyvsp[0].Number);
- }
- break;
-
- case 37:
-#line 280 "getdate.y"
- {
+ if (gds->tokenp[0].token == '-'
+ && gds->tokenp[1].token == tUNUMBER
+ && gds->tokenp[2].token == tMONTH_UNIT) {
/* "-3 months" */
- yyRelMonth -= (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelMonth -= gds->tokenp[1].value * gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
-
- case 38:
-#line 284 "getdate.y"
- {
+ if (gds->tokenp[0].token == '+'
+ && gds->tokenp[1].token == tUNUMBER
+ && gds->tokenp[2].token == tMONTH_UNIT) {
/* "+5 years" */
- yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelMonth += gds->tokenp[1].value * gds->tokenp[2].value;
+ gds->tokenp += 3;
+ return 1;
}
- break;
-
- case 39:
-#line 288 "getdate.y"
- {
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tMONTH_UNIT) {
/* "2 years" */
- yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number);
+ gds->HaveRel++;
+ gds->RelMonth += gds->tokenp[0].value * gds->tokenp[1].value;
+ gds->tokenp += 2;
+ return 1;
}
- break;
-
- case 40:
-#line 292 "getdate.y"
- {
- /* "6 months" */
- yyRelMonth += (yyvsp[0].Number);
+ if (gds->tokenp[0].token == tSEC_UNIT) {
+ /* "now", "tomorrow" */
+ gds->HaveRel++;
+ gds->RelSeconds += gds->tokenp[0].value;
+ ++gds->tokenp;
+ return 1;
}
- break;
-
- case 41:
-#line 298 "getdate.y"
- {
- if (yyHaveTime && yyHaveDate && !yyHaveRel)
- yyYear = (yyvsp[0].Number);
- else {
- if((yyvsp[0].Number)>10000) {
- /* "20040301" */
- yyHaveDate++;
- yyDay= ((yyvsp[0].Number))%100;
- yyMonth= ((yyvsp[0].Number)/100)%100;
- yyYear = (yyvsp[0].Number)/10000;
- }
- else {
- /* "513" is same as "5:13" */
- yyHaveTime++;
- if ((yyvsp[0].Number) < 100) {
- yyHour = (yyvsp[0].Number);
- yyMinutes = 0;
- }
- else {
- yyHour = (yyvsp[0].Number) / 100;
- yyMinutes = (yyvsp[0].Number) % 100;
- }
- yySeconds = 0;
- }
- }
+ if (gds->tokenp[0].token == tMONTH_UNIT) {
+ /* "month" */
+ gds->HaveRel++;
+ gds->RelMonth += gds->tokenp[0].value;
+ gds->tokenp += 1;
+ return 1;
}
- break;
-
-
- default: break;
- }
+ return 0;
+}
-/* Line 1126 of yacc.c. */
-#line 1590 "tar/getdate.c"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- char *yymsg = 0;
-# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-#if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-#endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
-
- if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yymsg;
- int yyi = 0;
- while ((*yyp = *yyf))
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- goto yyexhaustedlab;
- }
+/*
+ * Day of the week specification.
+ */
+static int
+dayphrase(struct gdstate *gds)
+{
+ if (gds->tokenp[0].token == tDAY) {
+ /* "tues", "wednesday," */
+ gds->HaveWeekDay++;
+ gds->DayOrdinal = 1;
+ gds->DayNumber = gds->tokenp[0].value;
+ gds->tokenp += 1;
+ if (gds->tokenp[0].token == ',')
+ gds->tokenp += 1;
+ return 1;
}
- else
-#endif /* YYERROR_VERBOSE */
- yyerror (YY_("syntax error"));
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
- else
- {
- yydestruct ("Error: discarding", yytoken, &yylval);
- yychar = YYEMPTY;
+ if (gds->tokenp[0].token == tUNUMBER
+ && gds->tokenp[1].token == tDAY) {
+ /* "second tues" "3 wed" */
+ gds->HaveWeekDay++;
+ gds->DayOrdinal = gds->tokenp[0].value;
+ gds->DayNumber = gds->tokenp[1].value;
+ gds->tokenp += 2;
+ return 1;
}
- }
+ return 0;
+}
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (0)
- goto yyerrorlab;
-
-yyvsp -= yylen;
- yyssp -= yylen;
- yystate = *yyssp;
- goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
+/*
+ * Try to match a phrase using one of the above functions.
+ * This layer also deals with a couple of generic issues.
+ */
+static int
+phrase(struct gdstate *gds)
+{
+ if (timephrase(gds))
+ return 1;
+ if (zonephrase(gds))
+ return 1;
+ if (datephrase(gds))
+ return 1;
+ if (dayphrase(gds))
+ return 1;
+ if (relunitphrase(gds)) {
+ if (gds->tokenp[0].token == tAGO) {
+ gds->RelSeconds = -gds->RelSeconds;
+ gds->RelMonth = -gds->RelMonth;
+ gds->tokenp += 1;
+ }
+ return 1;
}
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
-
- yydestruct ("Error: popping", yystos[yystate], yyvsp);
- YYPOPSTACK;
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- *++yyvsp = yylval;
-
-
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
- yystate = yyn;
- goto yynewstate;
-
+ /* Bare numbers sometimes have meaning. */
+ if (gds->tokenp[0].token == tUNUMBER) {
+ if (gds->HaveTime && !gds->HaveYear && !gds->HaveRel) {
+ gds->HaveYear++;
+ gds->Year = gds->tokenp[0].value;
+ gds->tokenp += 1;
+ return 1;
+ }
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
+ if(gds->tokenp[0].value > 10000) {
+ /* "20040301" */
+ gds->HaveYear++;
+ gds->HaveMonth++;
+ gds->HaveDay++;
+ gds->Day= (gds->tokenp[0].value)%100;
+ gds->Month= (gds->tokenp[0].value/100)%100;
+ gds->Year = gds->tokenp[0].value/10000;
+ gds->tokenp += 1;
+ return 1;
+ }
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
+ if (gds->tokenp[0].value < 24) {
+ gds->HaveTime++;
+ gds->Hour = gds->tokenp[0].value;
+ gds->Minutes = 0;
+ gds->Seconds = 0;
+ gds->tokenp += 1;
+ return 1;
+ }
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
+ if ((gds->tokenp[0].value / 100 < 24)
+ && (gds->tokenp[0].value % 100 < 60)) {
+ /* "513" is same as "5:13" */
+ gds->Hour = gds->tokenp[0].value / 100;
+ gds->Minutes = gds->tokenp[0].value % 100;
+ gds->Seconds = 0;
+ gds->tokenp += 1;
+ return 1;
+ }
+ }
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- while (yyssp != yyss)
- {
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK;
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
- return yyresult;
+ return 0;
}
-
-#line 327 "getdate.y"
-
-
-static struct TABLE {
+/*
+ * A dictionary of time words.
+ */
+static struct LEXICON {
size_t abbrev;
const char *name;
int type;
@@ -1890,84 +548,84 @@ static struct TABLE {
{ 2, "friday", tDAY, 5 },
{ 2, "saturday", tDAY, 6 },
- /* Timezones: Offsets are in minutes. */
- { 0, "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
- { 0, "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
- { 0, "utc", tZONE, HOUR( 0) },
- { 0, "wet", tZONE, HOUR( 0) }, /* Western European */
- { 0, "bst", tDAYZONE, HOUR( 0) }, /* British Summer */
- { 0, "wat", tZONE, HOUR( 1) }, /* West Africa */
- { 0, "at", tZONE, HOUR( 2) }, /* Azores */
- /* { 0, "bst", tZONE, HOUR( 3) }, */ /* Brazil Standard: Conflict */
- /* { 0, "gst", tZONE, HOUR( 3) }, */ /* Greenland Standard: Conflict*/
- { 0, "nft", tZONE, HOUR(3)+30 }, /* Newfoundland */
- { 0, "nst", tZONE, HOUR(3)+30 }, /* Newfoundland Standard */
- { 0, "ndt", tDAYZONE, HOUR(3)+30 }, /* Newfoundland Daylight */
- { 0, "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */
- { 0, "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */
- { 0, "est", tZONE, HOUR( 5) }, /* Eastern Standard */
- { 0, "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */
- { 0, "cst", tZONE, HOUR( 6) }, /* Central Standard */
- { 0, "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */
- { 0, "mst", tZONE, HOUR( 7) }, /* Mountain Standard */
- { 0, "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */
- { 0, "pst", tZONE, HOUR( 8) }, /* Pacific Standard */
- { 0, "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */
- { 0, "yst", tZONE, HOUR( 9) }, /* Yukon Standard */
- { 0, "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */
- { 0, "hst", tZONE, HOUR(10) }, /* Hawaii Standard */
- { 0, "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */
- { 0, "cat", tZONE, HOUR(10) }, /* Central Alaska */
- { 0, "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */
- { 0, "nt", tZONE, HOUR(11) }, /* Nome */
- { 0, "idlw", tZONE, HOUR(12) }, /* Intl Date Line West */
- { 0, "cet", tZONE, -HOUR(1) }, /* Central European */
- { 0, "met", tZONE, -HOUR(1) }, /* Middle European */
- { 0, "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */
- { 0, "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */
- { 0, "swt", tZONE, -HOUR(1) }, /* Swedish Winter */
- { 0, "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */
- { 0, "fwt", tZONE, -HOUR(1) }, /* French Winter */
- { 0, "fst", tDAYZONE, -HOUR(1) }, /* French Summer */
- { 0, "eet", tZONE, -HOUR(2) }, /* Eastern Eur, USSR Zone 1 */
- { 0, "bt", tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */
- { 0, "it", tZONE, -HOUR(3)-30 },/* Iran */
- { 0, "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */
- { 0, "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */
- { 0, "ist", tZONE, -HOUR(5)-30 },/* Indian Standard */
- { 0, "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */
- /* { 0, "nst", tZONE, -HOUR(6.5) }, */ /* North Sumatra: Conflict */
- /* { 0, "sst", tZONE, -HOUR(7) }, */ /* So Sumatra, USSR 6: Conflict */
- { 0, "wast", tZONE, -HOUR(7) }, /* West Australian Standard */
- { 0, "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */
- { 0, "jt", tZONE, -HOUR(7)-30 },/* Java (3pm in Cronusland!)*/
- { 0, "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */
- { 0, "jst", tZONE, -HOUR(9) }, /* Japan Std, USSR Zone 8 */
- { 0, "cast", tZONE, -HOUR(9)-30 },/* Central Australian Std */
- { 0, "cadt", tDAYZONE, -HOUR(9)-30 },/* Central Australian Daylt */
- { 0, "east", tZONE, -HOUR(10) }, /* Eastern Australian Std */
- { 0, "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylt */
- { 0, "gst", tZONE, -HOUR(10) }, /* Guam Std, USSR Zone 9 */
- { 0, "nzt", tZONE, -HOUR(12) }, /* New Zealand */
- { 0, "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */
- { 0, "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */
- { 0, "idle", tZONE, -HOUR(12) }, /* Intl Date Line East */
+ /* Timezones: Offsets are in seconds. */
+ { 0, "gmt", tZONE, 0*HOUR }, /* Greenwich Mean */
+ { 0, "ut", tZONE, 0*HOUR }, /* Universal (Coordinated) */
+ { 0, "utc", tZONE, 0*HOUR },
+ { 0, "wet", tZONE, 0*HOUR }, /* Western European */
+ { 0, "bst", tDAYZONE, 0*HOUR }, /* British Summer */
+ { 0, "wat", tZONE, 1*HOUR }, /* West Africa */
+ { 0, "at", tZONE, 2*HOUR }, /* Azores */
+ /* { 0, "bst", tZONE, 3*HOUR }, */ /* Brazil Standard: Conflict */
+ /* { 0, "gst", tZONE, 3*HOUR }, */ /* Greenland Standard: Conflict*/
+ { 0, "nft", tZONE, 3*HOUR+30*MINUTE }, /* Newfoundland */
+ { 0, "nst", tZONE, 3*HOUR+30*MINUTE }, /* Newfoundland Standard */
+ { 0, "ndt", tDAYZONE, 3*HOUR+30*MINUTE }, /* Newfoundland Daylight */
+ { 0, "ast", tZONE, 4*HOUR }, /* Atlantic Standard */
+ { 0, "adt", tDAYZONE, 4*HOUR }, /* Atlantic Daylight */
+ { 0, "est", tZONE, 5*HOUR }, /* Eastern Standard */
+ { 0, "edt", tDAYZONE, 5*HOUR }, /* Eastern Daylight */
+ { 0, "cst", tZONE, 6*HOUR }, /* Central Standard */
+ { 0, "cdt", tDAYZONE, 6*HOUR }, /* Central Daylight */
+ { 0, "mst", tZONE, 7*HOUR }, /* Mountain Standard */
+ { 0, "mdt", tDAYZONE, 7*HOUR }, /* Mountain Daylight */
+ { 0, "pst", tZONE, 8*HOUR }, /* Pacific Standard */
+ { 0, "pdt", tDAYZONE, 8*HOUR }, /* Pacific Daylight */
+ { 0, "yst", tZONE, 9*HOUR }, /* Yukon Standard */
+ { 0, "ydt", tDAYZONE, 9*HOUR }, /* Yukon Daylight */
+ { 0, "hst", tZONE, 10*HOUR }, /* Hawaii Standard */
+ { 0, "hdt", tDAYZONE, 10*HOUR }, /* Hawaii Daylight */
+ { 0, "cat", tZONE, 10*HOUR }, /* Central Alaska */
+ { 0, "ahst", tZONE, 10*HOUR }, /* Alaska-Hawaii Standard */
+ { 0, "nt", tZONE, 11*HOUR }, /* Nome */
+ { 0, "idlw", tZONE, 12*HOUR }, /* Intl Date Line West */
+ { 0, "cet", tZONE, -1*HOUR }, /* Central European */
+ { 0, "met", tZONE, -1*HOUR }, /* Middle European */
+ { 0, "mewt", tZONE, -1*HOUR }, /* Middle European Winter */
+ { 0, "mest", tDAYZONE, -1*HOUR }, /* Middle European Summer */
+ { 0, "swt", tZONE, -1*HOUR }, /* Swedish Winter */
+ { 0, "sst", tDAYZONE, -1*HOUR }, /* Swedish Summer */
+ { 0, "fwt", tZONE, -1*HOUR }, /* French Winter */
+ { 0, "fst", tDAYZONE, -1*HOUR }, /* French Summer */
+ { 0, "eet", tZONE, -2*HOUR }, /* Eastern Eur, USSR Zone 1 */
+ { 0, "bt", tZONE, -3*HOUR }, /* Baghdad, USSR Zone 2 */
+ { 0, "it", tZONE, -3*HOUR-30*MINUTE },/* Iran */
+ { 0, "zp4", tZONE, -4*HOUR }, /* USSR Zone 3 */
+ { 0, "zp5", tZONE, -5*HOUR }, /* USSR Zone 4 */
+ { 0, "ist", tZONE, -5*HOUR-30*MINUTE },/* Indian Standard */
+ { 0, "zp6", tZONE, -6*HOUR }, /* USSR Zone 5 */
+ /* { 0, "nst", tZONE, -6.5*HOUR }, */ /* North Sumatra: Conflict */
+ /* { 0, "sst", tZONE, -7*HOUR }, */ /* So Sumatra, USSR 6: Conflict */
+ { 0, "wast", tZONE, -7*HOUR }, /* West Australian Standard */
+ { 0, "wadt", tDAYZONE, -7*HOUR }, /* West Australian Daylight */
+ { 0, "jt", tZONE, -7*HOUR-30*MINUTE },/* Java (3pm in Cronusland!)*/
+ { 0, "cct", tZONE, -8*HOUR }, /* China Coast, USSR Zone 7 */
+ { 0, "jst", tZONE, -9*HOUR }, /* Japan Std, USSR Zone 8 */
+ { 0, "cast", tZONE, -9*HOUR-30*MINUTE },/* Ctrl Australian Std */
+ { 0, "cadt", tDAYZONE, -9*HOUR-30*MINUTE },/* Ctrl Australian Daylt */
+ { 0, "east", tZONE, -10*HOUR }, /* Eastern Australian Std */
+ { 0, "eadt", tDAYZONE, -10*HOUR }, /* Eastern Australian Daylt */
+ { 0, "gst", tZONE, -10*HOUR }, /* Guam Std, USSR Zone 9 */
+ { 0, "nzt", tZONE, -12*HOUR }, /* New Zealand */
+ { 0, "nzst", tZONE, -12*HOUR }, /* New Zealand Standard */
+ { 0, "nzdt", tDAYZONE, -12*HOUR }, /* New Zealand Daylight */
+ { 0, "idle", tZONE, -12*HOUR }, /* Intl Date Line East */
{ 0, "dst", tDST, 0 },
/* Time units. */
{ 4, "years", tMONTH_UNIT, 12 },
{ 5, "months", tMONTH_UNIT, 1 },
- { 9, "fortnights", tSEC_UNIT, 14 * 24 * 60 * 60 },
- { 4, "weeks", tSEC_UNIT, 7 * 24 * 60 * 60 },
- { 3, "days", tSEC_UNIT, 1 * 24 * 60 * 60 },
- { 4, "hours", tSEC_UNIT, 60 * 60 },
- { 3, "minutes", tSEC_UNIT, 60 },
+ { 9, "fortnights", tSEC_UNIT, 14 * DAY },
+ { 4, "weeks", tSEC_UNIT, 7 * DAY },
+ { 3, "days", tSEC_UNIT, DAY },
+ { 4, "hours", tSEC_UNIT, HOUR },
+ { 3, "minutes", tSEC_UNIT, MINUTE },
{ 3, "seconds", tSEC_UNIT, 1 },
/* Relative-time words. */
- { 0, "tomorrow", tSEC_UNIT, 1 * 24 * 60 * 60 },
- { 0, "yesterday", tSEC_UNIT, -1 * 24 * 60 * 60 },
+ { 0, "tomorrow", tSEC_UNIT, DAY },
+ { 0, "yesterday", tSEC_UNIT, -DAY },
{ 0, "today", tSEC_UNIT, 0 },
{ 0, "now", tSEC_UNIT, 0 },
{ 0, "last", tUNUMBER, -1 },
@@ -1993,69 +651,49 @@ static struct TABLE {
{ 0, "ago", tAGO, 1 },
/* Military timezones. */
- { 0, "a", tZONE, HOUR( 1) },
- { 0, "b", tZONE, HOUR( 2) },
- { 0, "c", tZONE, HOUR( 3) },
- { 0, "d", tZONE, HOUR( 4) },
- { 0, "e", tZONE, HOUR( 5) },
- { 0, "f", tZONE, HOUR( 6) },
- { 0, "g", tZONE, HOUR( 7) },
- { 0, "h", tZONE, HOUR( 8) },
- { 0, "i", tZONE, HOUR( 9) },
- { 0, "k", tZONE, HOUR( 10) },
- { 0, "l", tZONE, HOUR( 11) },
- { 0, "m", tZONE, HOUR( 12) },
- { 0, "n", tZONE, HOUR(- 1) },
- { 0, "o", tZONE, HOUR(- 2) },
- { 0, "p", tZONE, HOUR(- 3) },
- { 0, "q", tZONE, HOUR(- 4) },
- { 0, "r", tZONE, HOUR(- 5) },
- { 0, "s", tZONE, HOUR(- 6) },
- { 0, "t", tZONE, HOUR(- 7) },
- { 0, "u", tZONE, HOUR(- 8) },
- { 0, "v", tZONE, HOUR(- 9) },
- { 0, "w", tZONE, HOUR(-10) },
- { 0, "x", tZONE, HOUR(-11) },
- { 0, "y", tZONE, HOUR(-12) },
- { 0, "z", tZONE, HOUR( 0) },
+ { 0, "a", tZONE, 1*HOUR },
+ { 0, "b", tZONE, 2*HOUR },
+ { 0, "c", tZONE, 3*HOUR },
+ { 0, "d", tZONE, 4*HOUR },
+ { 0, "e", tZONE, 5*HOUR },
+ { 0, "f", tZONE, 6*HOUR },
+ { 0, "g", tZONE, 7*HOUR },
+ { 0, "h", tZONE, 8*HOUR },
+ { 0, "i", tZONE, 9*HOUR },
+ { 0, "k", tZONE, 10*HOUR },
+ { 0, "l", tZONE, 11*HOUR },
+ { 0, "m", tZONE, 12*HOUR },
+ { 0, "n", tZONE, -1*HOUR },
+ { 0, "o", tZONE, -2*HOUR },
+ { 0, "p", tZONE, -3*HOUR },
+ { 0, "q", tZONE, -4*HOUR },
+ { 0, "r", tZONE, -5*HOUR },
+ { 0, "s", tZONE, -6*HOUR },
+ { 0, "t", tZONE, -7*HOUR },
+ { 0, "u", tZONE, -8*HOUR },
+ { 0, "v", tZONE, -9*HOUR },
+ { 0, "w", tZONE, -10*HOUR },
+ { 0, "x", tZONE, -11*HOUR },
+ { 0, "y", tZONE, -12*HOUR },
+ { 0, "z", tZONE, 0*HOUR },
/* End of table. */
{ 0, NULL, 0, 0 }
};
-
-
-
-/* ARGSUSED */
-static int
-yyerror(const char *s)
-{
- (void)s;
- return 0;
-}
-
-static time_t
-ToSeconds(time_t Hours, time_t Minutes, time_t Seconds)
-{
- if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
- return -1;
- if (Hours < 0 || Hours > 23)
- return -1;
- return (Hours * 60L + Minutes) * 60L + Seconds;
-}
-
-
-/* Year is either
- * A number from 0 to 99, which means a year from 1970 to 2069, or
- * The actual year (>=100). */
+/*
+ * Year is either:
+ * = A number from 0 to 99, which means a year from 1970 to 2069, or
+ * = The actual year (>=100).
+ */
static time_t
Convert(time_t Month, time_t Day, time_t Year,
- time_t Hours, time_t Minutes, time_t Seconds, DSTMODE DSTmode)
+ time_t Hours, time_t Minutes, time_t Seconds,
+ time_t Timezone, enum DSTMODE DSTmode)
{
static int DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
- time_t tod;
time_t Julian;
int i;
@@ -2070,7 +708,10 @@ Convert(time_t Month, time_t Day, time_t Year,
if (Year < EPOCH || Year > 2038
|| Month < 1 || Month > 12
/* Lint fluff: "conversion from long may lose accuracy" */
- || Day < 1 || Day > DaysInMonth[(int)--Month])
+ || Day < 1 || Day > DaysInMonth[(int)--Month]
+ || Hours < 0 || Hours > 23
+ || Minutes < 0 || Minutes > 59
+ || Seconds < 0 || Seconds > 59)
return -1;
Julian = Day - 1;
@@ -2078,14 +719,12 @@ Convert(time_t Month, time_t Day, time_t Year,
Julian += DaysInMonth[i];
for (i = EPOCH; i < Year; i++)
Julian += 365 + (i % 4 == 0);
- Julian *= SECSPERDAY;
- Julian += yyTimezone * 60L;
- if ((tod = ToSeconds(Hours, Minutes, Seconds)) < 0)
- return -1;
- Julian += tod;
+ Julian *= DAY;
+ Julian += Timezone;
+ Julian += Hours * HOUR + Minutes * MINUTE + Seconds;
if (DSTmode == DSTon
|| (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
- Julian -= 60 * 60;
+ Julian -= HOUR;
return Julian;
}
@@ -2098,26 +737,30 @@ DSTcorrect(time_t Start, time_t Future)
StartDay = (localtime(&Start)->tm_hour + 1) % 24;
FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
- return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
+ return (Future - Start) + (StartDay - FutureDay) * HOUR;
}
static time_t
-RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
+RelativeDate(time_t Start, time_t zone, int dstmode,
+ time_t DayOrdinal, time_t DayNumber)
{
struct tm *tm;
- time_t now;
+ time_t t, now;
+ t = Start - zone;
+ tm = gmtime(&t);
now = Start;
- tm = localtime(&now);
- now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7);
- now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
- return DSTcorrect(Start, now);
+ now += DAY * ((DayNumber - tm->tm_wday + 7) % 7);
+ now += 7 * DAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
+ if (dstmode == DSTmaybe)
+ return DSTcorrect(Start, now);
+ return now - Start;
}
static time_t
-RelativeMonth(time_t Start, time_t RelMonth)
+RelativeMonth(time_t Start, time_t Timezone, time_t RelMonth)
{
struct tm *tm;
time_t Month;
@@ -2132,24 +775,27 @@ RelativeMonth(time_t Start, time_t RelMonth)
return DSTcorrect(Start,
Convert(Month, (time_t)tm->tm_mday, Year,
(time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec,
- DSTmaybe));
+ Timezone, DSTmaybe));
}
+/*
+ * Tokenizer.
+ */
static int
-yylex(void)
+nexttoken(char **in, time_t *value)
{
char c;
char buff[64];
for ( ; ; ) {
- while (isspace((unsigned char)*yyInput))
- yyInput++;
+ while (isspace((unsigned char)**in))
+ ++*in;
/* Skip parenthesized comments. */
- if (*yyInput == '(') {
+ if (**in == '(') {
int Count = 0;
do {
- c = *yyInput++;
+ c = *(*in)++;
if (c == '\0')
return c;
if (c == '(')
@@ -2163,8 +809,8 @@ yylex(void)
/* Try the next token in the word table first. */
/* This allows us to match "2nd", for example. */
{
- char *src = yyInput;
- const struct TABLE *tp;
+ char *src = *in;
+ const struct LEXICON *tp;
unsigned i = 0;
/* Force to lowercase and strip '.' characters. */
@@ -2179,7 +825,7 @@ yylex(void)
}
src++;
}
- buff[i++] = '\0';
+ buff[i] = '\0';
/*
* Find the first match. If the word can be
@@ -2194,9 +840,9 @@ yylex(void)
&& strncmp(tp->name, buff, strlen(buff))
== 0) {
/* Skip over token. */
- yyInput = src;
+ *in = src;
/* Return the match. */
- yylval.Number = tp->value;
+ *value = tp->value;
return tp->type;
}
}
@@ -2207,14 +853,14 @@ yylex(void)
* Because '-' and '+' have other special meanings, I
* don't deal with signed numbers here.
*/
- if (isdigit((unsigned char)(c = *yyInput))) {
- for (yylval.Number = 0; isdigit((unsigned char)(c = *yyInput++)); )
- yylval.Number = 10 * yylval.Number + c - '0';
- yyInput--;
+ if (isdigit((unsigned char)(c = **in))) {
+ for (*value = 0; isdigit((unsigned char)(c = *(*in)++)); )
+ *value = 10 * *value + c - '0';
+ (*in)--;
return (tUNUMBER);
}
- return (*yyInput++);
+ return *(*in)++;
}
}
@@ -2236,86 +882,135 @@ difftm (struct tm *a, struct tm *b)
/* + difference in years * 365 */
+ (long)(ay-by) * 365
);
- return (60*(60*(24*days + (a->tm_hour - b->tm_hour))
- + (a->tm_min - b->tm_min))
+ return (days * DAY + (a->tm_hour - b->tm_hour) * HOUR
+ + (a->tm_min - b->tm_min) * MINUTE
+ (a->tm_sec - b->tm_sec));
}
+/*
+ *
+ * The public function.
+ *
+ * TODO: tokens[] array should be dynamically sized.
+ */
time_t
-get_date(char *p)
+get_date(time_t now, char *p)
{
- struct tm *tm;
+ struct token tokens[256];
+ struct gdstate _gds;
+ struct token *lasttoken;
+ struct gdstate *gds;
+ struct tm local, *tm;
struct tm gmt, *gmt_ptr;
time_t Start;
time_t tod;
- time_t nowtime;
long tzone;
- memset(&gmt, 0, sizeof(gmt));
- yyInput = p;
+ /* Clear out the parsed token array. */
+ memset(tokens, 0, sizeof(tokens));
+ /* Initialize the parser state. */
+ memset(&_gds, 0, sizeof(_gds));
+ gds = &_gds;
- (void)time (&nowtime);
+ /* Look up the current time. */
+ memset(&local, 0, sizeof(local));
+ tm = localtime (&now);
+ if (tm == NULL)
+ return -1;
+ local = *tm;
- gmt_ptr = gmtime (&nowtime);
+ /* Look up UTC if we can and use that to determine the current
+ * timezone offset. */
+ memset(&gmt, 0, sizeof(gmt));
+ gmt_ptr = gmtime (&now);
if (gmt_ptr != NULL) {
/* Copy, in case localtime and gmtime use the same buffer. */
gmt = *gmt_ptr;
}
-
- if (! (tm = localtime (&nowtime)))
- return -1;
-
if (gmt_ptr != NULL)
- tzone = difftm (&gmt, tm) / 60;
+ tzone = difftm (&gmt, &local);
else
/* This system doesn't understand timezones; fake it. */
tzone = 0;
- if(tm->tm_isdst)
- tzone += 60;
-
- yyYear = tm->tm_year + 1900;
- yyMonth = tm->tm_mon + 1;
- yyDay = tm->tm_mday;
- yyTimezone = tzone;
- yyDSTmode = DSTmaybe;
- yyHour = 0;
- yyMinutes = 0;
- yySeconds = 0;
- yyRelSeconds = 0;
- yyRelMonth = 0;
- yyHaveDate = 0;
- yyHaveDay = 0;
- yyHaveRel = 0;
- yyHaveTime = 0;
- yyHaveZone = 0;
-
- if (yyparse()
- || yyHaveTime > 1 || yyHaveZone > 1
- || yyHaveDate > 1 || yyHaveDay > 1)
+ if(local.tm_isdst)
+ tzone += HOUR;
+
+ /* Tokenize the input string. */
+ lasttoken = tokens;
+ while ((lasttoken->token = nexttoken(&p, &lasttoken->value)) != 0) {
+ ++lasttoken;
+ if (lasttoken > tokens + 255)
+ return -1;
+ }
+ gds->tokenp = tokens;
+
+ /* Match phrases until we run out of input tokens. */
+ while (gds->tokenp < lasttoken) {
+ if (!phrase(gds))
+ return -1;
+ }
+
+ /* Use current local timezone if none was specified. */
+ if (!gds->HaveZone) {
+ gds->Timezone = tzone;
+ gds->DSTmode = DSTmaybe;
+ }
+
+ /* If a timezone was specified, use that for generating the default
+ * time components instead of the local timezone. */
+ if (gds->HaveZone && gmt_ptr != NULL) {
+ now -= gds->Timezone;
+ gmt_ptr = gmtime (&now);
+ if (gmt_ptr != NULL)
+ local = *gmt_ptr;
+ now += gds->Timezone;
+ }
+
+ if (!gds->HaveYear)
+ gds->Year = local.tm_year + 1900;
+ if (!gds->HaveMonth)
+ gds->Month = local.tm_mon + 1;
+ if (!gds->HaveDay)
+ gds->Day = local.tm_mday;
+ /* Note: No default for hour/min/sec; a specifier that just
+ * gives date always refers to 00:00 on that date. */
+
+ /* If we saw more than one time, timezone, weekday, year, month,
+ * or day, then give up. */
+ if (gds->HaveTime > 1 || gds->HaveZone > 1 || gds->HaveWeekDay > 1
+ || gds->HaveYear > 1 || gds->HaveMonth > 1 || gds->HaveDay > 1)
return -1;
- if (yyHaveDate || yyHaveTime || yyHaveDay) {
- Start = Convert(yyMonth, yyDay, yyYear,
- yyHour, yyMinutes, yySeconds, yyDSTmode);
+ /* Compute an absolute time based on whatever absolute information
+ * we collected. */
+ if (gds->HaveYear || gds->HaveMonth || gds->HaveDay
+ || gds->HaveTime || gds->HaveWeekDay) {
+ Start = Convert(gds->Month, gds->Day, gds->Year,
+ gds->Hour, gds->Minutes, gds->Seconds,
+ gds->Timezone, gds->DSTmode);
if (Start < 0)
return -1;
} else {
- Start = nowtime;
- if (!yyHaveRel)
- Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec;
+ Start = now;
+ if (!gds->HaveRel)
+ Start -= local.tm_hour * HOUR + local.tm_min * MINUTE
+ + local.tm_sec;
}
- Start += yyRelSeconds;
- Start += RelativeMonth(Start, yyRelMonth);
+ /* Add the relative offset. */
+ Start += gds->RelSeconds;
+ Start += RelativeMonth(Start, gds->Timezone, gds->RelMonth);
- if (yyHaveDay && !yyHaveDate) {
- tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber);
+ /* Adjust for day-of-week offsets. */
+ if (gds->HaveWeekDay
+ && !(gds->HaveYear || gds->HaveMonth || gds->HaveDay)) {
+ tod = RelativeDate(Start, gds->Timezone,
+ gds->DSTmode, gds->DayOrdinal, gds->DayNumber);
Start += tod;
}
- /* Have to do *something* with a legitimate -1 so it's
- * distinguishable from the error return value. (Alternately
- * could set errno on error.) */
+ /* -1 is an error indicator, so return 0 instead of -1 if
+ * that's the actual time. */
return Start == -1 ? 0 : Start;
}
@@ -2340,5 +1035,3 @@ main(int argc, char **argv)
/* NOTREACHED */
}
#endif /* defined(TEST) */
-
-
diff --git a/archivers/libarchive/files/tar/read.c b/archivers/libarchive/files/tar/read.c
index fbb82533a72..aaaacac0dca 100644
--- a/archivers/libarchive/files/tar/read.c
+++ b/archivers/libarchive/files/tar/read.c
@@ -24,16 +24,11 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.38 2008/05/26 17:10:10 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.40 2008/08/21 06:41:14 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#elif defined(MAJOR_IN_SYSMACROS)
-#include <sys/sysmacros.h>
-#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -53,6 +48,9 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.38 2008/05/26 17:10:10 kientzle E
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -68,6 +66,13 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.38 2008/05/26 17:10:10 kientzle E
#endif
#include "bsdtar.h"
+#include "err.h"
+
+struct progress_data {
+ struct bsdtar *bsdtar;
+ struct archive *archive;
+ struct archive_entry *entry;
+};
static void list_item_verbose(struct bsdtar *, FILE *,
struct archive_entry *);
@@ -77,28 +82,48 @@ void
tar_mode_t(struct bsdtar *bsdtar)
{
read_archive(bsdtar, 't');
- unmatched_inclusions_warn(bsdtar, "Not found in archive");
+ if (lafe_unmatched_inclusions_warn(bsdtar->matching, "Not found in archive") != 0)
+ bsdtar->return_value = 1;
}
void
tar_mode_x(struct bsdtar *bsdtar)
{
- /* We want to catch SIGINFO and SIGUSR1. */
- siginfo_init(bsdtar);
-
read_archive(bsdtar, 'x');
- unmatched_inclusions_warn(bsdtar, "Not found in archive");
- /* Restore old SIGINFO + SIGUSR1 handlers. */
- siginfo_done(bsdtar);
+ if (lafe_unmatched_inclusions_warn(bsdtar->matching, "Not found in archive") != 0)
+ bsdtar->return_value = 1;
}
static void
-progress_func(void * cookie)
+progress_func(void *cookie)
{
- struct bsdtar * bsdtar = cookie;
-
- siginfo_printinfo(bsdtar, 0);
+ struct progress_data *progress_data = cookie;
+ struct bsdtar *bsdtar = progress_data->bsdtar;
+ struct archive *a = progress_data->archive;
+ struct archive_entry *entry = progress_data->entry;
+ uint64_t comp, uncomp;
+
+ if (!need_report())
+ return;
+
+ if (bsdtar->verbose)
+ fprintf(stderr, "\n");
+ if (a != NULL) {
+ comp = archive_position_compressed(a);
+ uncomp = archive_position_uncompressed(a);
+ fprintf(stderr,
+ "In: %s bytes, compression %d%%;",
+ tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp));
+ fprintf(stderr, " Out: %d files, %s bytes\n",
+ archive_file_count(a), tar_i64toa(uncomp));
+ }
+ if (entry != NULL) {
+ safe_fprintf(stderr, "Current: %s",
+ archive_entry_pathname(entry));
+ fprintf(stderr, " (%s bytes)\n",
+ tar_i64toa(archive_entry_size(entry)));
+ }
}
/*
@@ -107,6 +132,7 @@ progress_func(void * cookie)
static void
read_archive(struct bsdtar *bsdtar, char mode)
{
+ struct progress_data progress_data;
FILE *out;
struct archive *a;
struct archive_entry *entry;
@@ -114,12 +140,13 @@ read_archive(struct bsdtar *bsdtar, char mode)
int r;
while (*bsdtar->argv) {
- include(bsdtar, *bsdtar->argv);
+ lafe_include(&bsdtar->matching, *bsdtar->argv);
bsdtar->argv++;
}
if (bsdtar->names_from_file != NULL)
- include_from_file(bsdtar, bsdtar->names_from_file);
+ lafe_include_from_file(&bsdtar->matching,
+ bsdtar->names_from_file, bsdtar->option_null);
a = archive_read_new();
if (bsdtar->compress_program != NULL)
@@ -127,26 +154,30 @@ read_archive(struct bsdtar *bsdtar, char mode)
else
archive_read_support_compression_all(a);
archive_read_support_format_all(a);
+ if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
if (archive_read_open_file(a, bsdtar->filename,
bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block :
DEFAULT_BYTES_PER_BLOCK))
- bsdtar_errc(bsdtar, 1, 0, "Error opening archive: %s",
+ lafe_errc(1, 0, "Error opening archive: %s",
archive_error_string(a));
do_chdir(bsdtar);
if (mode == 'x') {
/* Set an extract callback so that we can handle SIGINFO. */
+ progress_data.bsdtar = bsdtar;
+ progress_data.archive = a;
archive_read_extract_set_progress_callback(a, progress_func,
- bsdtar);
+ &progress_data);
}
if (mode == 'x' && bsdtar->option_chroot) {
#if HAVE_CHROOT
if (chroot(".") != 0)
- bsdtar_errc(bsdtar, 1, errno, "Can't chroot to \".\"");
+ lafe_errc(1, errno, "Can't chroot to \".\"");
#else
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"chroot isn't supported on this platform");
#endif
}
@@ -154,19 +185,20 @@ read_archive(struct bsdtar *bsdtar, char mode)
for (;;) {
/* Support --fast-read option */
if (bsdtar->option_fast_read &&
- unmatched_inclusions(bsdtar) == 0)
+ lafe_unmatched_inclusions(bsdtar->matching) == 0)
break;
r = archive_read_next_header(a, &entry);
+ progress_data.entry = entry;
if (r == ARCHIVE_EOF)
break;
if (r < ARCHIVE_OK)
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
+ lafe_warnc(0, "%s", archive_error_string(a));
if (r <= ARCHIVE_WARN)
bsdtar->return_value = 1;
if (r == ARCHIVE_RETRY) {
/* Retryable error: try again */
- bsdtar_warnc(bsdtar, 0, "Retrying...");
+ lafe_warnc(0, "Retrying...");
continue;
}
if (r == ARCHIVE_FATAL)
@@ -207,25 +239,20 @@ read_archive(struct bsdtar *bsdtar, char mode)
* rewrite, there would be no way to exclude foo1/bar
* while allowing foo2/bar.)
*/
- if (excluded(bsdtar, archive_entry_pathname(entry)))
+ if (lafe_excluded(bsdtar->matching, archive_entry_pathname(entry)))
continue; /* Excluded by a pattern test. */
- /*
- * Modify the pathname as requested by the user. We
- * do this for -t as well to give users a way to
- * preview the effects of their rewrites. We also do
- * this before extraction security checks (including
- * leading '/' removal). Note that some rewrite
- * failures prevent extraction.
- */
- if (edit_pathname(bsdtar, entry))
- continue; /* Excluded by a rewrite failure. */
-
if (mode == 't') {
/* Perversely, gtar uses -O to mean "send to stderr"
* when used with -t. */
out = bsdtar->option_stdout ? stderr : stdout;
+ /*
+ * TODO: Provide some reasonable way to
+ * preview rewrites. gtar always displays
+ * the unedited path in -t output, which means
+ * you cannot easily preview rewrites.
+ */
if (bsdtar->verbose < 2)
safe_fprintf(out, "%s",
archive_entry_pathname(entry));
@@ -235,23 +262,27 @@ read_archive(struct bsdtar *bsdtar, char mode)
r = archive_read_data_skip(a);
if (r == ARCHIVE_WARN) {
fprintf(out, "\n");
- bsdtar_warnc(bsdtar, 0, "%s",
+ lafe_warnc(0, "%s",
archive_error_string(a));
}
if (r == ARCHIVE_RETRY) {
fprintf(out, "\n");
- bsdtar_warnc(bsdtar, 0, "%s",
+ lafe_warnc(0, "%s",
archive_error_string(a));
}
if (r == ARCHIVE_FATAL) {
fprintf(out, "\n");
- bsdtar_warnc(bsdtar, 0, "%s",
+ lafe_warnc(0, "%s",
archive_error_string(a));
bsdtar->return_value = 1;
break;
}
fprintf(out, "\n");
} else {
+ /* Note: some rewrite failures prevent extraction. */
+ if (edit_pathname(bsdtar, entry))
+ continue; /* Excluded by a rewrite failure. */
+
if (bsdtar->option_interactive &&
!yes("extract '%s'", archive_entry_pathname(entry)))
continue;
@@ -266,10 +297,7 @@ read_archive(struct bsdtar *bsdtar, char mode)
fflush(stderr);
}
- /* Tell the SIGINFO-handler code what we're doing. */
- siginfo_setinfo(bsdtar, "extracting",
- archive_entry_pathname(entry), 0);
- siginfo_printinfo(bsdtar, 0);
+ // TODO siginfo_printinfo(bsdtar, 0);
if (bsdtar->option_stdout)
r = archive_read_data_into_fd(a, 1);
@@ -293,6 +321,13 @@ read_archive(struct bsdtar *bsdtar, char mode)
}
}
+
+ r = archive_read_close(a);
+ if (r != ARCHIVE_OK)
+ lafe_warnc(0, "%s", archive_error_string(a));
+ if (r <= ARCHIVE_WARN)
+ bsdtar->return_value = 1;
+
if (bsdtar->verbose > 2)
fprintf(stdout, "Archive Format: %s, Compression: %s\n",
archive_format_name(a), archive_compression_name(a));
@@ -312,7 +347,6 @@ read_archive(struct bsdtar *bsdtar, char mode)
static void
list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
{
- const struct stat *st;
char tmp[100];
size_t w;
const char *p;
@@ -320,8 +354,6 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
time_t tim;
static time_t now;
- st = archive_entry_stat(entry);
-
/*
* We avoid collecting the entire list in memory at once by
* listing things as we see them. However, that also means we can't
@@ -337,12 +369,13 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
time(&now);
fprintf(out, "%s %d ",
archive_entry_strmode(entry),
- (int)(st->st_nlink));
+ archive_entry_nlink(entry));
/* Use uname if it's present, else uid. */
p = archive_entry_uname(entry);
if ((p == NULL) || (*p == '\0')) {
- sprintf(tmp, "%lu ", (unsigned long)st->st_uid);
+ sprintf(tmp, "%lu ",
+ (unsigned long)archive_entry_uid(entry));
p = tmp;
}
w = strlen(p);
@@ -356,7 +389,8 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
fprintf(out, "%s", p);
w = strlen(p);
} else {
- sprintf(tmp, "%lu", (unsigned long)st->st_gid);
+ sprintf(tmp, "%lu",
+ (unsigned long)archive_entry_gid(entry));
w = strlen(tmp);
fprintf(out, "%s", tmp);
}
@@ -366,29 +400,30 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
* total width of group and devnum/filesize fields be gs_width.
* If gs_width is too small, grow it.
*/
- if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
+ if (archive_entry_filetype(entry) == AE_IFCHR
+ || archive_entry_filetype(entry) == AE_IFBLK) {
sprintf(tmp, "%lu,%lu",
- (unsigned long)major(st->st_rdev),
- (unsigned long)minor(st->st_rdev)); /* ls(1) also casts here. */
+ (unsigned long)archive_entry_rdevmajor(entry),
+ (unsigned long)archive_entry_rdevminor(entry));
} else {
- /*
- * Note the use of platform-dependent macros to format
- * the filesize here. We need the format string and the
- * corresponding type for the cast.
- */
- sprintf(tmp, BSDTAR_FILESIZE_PRINTF,
- (BSDTAR_FILESIZE_TYPE)st->st_size);
+ strcpy(tmp, tar_i64toa(archive_entry_size(entry)));
}
if (w + strlen(tmp) >= bsdtar->gs_width)
bsdtar->gs_width = w+strlen(tmp)+1;
fprintf(out, "%*s", (int)(bsdtar->gs_width - w), tmp);
/* Format the time using 'ls -l' conventions. */
- tim = (time_t)st->st_mtime;
- if (abs(tim - now) > (365/2)*86400)
- fmt = bsdtar->day_first ? "%e %b %Y" : "%b %e %Y";
+ tim = archive_entry_mtime(entry);
+#define HALF_YEAR (time_t)365 * 86400 / 2
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define DAY_FMT "%d" /* Windows' strftime function does not support %e format. */
+#else
+#define DAY_FMT "%e" /* Day number without leading zeros */
+#endif
+ if (tim < now - HALF_YEAR || tim > now + HALF_YEAR)
+ fmt = bsdtar->day_first ? DAY_FMT " %b %Y" : "%b " DAY_FMT " %Y";
else
- fmt = bsdtar->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
+ fmt = bsdtar->day_first ? DAY_FMT " %b %H:%M" : "%b " DAY_FMT " %H:%M";
strftime(tmp, sizeof(tmp), fmt, localtime(&tim));
fprintf(out, " %s ", tmp);
safe_fprintf(out, "%s", archive_entry_pathname(entry));
@@ -397,6 +432,6 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
if (archive_entry_hardlink(entry)) /* Hard link */
safe_fprintf(out, " link to %s",
archive_entry_hardlink(entry));
- else if (S_ISLNK(st->st_mode)) /* Symbolic link */
+ else if (archive_entry_symlink(entry)) /* Symbolic link */
safe_fprintf(out, " -> %s", archive_entry_symlink(entry));
}
diff --git a/archivers/libarchive/files/tar/subst.c b/archivers/libarchive/files/tar/subst.c
index 1c32fb0752b..3982054193c 100644
--- a/archivers/libarchive/files/tar/subst.c
+++ b/archivers/libarchive/files/tar/subst.c
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/subst.c,v 1.4 2008/06/15 10:08:16 kientzle E
#define REG_BASIC 0
#endif
+#include "err.h"
+
struct subst_rule {
struct subst_rule *next;
regex_t re;
@@ -56,7 +58,7 @@ init_substitution(struct bsdtar *bsdtar)
bsdtar->substitution = subst = malloc(sizeof(*subst));
if (subst == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
subst->first_rule = subst->last_rule = NULL;
}
@@ -76,7 +78,7 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
rule = malloc(sizeof(*rule));
if (rule == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
rule->next = NULL;
if (subst->last_rule == NULL)
@@ -86,32 +88,32 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
subst->last_rule = rule;
if (*rule_text == '\0')
- bsdtar_errc(bsdtar, 1, 0, "Empty replacement string");
+ lafe_errc(1, 0, "Empty replacement string");
end_pattern = strchr(rule_text + 1, *rule_text);
if (end_pattern == NULL)
- bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string");
+ lafe_errc(1, 0, "Invalid replacement string");
pattern = malloc(end_pattern - rule_text);
if (pattern == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1);
pattern[end_pattern - rule_text - 1] = '\0';
if ((r = regcomp(&rule->re, pattern, REG_BASIC)) != 0) {
char buf[80];
regerror(r, &rule->re, buf, sizeof(buf));
- bsdtar_errc(bsdtar, 1, 0, "Invalid regular expression: %s", buf);
+ lafe_errc(1, 0, "Invalid regular expression: %s", buf);
}
free(pattern);
start_subst = end_pattern + 1;
end_pattern = strchr(start_subst, *rule_text);
if (end_pattern == NULL)
- bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string");
+ lafe_errc(1, 0, "Invalid replacement string");
rule->result = malloc(end_pattern - start_subst + 1);
if (rule->result == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
memcpy(rule->result, start_subst, end_pattern - start_subst);
rule->result[end_pattern - start_subst] = '\0';
@@ -134,13 +136,13 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
rule->symlink = 1;
break;
default:
- bsdtar_errc(bsdtar, 1, 0, "Invalid replacement flag %c", *end_pattern);
+ lafe_errc(1, 0, "Invalid replacement flag %c", *end_pattern);
}
}
}
static void
-realloc_strncat(struct bsdtar *bsdtar, char **str, const char *append, size_t len)
+realloc_strncat(char **str, const char *append, size_t len)
{
char *new_str;
size_t old_len;
@@ -152,7 +154,7 @@ realloc_strncat(struct bsdtar *bsdtar, char **str, const char *append, size_t le
new_str = malloc(old_len + len + 1);
if (new_str == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
memcpy(new_str, *str, old_len);
memcpy(new_str + old_len, append, len);
new_str[old_len + len] = '\0';
@@ -161,7 +163,7 @@ realloc_strncat(struct bsdtar *bsdtar, char **str, const char *append, size_t le
}
static void
-realloc_strcat(struct bsdtar *bsdtar, char **str, const char *append)
+realloc_strcat(char **str, const char *append)
{
char *new_str;
size_t old_len;
@@ -173,7 +175,7 @@ realloc_strcat(struct bsdtar *bsdtar, char **str, const char *append)
new_str = malloc(old_len + strlen(append) + 1);
if (new_str == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
+ lafe_errc(1, errno, "Out of memory");
memcpy(new_str, *str, old_len);
strcpy(new_str + old_len, append);
free(*str);
@@ -202,16 +204,16 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s
if (symlink_only && !rule->symlink)
continue;
if (regexec(&rule->re, name, 10, matches, 0))
- break;
+ continue;
got_match = 1;
print_match |= rule->print;
- realloc_strncat(bsdtar, result, name, matches[0].rm_so);
+ realloc_strncat(result, name, matches[0].rm_so);
for (i = 0, j = 0; rule->result[i] != '\0'; ++i) {
if (rule->result[i] == '~') {
- realloc_strncat(bsdtar, result, rule->result + j, i - j);
- realloc_strncat(bsdtar, result, name, matches[0].rm_eo);
+ realloc_strncat(result, rule->result + j, i - j);
+ realloc_strncat(result, name, matches[0].rm_eo);
j = i + 1;
continue;
}
@@ -223,7 +225,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s
switch (c) {
case '~':
case '\\':
- realloc_strncat(bsdtar, result, rule->result + j, i - j - 1);
+ realloc_strncat(result, rule->result + j, i - j - 1);
j = i;
break;
case '1':
@@ -235,13 +237,13 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s
case '7':
case '8':
case '9':
- realloc_strncat(bsdtar, result, rule->result + j, i - j - 1);
+ realloc_strncat(result, rule->result + j, i - j - 1);
if ((size_t)(c - '0') > (size_t)(rule->re.re_nsub)) {
free(*result);
*result = NULL;
return -1;
}
- realloc_strncat(bsdtar, result, name + matches[c - '0'].rm_so, matches[c - '0'].rm_eo - matches[c - '0'].rm_so);
+ realloc_strncat(result, name + matches[c - '0'].rm_so, matches[c - '0'].rm_eo - matches[c - '0'].rm_so);
j = i + 1;
break;
default:
@@ -251,7 +253,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s
}
- realloc_strcat(bsdtar, result, rule->result + j);
+ realloc_strcat(result, rule->result + j);
name += matches[0].rm_eo;
@@ -260,7 +262,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s
}
if (got_match)
- realloc_strcat(bsdtar, result, name);
+ realloc_strcat(result, name);
if (print_match)
fprintf(stderr, "%s >> %s\n", path, *result);
diff --git a/archivers/libarchive/files/tar/test/CMakeLists.txt b/archivers/libarchive/files/tar/test/CMakeLists.txt
new file mode 100644
index 00000000000..6064e142407
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/CMakeLists.txt
@@ -0,0 +1,67 @@
+############################################
+#
+# How to build bsdtar_test
+#
+############################################
+IF(ENABLE_TAR AND ENABLE_TEST)
+ SET(bsdtar_test_SOURCES
+ ../getdate.c
+ main.c
+ test.h
+ test_0.c
+ test_basic.c
+ test_copy.c
+ test_empty_mtree.c
+ test_getdate.c
+ test_help.c
+ test_option_T_upper.c
+ test_option_q.c
+ test_option_r.c
+ test_option_s.c
+ test_patterns.c
+ test_stdio.c
+ test_strip_components.c
+ test_symlink_dir.c
+ test_version.c
+ test_windows.c
+ )
+ IF(WIN32 AND NOT CYGWIN)
+ LIST(APPEND bsdtar_test_SOURCES ../bsdtar_windows.c)
+ LIST(APPEND bsdtar_test_SOURCES ../bsdtar_windows.h)
+ ENDIF(WIN32 AND NOT CYGWIN)
+
+ #
+ # Register target
+ #
+ ADD_EXECUTABLE(bsdtar_test ${bsdtar_test_SOURCES})
+ SET_PROPERTY(TARGET bsdtar_test PROPERTY COMPILE_DEFINITIONS LIST_H)
+
+ #
+ # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
+ #
+ GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
+ ${CMAKE_CURRENT_LIST_FILE} ${bsdtar_test_SOURCES})
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+ # list.h has a line DEFINE_TEST(testname) for every
+ # test. We can use that to define the tests for cmake by
+ # defining a DEFINE_TEST macro and reading list.h in.
+ MACRO (DEFINE_TEST _testname)
+ ADD_TEST_28(
+ NAME bsdtar_${_testname}
+ COMMAND bsdtar_test -vv
+ -p $<TARGET_FILE:bsdtar>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
+ ENDMACRO (DEFINE_TEST _testname)
+
+ INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
+
+ # Experimental new test handling
+ ADD_CUSTOM_TARGET(run_bsdtar_test
+ COMMAND bsdtar_test -p ${BSDTAR} -r ${CMAKE_CURRENT_SOURCE_DIR})
+ ADD_DEPENDENCIES(run_bsdtar_test bsdtar)
+ ADD_DEPENDENCIES(run_all_tests run_bsdtar_test)
+
+ENDIF (ENABLE_TAR AND ENABLE_TEST)
diff --git a/archivers/libarchive/files/tar/test/list.h b/archivers/libarchive/files/tar/test/list.h
new file mode 100644
index 00000000000..4b91fb68416
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/list.h
@@ -0,0 +1,16 @@
+DEFINE_TEST(test_0)
+DEFINE_TEST(test_basic)
+DEFINE_TEST(test_copy)
+DEFINE_TEST(test_empty_mtree)
+DEFINE_TEST(test_getdate)
+DEFINE_TEST(test_help)
+DEFINE_TEST(test_option_T_upper)
+DEFINE_TEST(test_option_q)
+DEFINE_TEST(test_option_r)
+DEFINE_TEST(test_option_s)
+DEFINE_TEST(test_patterns)
+DEFINE_TEST(test_stdio)
+DEFINE_TEST(test_strip_components)
+DEFINE_TEST(test_symlink_dir)
+DEFINE_TEST(test_version)
+DEFINE_TEST(test_windows)
diff --git a/archivers/libarchive/files/tar/test/main.c b/archivers/libarchive/files/tar/test/main.c
index 27bb48d4094..6028d7789a4 100644
--- a/archivers/libarchive/files/tar/test/main.c
+++ b/archivers/libarchive/files/tar/test/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Various utility routines useful for test programs.
- * Each test program is linked against this file.
- */
#include "test.h"
-
#include <errno.h>
#include <locale.h>
#include <stdarg.h>
@@ -38,148 +33,319 @@
* This same file is used pretty much verbatim for all test harnesses.
*
* The next few lines are the only differences.
+ * TODO: Move this into a separate configuration header, have all test
+ * suites share one copy of this file.
*/
-#define PROGRAM "bsdtar" /* Name of program being tested. */
-#define ENVBASE "BSDTAR" /* Prefix for environment variables. */
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientzle Exp $");
+#define KNOWNREF "test_patterns_2.tar.uu"
+#define ENVBASE "BSDTAR" /* Prefix for environment variables. */
+#define PROGRAM "bsdtar" /* Name of program being tested. */
+#undef LIBRARY /* Not testing a library. */
#undef EXTRA_DUMP /* How to dump extra data */
/* How to generate extra version info. */
#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "")
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.3 2008/06/15 10:07:54 kientzle Exp $");
/*
- * "list.h" is simply created by "grep DEFINE_TEST"; it has
- * a line like
- * DEFINE_TEST(test_function)
- * for each test.
- * Include it here with a suitable DEFINE_TEST to declare all of the
- * test functions.
+ *
+ * Windows support routines
+ *
+ * Note: Configuration is a tricky issue. Using HAVE_* feature macros
+ * in the test harness is dangerous because they cover up
+ * configuration errors. The classic example of this is omitting a
+ * configure check. If libarchive and libarchive_test both look for
+ * the same feature macro, such errors are hard to detect. Platform
+ * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
+ * easily lead to very messy code. It's best to limit yourself
+ * to only the most generic programming techniques in the test harness
+ * and thus avoid conditionals altogether. Where that's not possible,
+ * try to minimize conditionals by grouping platform-specific tests in
+ * one place (e.g., test_acl_freebsd) or by adding new assert()
+ * functions (e.g., assertMakeHardlink()) to cover up platform
+ * differences. Platform-specific coding in libarchive_test is often
+ * a symptom that some capability is missing from libarchive itself.
*/
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void);
-#include "list.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <io.h>
+#include <windows.h>
+#ifndef F_OK
+#define F_OK (0)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) ((m) & _S_IFDIR)
+#endif
+#ifndef S_ISREG
+#define S_ISREG(m) ((m) & _S_IFREG)
+#endif
+#if !defined(__BORLANDC__)
+#define access _access
+#undef chdir
+#define chdir _chdir
+#endif
+#ifndef fileno
+#define fileno _fileno
+#endif
+/*#define fstat _fstat64*/
+#if !defined(__BORLANDC__)
+#define getcwd _getcwd
+#endif
+#define lstat stat
+/*#define lstat _stat64*/
+/*#define stat _stat64*/
+#define rmdir _rmdir
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#define umask _umask
+#endif
+#define int64_t __int64
+#endif
+
+#if defined(HAVE__CrtSetReportMode)
+# include <crtdbg.h>
+#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+void *GetFunctionKernel32(const char *name)
+{
+ static HINSTANCE lib;
+ static int set;
+ if (!set) {
+ set = 1;
+ lib = LoadLibrary("kernel32.dll");
+ }
+ if (lib == NULL) {
+ fprintf(stderr, "Can't load kernel32.dll?!\n");
+ exit(1);
+ }
+ return (void *)GetProcAddress(lib, name);
+}
+
+static int
+my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateSymbolicLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, flags);
+}
+
+static int
+my_CreateHardLinkA(const char *linkname, const char *target)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateHardLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, NULL);
+}
+
+int
+my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
+{
+ HANDLE h;
+ int r;
+
+ memset(bhfi, 0, sizeof(*bhfi));
+ h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE)
+ return (0);
+ r = GetFileInformationByHandle(h, bhfi);
+ CloseHandle(h);
+ return (r);
+}
+#endif
-/* Interix doesn't define these in a standard header. */
-#if __INTERIX__
-extern char *optarg;
-extern int optind;
+#if defined(HAVE__CrtSetReportMode)
+static void
+invalid_parameter_handler(const wchar_t * expression,
+ const wchar_t * function, const wchar_t * file,
+ unsigned int line, uintptr_t pReserved)
+{
+ /* nop */
+}
#endif
+/*
+ *
+ * OPTIONS FLAGS
+ *
+ */
+
/* Enable core dump on failure. */
static int dump_on_failure = 0;
-/* Default is to remove temp dirs for successful tests. */
+/* Default is to remove temp dirs and log data for successful tests. */
static int keep_temp_files = 0;
-/* Default is to print some basic information about each test. */
-static int quiet_flag = 0;
-/* Default is to summarize repeated failures. */
-static int verbose = 0;
-/* Cumulative count of component failures. */
+/* Default is to just report pass/fail for each test. */
+static int verbosity = 0;
+#define VERBOSITY_SUMMARY_ONLY -1 /* -q */
+#define VERBOSITY_PASSFAIL 0 /* Default */
+#define VERBOSITY_LIGHT_REPORT 1 /* -v */
+#define VERBOSITY_FULL 2 /* -vv */
+/* A few places generate even more output for verbosity > VERBOSITY_FULL,
+ * mostly for debugging the test harness itself. */
+/* Cumulative count of assertion failures. */
static int failures = 0;
-/* Cumulative count of skipped component tests. */
+/* Cumulative count of reported skips. */
static int skips = 0;
-/* Cumulative count of assertions. */
+/* Cumulative count of assertions checked. */
static int assertions = 0;
/* Directory where uuencoded reference files can be found. */
-static char *refdir;
+static const char *refdir;
/*
- * My own implementation of the standard assert() macro emits the
- * message in the same format as GCC (file:line: message).
- * It also includes some additional useful information.
- * This makes it a lot easier to skim through test failures in
- * Emacs. ;-)
- *
- * It also supports a few special features specifically to simplify
- * test harnesses:
- * failure(fmt, args) -- Stores a text string that gets
- * printed if the following assertion fails, good for
- * explaining subtle tests.
+ * Report log information selectively to console and/or disk log.
*/
-static char msg[4096];
-
-/*
- * For each test source file, we remember how many times each
- * failure was reported.
- */
-static const char *failed_filename = NULL;
-static struct line {
- int line;
- int count;
-} failed_lines[1000];
-
-/*
- * Count this failure; return the number of previous failures.
- */
-static int
-previous_failures(const char *filename, int line)
+static int log_console = 0;
+static FILE *logfile;
+static void
+vlogprintf(const char *fmt, va_list ap)
{
- unsigned int i;
- int count;
+#ifdef va_copy
+ va_list lfap;
+ va_copy(lfap, ap);
+#endif
+ if (log_console)
+ vfprintf(stdout, fmt, ap);
+ if (logfile != NULL)
+#ifdef va_copy
+ vfprintf(logfile, fmt, lfap);
+ va_end(lfap);
+#else
+ vfprintf(logfile, fmt, ap);
+#endif
+}
- if (failed_filename == NULL || strcmp(failed_filename, filename) != 0)
- memset(failed_lines, 0, sizeof(failed_lines));
- failed_filename = filename;
+static void
+logprintf(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vlogprintf(fmt, ap);
+ va_end(ap);
+}
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == line) {
- count = failed_lines[i].count;
- failed_lines[i].count++;
- return (count);
- }
- if (failed_lines[i].line == 0) {
- failed_lines[i].line = line;
- failed_lines[i].count = 1;
- return (0);
- }
- }
- return (0);
+/* Set up a message to display only if next assertion fails. */
+static char msgbuff[4096];
+static const char *msg, *nextmsg;
+void
+failure(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vsprintf(msgbuff, fmt, ap);
+ va_end(ap);
+ nextmsg = msgbuff;
}
/*
* Copy arguments into file-local variables.
+ * This was added to permit vararg assert() functions without needing
+ * variadic wrapper macros. Turns out that the vararg capability is almost
+ * never used, so almost all of the vararg assertions can be simplified
+ * by removing the vararg capability and reworking the wrapper macro to
+ * pass __FILE__, __LINE__ directly into the function instead of using
+ * this hook. I suspect this machinery is used so rarely that we
+ * would be better off just removing it entirely. That would simplify
+ * the code here noticably.
*/
static const char *test_filename;
static int test_line;
static void *test_extra;
-void test_setup(const char *filename, int line)
+void assertion_setup(const char *filename, int line)
{
test_filename = filename;
test_line = line;
}
+/* Called at the beginning of each assert() function. */
+static void
+assertion_count(const char *file, int line)
+{
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ ++assertions;
+ /* Proper handling of "failure()" message. */
+ msg = nextmsg;
+ nextmsg = NULL;
+ /* Uncomment to print file:line after every assertion.
+ * Verbose, but occasionally useful in tracking down crashes. */
+ /* printf("Checked %s:%d\n", file, line); */
+}
+
/*
- * Inform user that we're skipping a test.
+ * For each test source file, we remember how many times each
+ * assertion was reported. Cleared before each new test,
+ * used by test_summarize().
*/
-void
-test_skipping(const char *fmt, ...)
+static struct line {
+ int count;
+ int skip;
+} failed_lines[10000];
+
+/* Count this failure, setup up log destination and handle initial report. */
+static void
+failure_start(const char *filename, int line, const char *fmt, ...)
{
va_list ap;
- if (previous_failures(test_filename, test_line))
- return;
+ /* Record another failure for this line. */
+ ++failures;
+ /* test_filename = filename; */
+ failed_lines[line].count++;
+
+ /* Determine whether to log header to console. */
+ switch (verbosity) {
+ case VERBOSITY_FULL:
+ log_console = 1;
+ break;
+ case VERBOSITY_LIGHT_REPORT:
+ log_console = (failed_lines[line].count < 2);
+ break;
+ default:
+ log_console = 0;
+ }
+ /* Log file:line header for this failure */
va_start(ap, fmt);
- fprintf(stderr, " *** SKIPPING: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
+#if _MSC_VER
+ logprintf("%s(%d): ", filename, line);
+#else
+ logprintf("%s:%d: ", filename, line);
+#endif
+ vlogprintf(fmt, ap);
va_end(ap);
- ++skips;
+ logprintf("\n");
+
+ if (msg != NULL && msg[0] != '\0') {
+ logprintf(" Description: %s\n", msg);
+ msg = NULL;
+ }
+
+ /* Determine whether to log details to console. */
+ if (verbosity == VERBOSITY_LIGHT_REPORT)
+ log_console = 0;
}
-/* Common handling of failed tests. */
+/* Complete reporting of failed tests. */
+/*
+ * The 'extra' hook here is used by libarchive to include libarchive
+ * error messages with assertion failures. It could also be used
+ * to add strerror() output, for example. Just define the EXTRA_DUMP()
+ * macro appropriately.
+ */
static void
-report_failure(void *extra)
+failure_finish(void *extra)
{
- if (msg[0] != '\0') {
- fprintf(stderr, " Description: %s\n", msg);
- msg[0] = '\0';
- }
-
+ (void)extra; /* UNUSED (maybe) */
#ifdef EXTRA_DUMP
if (extra != NULL)
- fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra));
-#else
- (void)extra; /* UNUSED */
+ logprintf(" detail: %s\n", EXTRA_DUMP(extra));
#endif
if (dump_on_failure) {
@@ -190,203 +356,154 @@ report_failure(void *extra)
}
}
-/*
- * Summarize repeated failures in the just-completed test file.
- * The reports above suppress multiple failures from the same source
- * line; this reports on any tests that did fail multiple times.
- */
-static int
-summarize_comparator(const void *a0, const void *b0)
-{
- const struct line *a = a0, *b = b0;
- if (a->line == 0 && b->line == 0)
- return (0);
- if (a->line == 0)
- return (1);
- if (b->line == 0)
- return (-1);
- return (a->line - b->line);
-}
-
-static void
-summarize(void)
-{
- unsigned int i;
-
- qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]),
- sizeof(failed_lines[0]), summarize_comparator);
- for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
- if (failed_lines[i].line == 0)
- break;
- if (failed_lines[i].count > 1)
- fprintf(stderr, "%s:%d: Failed %d times\n",
- failed_filename, failed_lines[i].line,
- failed_lines[i].count);
- }
- /* Clear the failure history for the next file. */
- memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/* Set up a message to display only after a test fails. */
+/* Inform user that we're skipping some checks. */
void
-failure(const char *fmt, ...)
+test_skipping(const char *fmt, ...)
{
+ char buff[1024];
va_list ap;
+
va_start(ap, fmt);
- vsprintf(msg, fmt, ap);
+ vsprintf(buff, fmt, ap);
va_end(ap);
+ /* failure_start() isn't quite right, but is awfully convenient. */
+ failure_start(test_filename, test_line, "SKIPPING: %s", buff);
+ --failures; /* Undo failures++ in failure_start() */
+ /* Don't failure_finish() here. */
+ /* Mark as skip, so doesn't count as failed test. */
+ failed_lines[test_line].skip = 1;
+ ++skips;
}
+/*
+ *
+ * ASSERTIONS
+ *
+ */
+
/* Generic assert() just displays the failed condition. */
int
-test_assert(const char *file, int line, int value, const char *condition, void *extra)
+assertion_assert(const char *file, int line, int value,
+ const char *condition, void *extra)
{
- ++assertions;
- if (value) {
- msg[0] = '\0';
- return (value);
+ assertion_count(file, line);
+ if (!value) {
+ failure_start(file, line, "Assertion failed: %s", condition);
+ failure_finish(extra);
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (value);
- fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
- fprintf(stderr, " Condition: %s\n", condition);
- report_failure(extra);
return (value);
}
-/* assertEqualInt() displays the values of the two integers. */
+/* chdir() and report any errors */
int
-test_assert_equal_int(const char *file, int line,
- int v1, const char *e1, int v2, const char *e2, void *extra)
+assertion_chdir(const char *file, int line, const char *pathname)
{
- ++assertions;
- if (v1 == v2) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (chdir(pathname) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
- file, line);
- fprintf(stderr, " %s=%d\n", e1, v1);
- fprintf(stderr, " %s=%d\n", e2, v2);
- report_failure(extra);
+ failure_start(file, line, "chdir(\"%s\")", pathname);
+ failure_finish(NULL);
return (0);
+
}
-static void strdump(const char *p)
+/* Verify two integers are equal. */
+int
+assertion_equal_int(const char *file, int line,
+ long long v1, const char *e1, long long v2, const char *e2, void *extra)
{
+ assertion_count(file, line);
+ if (v1 == v2)
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
+ failure_finish(extra);
+ return (0);
+}
+
+static void strdump(const char *e, const char *p)
+{
+ const char *q = p;
+
+ logprintf(" %s = ", e);
if (p == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("NULL");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*p != '\0') {
unsigned int c = 0xff & *p++;
switch (c) {
- case '\a': fprintf(stderr, "\a"); break;
- case '\b': fprintf(stderr, "\b"); break;
- case '\n': fprintf(stderr, "\n"); break;
- case '\r': fprintf(stderr, "\r"); break;
+ case '\a': printf("\a"); break;
+ case '\b': printf("\b"); break;
+ case '\n': printf("\n"); break;
+ case '\r': printf("\r"); break;
default:
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
}
}
- fprintf(stderr, "\"");
+ logprintf("\"");
+ logprintf(" (length %d)\n", q == NULL ? -1 : (int)strlen(q));
}
-/* assertEqualString() displays the values of the two strings. */
+/* Verify two strings are equal, dump them if not. */
int
-test_assert_equal_string(const char *file, int line,
+assertion_equal_string(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (strcmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- strdump(v1);
- fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1));
- fprintf(stderr, " %s = ", e2);
- strdump(v2);
- fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2));
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ strdump(e1, v1);
+ strdump(e2, v2);
+ failure_finish(extra);
return (0);
}
-static void wcsdump(const wchar_t *w)
+static void
+wcsdump(const char *e, const wchar_t *w)
{
+ logprintf(" %s = ", e);
if (w == NULL) {
- fprintf(stderr, "(null)");
+ logprintf("(null)");
return;
}
- fprintf(stderr, "\"");
+ logprintf("\"");
while (*w != L'\0') {
unsigned int c = *w++;
if (c >= 32 && c < 127)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else if (c < 256)
- fprintf(stderr, "\\x%02X", c);
+ logprintf("\\x%02X", c);
else if (c < 0x10000)
- fprintf(stderr, "\\u%04X", c);
+ logprintf("\\u%04X", c);
else
- fprintf(stderr, "\\U%08X", c);
+ logprintf("\\U%08X", c);
}
- fprintf(stderr, "\"");
+ logprintf("\"\n");
}
-/* assertEqualWString() displays the values of the two strings. */
+/* Verify that two wide strings are equal, dump them if not. */
int
-test_assert_equal_wstring(const char *file, int line,
+assertion_equal_wstring(const char *file, int line,
const wchar_t *v1, const char *e1,
const wchar_t *v2, const char *e2,
void *extra)
{
- ++assertions;
- if (v1 == NULL) {
- if (v2 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (v2 == NULL) {
- if (v1 == NULL) {
- msg[0] = '\0';
- return (1);
- }
- } else if (wcscmp(v1, v2) == 0) {
- msg[0] = '\0';
+ assertion_count(file, line);
+ if (v1 == v2 || wcscmp(v1, v2) == 0)
return (1);
- }
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
- file, line);
- fprintf(stderr, " %s = ", e1);
- wcsdump(v1);
- fprintf(stderr, "\n");
- fprintf(stderr, " %s = ", e2);
- wcsdump(v2);
- fprintf(stderr, "\n");
- report_failure(extra);
+ failure_start(file, line, "%s != %s", e1, e2);
+ wcsdump(e1, v1);
+ wcsdump(e2, v2);
+ failure_finish(extra);
return (0);
}
@@ -401,226 +518,1051 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset)
size_t i, j;
char sep;
+ if (p == NULL) {
+ logprintf("(null)\n");
+ return;
+ }
for(i=0; i < l; i+=16) {
- fprintf(stderr, "%04x", i + offset);
+ logprintf("%04x", (unsigned)(i + offset));
sep = ' ';
for (j = 0; j < 16 && i + j < l; j++) {
if (ref != NULL && p[i + j] != ref[i + j])
sep = '_';
- fprintf(stderr, "%c%02x", sep, 0xff & (int)p[i+j]);
+ logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
if (ref != NULL && p[i + j] == ref[i + j])
sep = ' ';
}
for (; j < 16; j++) {
- fprintf(stderr, "%c ", sep);
+ logprintf("%c ", sep);
sep = ' ';
}
- fprintf(stderr, "%c", sep);
+ logprintf("%c", sep);
for (j=0; j < 16 && i + j < l; j++) {
int c = p[i + j];
if (c >= ' ' && c <= 126)
- fprintf(stderr, "%c", c);
+ logprintf("%c", c);
else
- fprintf(stderr, ".");
+ logprintf(".");
}
- fprintf(stderr, "\n");
+ logprintf("\n");
}
}
-/* assertEqualMem() displays the values of the two memory blocks. */
-/* TODO: For long blocks, hexdump the first bytes that actually differ. */
+/* Verify that two blocks of memory are the same, display the first
+ * block of differences if they're not. */
int
-test_assert_equal_mem(const char *file, int line,
- const char *v1, const char *e1,
- const char *v2, const char *e2,
+assertion_equal_mem(const char *file, int line,
+ const void *_v1, const char *e1,
+ const void *_v2, const char *e2,
size_t l, const char *ld, void *extra)
{
- ++assertions;
- if (v1 == NULL || v2 == NULL) {
- if (v1 == v2) {
- msg[0] = '\0';
- return (1);
- }
- } else if (memcmp(v1, v2, l) == 0) {
- msg[0] = '\0';
+ const char *v1 = (const char *)_v1;
+ const char *v2 = (const char *)_v2;
+ size_t offset;
+
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
return (1);
+
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" size %s = %d\n", ld, (int)l);
+ /* Dump 48 bytes (3 lines) so that the first difference is
+ * in the second line. */
+ offset = 0;
+ while (l > 64 && memcmp(v1, v2, 32) == 0) {
+ /* Two lines agree, so step forward one line. */
+ v1 += 16;
+ v2 += 16;
+ l -= 16;
+ offset += 16;
}
- failures ++;
- if (!verbose && previous_failures(file, line))
- return (0);
- fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
- file, line);
- fprintf(stderr, " size %s = %d\n", ld, (int)l);
- fprintf(stderr, " Dump of %s\n", e1);
- hexdump(v1, v2, l < 32 ? l : 32, 0);
- fprintf(stderr, " Dump of %s\n", e2);
- hexdump(v2, v1, l < 32 ? l : 32, 0);
- fprintf(stderr, "\n");
- report_failure(extra);
+ logprintf(" Dump of %s\n", e1);
+ hexdump(v1, v2, l < 64 ? l : 64, offset);
+ logprintf(" Dump of %s\n", e2);
+ hexdump(v2, v1, l < 64 ? l : 64, offset);
+ logprintf("\n");
+ failure_finish(extra);
return (0);
}
+/* Verify that the named file exists and is empty. */
int
-test_assert_empty_file(const char *f1fmt, ...)
+assertion_empty_file(const char *f1fmt, ...)
{
char buff[1024];
char f1[1024];
struct stat st;
va_list ap;
ssize_t s;
- int fd;
-
+ FILE *f;
+ assertion_count(test_filename, test_line);
va_start(ap, f1fmt);
vsprintf(f1, f1fmt, ap);
va_end(ap);
if (stat(f1, &st) != 0) {
- fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
- report_failure(NULL);
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
return (0);
}
if (st.st_size == 0)
return (1);
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
-
- fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
- fprintf(stderr, " File size: %d\n", (int)st.st_size);
- fprintf(stderr, " Contents:\n");
- fd = open(f1, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, " Unable to open %s\n", f1);
+ failure_start(test_filename, test_line, "File should be empty: %s", f1);
+ logprintf(" File size: %d\n", (int)st.st_size);
+ logprintf(" Contents:\n");
+ f = fopen(f1, "rb");
+ if (f == NULL) {
+ logprintf(" Unable to open %s\n", f1);
} else {
- s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
- s = read(fd, buff, s);
+ s = ((off_t)sizeof(buff) < st.st_size) ?
+ (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
+ s = fread(buff, 1, s, f);
hexdump(buff, NULL, s, 0);
+ fclose(f);
}
- report_failure(NULL);
+ failure_finish(NULL);
return (0);
}
-/* assertEqualFile() asserts that two files have the same contents. */
+/* Verify that the named file exists and is not empty. */
+int
+assertion_non_empty_file(const char *f1fmt, ...)
+{
+ char f1[1024];
+ struct stat st;
+ va_list ap;
+
+ assertion_count(test_filename, test_line);
+ va_start(ap, f1fmt);
+ vsprintf(f1, f1fmt, ap);
+ va_end(ap);
+
+ if (stat(f1, &st) != 0) {
+ failure_start(test_filename, test_line, "Stat failed: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (st.st_size == 0) {
+ failure_start(test_filename, test_line, "File empty: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify that two files have the same contents. */
/* TODO: hexdump the first bytes that actually differ. */
int
-test_assert_equal_file(const char *f1, const char *f2pattern, ...)
+assertion_equal_file(const char *fn1, const char *f2pattern, ...)
{
- char f2[1024];
+ char fn2[1024];
va_list ap;
char buff1[1024];
char buff2[1024];
- int fd1, fd2;
+ FILE *f1, *f2;
int n1, n2;
+ assertion_count(test_filename, test_line);
va_start(ap, f2pattern);
- vsprintf(f2, f2pattern, ap);
+ vsprintf(fn2, f2pattern, ap);
va_end(ap);
- fd1 = open(f1, O_RDONLY);
- fd2 = open(f2, O_RDONLY);
+ f1 = fopen(fn1, "rb");
+ f2 = fopen(fn2, "rb");
for (;;) {
- n1 = read(fd1, buff1, sizeof(buff1));
- n2 = read(fd2, buff2, sizeof(buff2));
+ n1 = fread(buff1, 1, sizeof(buff1), f1);
+ n2 = fread(buff2, 1, sizeof(buff2), f2);
if (n1 != n2)
break;
- if (n1 == 0 && n2 == 0)
+ if (n1 == 0 && n2 == 0) {
+ fclose(f1);
+ fclose(f2);
return (1);
+ }
if (memcmp(buff1, buff2, n1) != 0)
break;
}
- failures ++;
- if (!verbose && previous_failures(test_filename, test_line))
- return (0);
- fprintf(stderr, "%s:%d: Files are not identical\n",
- test_filename, test_line);
- fprintf(stderr, " file1=\"%s\"\n", f1);
- fprintf(stderr, " file2=\"%s\"\n", f2);
- report_failure(test_extra);
+ fclose(f1);
+ fclose(f2);
+ failure_start(test_filename, test_line, "Files not identical");
+ logprintf(" file1=\"%s\"\n", fn1);
+ logprintf(" file2=\"%s\"\n", fn2);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file does exist. */
int
-test_assert_file_exists(const char *fpattern, ...)
+assertion_file_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!_access(f, 0))
+ return (1);
+#else
if (!access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File doesn't exist\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
+/* Verify that the named file doesn't exist. */
int
-test_assert_file_not_exists(const char *fpattern, ...)
+assertion_file_not_exists(const char *fpattern, ...)
{
char f[1024];
va_list ap;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (_access(f, 0))
+ return (1);
+#else
if (access(f, F_OK))
return (1);
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File exists and shouldn't\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- report_failure(test_extra);
- }
+#endif
+ failure_start(test_filename, test_line, "File should not exist: %s", f);
+ failure_finish(test_extra);
return (0);
}
-/* assertFileContents() asserts the contents of a file. */
+/* Compare the contents of a file to a block of memory. */
int
-test_assert_file_contents(const void *buff, int s, const char *fpattern, ...)
+assertion_file_contents(const void *buff, int s, const char *fpattern, ...)
{
- char f[1024];
+ char fn[1024];
va_list ap;
char *contents;
- int fd;
+ FILE *f;
int n;
+ assertion_count(test_filename, test_line);
va_start(ap, fpattern);
- vsprintf(f, fpattern, ap);
+ vsprintf(fn, fpattern, ap);
va_end(ap);
- fd = open(f, O_RDONLY);
+ f = fopen(fn, "rb");
+ if (f == NULL) {
+ failure_start(test_filename, test_line,
+ "File should exist: %s", fn);
+ failure_finish(test_extra);
+ return (0);
+ }
contents = malloc(s * 2);
- n = read(fd, contents, s * 2);
+ n = fread(contents, 1, s * 2, f);
+ fclose(f);
if (n == s && memcmp(buff, contents, s) == 0) {
free(contents);
return (1);
}
- failures ++;
- if (!previous_failures(test_filename, test_line)) {
- fprintf(stderr, "%s:%d: File contents don't match\n",
- test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
- if (n > 0)
- hexdump(contents, buff, n, 0);
- else {
- fprintf(stderr, " File empty, contents should be:\n");
- hexdump(buff, NULL, s, 0);
+ failure_start(test_filename, test_line, "File contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n > 512 ? 512 : n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s > 512 ? 512 : s, 0);
+ }
+ failure_finish(test_extra);
+ free(contents);
+ return (0);
+}
+
+/* Check the contents of a text file, being tolerant of line endings. */
+int
+assertion_text_file_contents(const char *buff, const char *fn)
+{
+ char *contents;
+ const char *btxt, *ftxt;
+ FILE *f;
+ int n, s;
+
+ assertion_count(test_filename, test_line);
+ f = fopen(fn, "r");
+ s = strlen(buff);
+ contents = malloc(s * 2 + 128);
+ n = fread(contents, 1, s * 2 + 128 - 1, f);
+ if (n >= 0)
+ contents[n] = '\0';
+ fclose(f);
+ /* Compare texts. */
+ btxt = buff;
+ ftxt = (const char *)contents;
+ while (*btxt != '\0' && *ftxt != '\0') {
+ if (*btxt == *ftxt) {
+ ++btxt;
+ ++ftxt;
+ continue;
}
- report_failure(test_extra);
+ if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
+ /* Pass over different new line characters. */
+ ++btxt;
+ ftxt += 2;
+ continue;
+ }
+ break;
+ }
+ if (*btxt == '\0' && *ftxt == '\0') {
+ free(contents);
+ return (1);
+ }
+ failure_start(test_filename, test_line, "Contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s, 0);
}
+ failure_finish(test_extra);
free(contents);
return (0);
}
+/* Verify that a text file contains the specified lines, regardless of order */
+/* This could be more efficient if we sorted both sets of lines, etc, but
+ * since this is used only for testing and only ever deals with a dozen or so
+ * lines at a time, this relatively crude approach is just fine. */
+int
+assertion_file_contains_lines_any_order(const char *file, int line,
+ const char *pathname, const char *lines[])
+{
+ char *buff;
+ size_t buff_size;
+ size_t expected_count, actual_count, i, j;
+ char **expected;
+ char *p, **actual;
+ char c;
+ int expected_failure = 0, actual_failure = 0;
+
+ assertion_count(file, line);
+
+ buff = slurpfile(&buff_size, "%s", pathname);
+ if (buff == NULL) {
+ failure_start(pathname, line, "Can't read file: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+
+ // Make a copy of the provided lines and count up the expected file size.
+ expected_count = 0;
+ for (i = 0; lines[i] != NULL; ++i) {
+ }
+ expected_count = i;
+ expected = malloc(sizeof(char *) * expected_count);
+ for (i = 0; lines[i] != NULL; ++i) {
+ expected[i] = strdup(lines[i]);
+ }
+
+ // Break the file into lines
+ actual_count = 0;
+ for (c = '\0', p = buff; p < buff + buff_size; ++p) {
+ if (*p == '\x0d' || *p == '\x0a')
+ *p = '\0';
+ if (c == '\0' && *p != '\0')
+ ++actual_count;
+ c = *p;
+ }
+ actual = malloc(sizeof(char *) * actual_count);
+ for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) {
+ if (*p != '\0') {
+ actual[j] = p;
+ ++j;
+ }
+ }
+
+ // Erase matching lines from both lists
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] == NULL)
+ continue;
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] == NULL)
+ continue;
+ if (strcmp(expected[i], actual[j]) == 0) {
+ free(expected[i]);
+ expected[i] = NULL;
+ actual[j] = NULL;
+ break;
+ }
+ }
+ }
+
+ // If there's anything left, it's a failure
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] != NULL)
+ ++expected_failure;
+ }
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] != NULL)
+ ++actual_failure;
+ }
+ if (expected_failure == 0 && actual_failure == 0) {
+ free(buff);
+ free(expected);
+ free(actual);
+ return (1);
+ }
+ failure_start(file, line, "File doesn't match: %s", pathname);
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] != NULL) {
+ logprintf(" Expected but not present: %s\n", expected[i]);
+ free(expected[i]);
+ }
+ }
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] != NULL)
+ logprintf(" Present but not expected: %s\n", actual[j]);
+ }
+ failure_finish(NULL);
+ free(buff);
+ free(expected);
+ free(actual);
+ return (0);
+}
+
+/* Test that two paths point to the same file. */
+/* As a side-effect, asserts that both files exist. */
+static int
+is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(path1, &bhfi1);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = my_GetFileInformationByName(path2, &bhfi2);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
+ && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
+ && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
+#else
+ struct stat st1, st2;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(path1, &st1);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = lstat(path2, &st2);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
+#endif
+}
+
+int
+assertion_is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s are not hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+int
+assertion_is_not_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (!is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s should not be hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify a/b/mtime of 'pathname'. */
+/* If 'recent', verify that it's within last 10 seconds. */
+static int
+assertion_file_time(const char *file, int line,
+ const char *pathname, long t, long nsec, char type, int recent)
+{
+ long long filet, filet_nsec;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define EPOC_TIME (116444736000000000ULL)
+ FILETIME ftime, fbirthtime, fatime, fmtime;
+ ULARGE_INTEGER wintm;
+ HANDLE h;
+ ftime.dwLowDateTime = 0;
+ ftime.dwHighDateTime = 0;
+
+ assertion_count(file, line);
+ h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ failure_start(file, line, "Can't access %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
+ switch (type) {
+ case 'a': ftime = fatime; break;
+ case 'b': ftime = fbirthtime; break;
+ case 'm': ftime = fmtime; break;
+ }
+ CloseHandle(h);
+ if (r == 0) {
+ failure_start(file, line, "Can't GetFileTime %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ wintm.LowPart = ftime.dwLowDateTime;
+ wintm.HighPart = ftime.dwHighDateTime;
+ filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
+ filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
+ nsec = (nsec / 100) * 100; /* Round the request */
+#else
+ struct stat st;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Can't stat %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ switch (type) {
+ case 'a': filet = st.st_atime; break;
+ case 'm': filet = st.st_mtime; break;
+ case 'b': filet = 0; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+#if defined(__FreeBSD__)
+ switch (type) {
+ case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
+ case 'b': filet = st.st_birthtime;
+ filet_nsec = st.st_birthtimespec.tv_nsec; break;
+ case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ filet_nsec = (filet_nsec / 1000) * 1000;
+ nsec = (nsec / 1000) * 1000;
+#else
+ filet_nsec = nsec = 0; /* Generic POSIX only has whole seconds. */
+ if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
+#if defined(__HAIKU__)
+ if (type == 'a') return (1); /* Haiku doesn't have atime. */
+#endif
+#endif
+#endif
+ if (recent) {
+ /* Check that requested time is up-to-date. */
+ time_t now = time(NULL);
+ if (filet < now - 10 || filet > now + 1) {
+ failure_start(file, line,
+ "File %s has %ctime %ld, %ld seconds ago\n",
+ pathname, type, filet, now - filet);
+ failure_finish(NULL);
+ return (0);
+ }
+ } else if (filet != t || filet_nsec != nsec) {
+ failure_start(file, line,
+ "File %s has %ctime %ld.%09ld, expected %ld.%09ld",
+ pathname, type, filet, filet_nsec, t, nsec);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify atime of 'pathname'. */
+int
+assertion_file_atime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
+}
+
+/* Verify atime of 'pathname' is up-to-date. */
+int
+assertion_file_atime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
+}
+
+/* Verify birthtime of 'pathname'. */
+int
+assertion_file_birthtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
+}
+
+/* Verify birthtime of 'pathname' is up-to-date. */
+int
+assertion_file_birthtime_recent(const char *file, int line,
+ const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
+}
+
+/* Verify mtime of 'pathname'. */
+int
+assertion_file_mtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
+}
+
+/* Verify mtime of 'pathname' is up-to-date. */
+int
+assertion_file_mtime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
+}
+
+/* Verify number of links to 'pathname'. */
+int
+assertion_file_nlinks(const char *file, int line,
+ const char *pathname, int nlinks)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(pathname, &bhfi);
+ if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, bhfi.nNumberOfLinks, nlinks);
+ failure_finish(NULL);
+ return (0);
+#else
+ struct stat st;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && st.st_nlink == nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, st.st_nlink, nlinks);
+ failure_finish(NULL);
+ return (0);
+#endif
+}
+
+/* Verify size of 'pathname'. */
+int
+assertion_file_size(const char *file, int line, const char *pathname, long size)
+{
+ int64_t filesize;
+ int r;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ {
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ r = !my_GetFileInformationByName(pathname, &bhfi);
+ filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
+ }
+#else
+ {
+ struct stat st;
+ r = lstat(pathname, &st);
+ filesize = st.st_size;
+ }
+#endif
+ if (r == 0 && filesize == size)
+ return (1);
+ failure_start(file, line, "File %s has size %ld, expected %ld",
+ pathname, (long)filesize, (long)size);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
+int
+assertion_is_dir(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Dir should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ failure_start(file, line, "%s is not a dir", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "Dir %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Verify that 'pathname' is a regular file. If 'mode' is >= 0,
+ * verify that too. */
+int
+assertion_is_reg(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0 || !S_ISREG(st.st_mode)) {
+ failure_start(file, line, "File should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "File %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Check whether 'pathname' is a symbolic link. If 'contents' is
+ * non-NULL, verify that the symlink has those contents. */
+static int
+is_symlink(const char *file, int line,
+ const char *pathname, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)pathname; /* UNUSED */
+ (void)contents; /* UNUSED */
+ assertion_count(file, line);
+ /* Windows sort-of has real symlinks, but they're only usable
+ * by privileged users and are crippled even then, so there's
+ * really not much point in bothering with this. */
+ return (0);
+#else
+ char buff[300];
+ struct stat st;
+ ssize_t linklen;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line,
+ "Symlink should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISLNK(st.st_mode))
+ return (0);
+ if (contents == NULL)
+ return (1);
+ linklen = readlink(pathname, buff, sizeof(buff));
+ if (linklen < 0) {
+ failure_start(file, line, "Can't read symlink %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ buff[linklen] = '\0';
+ if (strcmp(buff, contents) != 0)
+ return (0);
+ return (1);
+#endif
+}
+
+/* Assert that path is a symlink that (optionally) contains contents. */
+int
+assertion_is_symlink(const char *file, int line,
+ const char *path, const char *contents)
+{
+ if (is_symlink(file, line, path, contents))
+ return (1);
+ if (contents)
+ failure_start(file, line, "File %s is not a symlink to %s",
+ path, contents);
+ else
+ failure_start(file, line, "File %s is not a symlink", path);
+ failure_finish(NULL);
+ return (0);
+}
+
+
+/* Create a directory and report any errors. */
+int
+assertion_make_dir(const char *file, int line, const char *dirname, int mode)
+{
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+ if (0 == _mkdir(dirname))
+ return (1);
+#else
+ if (0 == mkdir(dirname, mode))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create directory %s", dirname);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a file with the specified contents and report any failures. */
+int
+assertion_make_file(const char *file, int line,
+ const char *path, int mode, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* TODO: Rework this to set file mode as well. */
+ FILE *f;
+ (void)mode; /* UNUSED */
+ assertion_count(file, line);
+ f = fopen(path, "wb");
+ if (f == NULL) {
+ failure_start(file, line, "Could not create file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if (strlen(contents)
+ != fwrite(contents, 1, strlen(contents), f)) {
+ fclose(f);
+ failure_start(file, line,
+ "Could not write file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ fclose(f);
+ return (1);
+#else
+ int fd;
+ assertion_count(file, line);
+ fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
+ if (fd < 0) {
+ failure_start(file, line, "Could not create %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ if ((ssize_t)strlen(contents)
+ != write(fd, contents, strlen(contents))) {
+ close(fd);
+ failure_start(file, line, "Could not write to %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ close(fd);
+ return (1);
+#endif
+}
+
+/* Create a hardlink and report any failures. */
+int
+assertion_make_hardlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ succeeded = my_CreateHardLinkA(newpath, linkto);
+#elif HAVE_LINK
+ succeeded = !link(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded)
+ return (1);
+ failure_start(file, line, "Could not create hardlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a symlink and report any failures. */
+int
+assertion_make_symlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ int targetIsDir = 0; /* TODO: Fix this */
+ assertion_count(file, line);
+ if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
+ return (1);
+#elif HAVE_SYMLINK
+ assertion_count(file, line);
+ if (0 == symlink(linkto, newpath))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create symlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Set umask, report failures. */
+int
+assertion_umask(const char *file, int line, int mask)
+{
+ assertion_count(file, line);
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ umask(mask);
+ return (1);
+}
+
+/*
+ *
+ * UTILITIES for use by tests.
+ *
+ */
+
+/*
+ * Check whether platform supports symlinks. This is intended
+ * for tests to use in deciding whether to bother testing symlink
+ * support; if the platform doesn't support symlinks, there's no point
+ * in checking whether the program being tested can create them.
+ *
+ * Note that the first time this test is called, we actually go out to
+ * disk to create and verify a symlink. This is necessary because
+ * symlink support is actually a property of a particular filesystem
+ * and can thus vary between directories on a single system. After
+ * the first call, this returns the cached result from memory, so it's
+ * safe to call it as often as you wish.
+ */
+int
+canSymlink(void)
+{
+ /* Remember the test result */
+ static int value = 0, tested = 0;
+ if (tested)
+ return (value);
+
+ ++tested;
+ assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, "a");
+ /* Note: Cygwin has its own symlink() emulation that does not
+ * use the Win32 CreateSymbolicLink() function. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
+#elif HAVE_SYMLINK
+ value = (0 == symlink("canSymlink.0", "canSymlink.1"))
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
+#endif
+ return (value);
+}
+
+/*
+ * Can this platform run the gzip program?
+ */
+/* Platform-dependent options for hiding the output of a subcommand. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
+#else
+static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
+#endif
+int
+canGzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the gunzip program?
+ */
+int
+canGunzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gunzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Sleep as needed; useful for verifying disk timestamp changes by
+ * ensuring that the wall-clock time has actually changed before we
+ * go back to re-read something from disk.
+ */
+void
+sleepUntilAfter(time_t t)
+{
+ while (t >= time(NULL))
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ Sleep(500);
+#else
+ sleep(1);
+#endif
+}
+
/*
* Call standard system() call, but build up the command line using
* sprintf() conventions.
@@ -634,6 +1576,8 @@ systemf(const char *fmt, ...)
va_start(ap, fmt);
vsprintf(buff, fmt, ap);
+ if (verbosity > VERBOSITY_FULL)
+ logprintf("Cmd: %s\n", buff);
r = system(buff);
va_end(ap);
return (r);
@@ -652,112 +1596,263 @@ slurpfile(size_t * sizep, const char *fmt, ...)
va_list ap;
char *p;
ssize_t bytes_read;
- int fd;
+ FILE *f;
int r;
va_start(ap, fmt);
vsprintf(filename, fmt, ap);
va_end(ap);
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
+ f = fopen(filename, "rb");
+ if (f == NULL) {
/* Note: No error; non-existent file is okay here. */
return (NULL);
}
- r = fstat(fd, &st);
+ r = fstat(fileno(f), &st);
if (r != 0) {
- fprintf(stderr, "Can't stat file %s\n", filename);
- close(fd);
+ logprintf("Can't stat file %s\n", filename);
+ fclose(f);
return (NULL);
}
- p = malloc(st.st_size + 1);
+ p = malloc((size_t)st.st_size + 1);
if (p == NULL) {
- fprintf(stderr, "Can't allocate %ld bytes of memory to read file %s\n", (long int)st.st_size, filename);
- close(fd);
+ logprintf("Can't allocate %ld bytes of memory to read file %s\n",
+ (long int)st.st_size, filename);
+ fclose(f);
return (NULL);
}
- bytes_read = read(fd, p, st.st_size);
+ bytes_read = fread(p, 1, (size_t)st.st_size, f);
if (bytes_read < st.st_size) {
- fprintf(stderr, "Can't read file %s\n", filename);
- close(fd);
+ logprintf("Can't read file %s\n", filename);
+ fclose(f);
free(p);
return (NULL);
}
p[st.st_size] = '\0';
if (sizep != NULL)
*sizep = (size_t)st.st_size;
- close(fd);
+ fclose(f);
return (p);
}
+/* Read a uuencoded file from the reference directory, decode, and
+ * write the result into the current directory. */
+#define UUDECODE(c) (((c) - 0x20) & 0x3f)
+void
+extract_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+
+ sprintf(buff, "%s/%s.uu", refdir, name);
+ in = fopen(buff, "r");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Read up to and including the 'begin' line. */
+ for (;;) {
+ if (fgets(buff, sizeof(buff), in) == NULL) {
+ /* TODO: This is a failure. */
+ return;
+ }
+ if (memcmp(buff, "begin ", 6) == 0)
+ break;
+ }
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while (fgets(buff, sizeof(buff), in) != NULL) {
+ char *p = buff;
+ int bytes;
+
+ if (memcmp(buff, "end", 3) == 0)
+ break;
+
+ bytes = UUDECODE(*p++);
+ while (bytes > 0) {
+ int n = 0;
+ /* Write out 1-3 bytes from that. */
+ if (bytes > 0) {
+ n = UUDECODE(*p++) << 18;
+ n |= UUDECODE(*p++) << 12;
+ fputc(n >> 16, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++) << 6;
+ fputc((n >> 8) & 0xFF, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ n |= UUDECODE(*p++);
+ fputc(n & 0xFF, out);
+ --bytes;
+ }
+ }
+ }
+ fclose(out);
+ fclose(in);
+}
+
/*
- * "list.h" is automatically generated; it just has a lot of lines like:
- * DEFINE_TEST(function_name)
- * It's used above to declare all of the test functions.
- * We reuse it here to define a list of all tests (functions and names).
+ *
+ * TEST management
+ *
*/
+
+/*
+ * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
+ * a line like
+ * DEFINE_TEST(test_function)
+ * for each test.
+ */
+
+/* Use "list.h" to declare all of the test functions. */
#undef DEFINE_TEST
-#define DEFINE_TEST(n) { n, #n },
-struct { void (*func)(void); const char *name; } tests[] = {
+#define DEFINE_TEST(name) void name(void);
+#include "list.h"
+
+/* Use "list.h" to create a list of all tests (functions and names). */
+#undef DEFINE_TEST
+#define DEFINE_TEST(n) { n, #n, 0 },
+struct { void (*func)(void); const char *name; int failures; } tests[] = {
#include "list.h"
};
/*
- * Each test is run in a private work dir. Those work dirs
- * do have consistent and predictable names, in case a group
- * of tests need to collaborate. However, there is no provision
- * for requiring that tests run in a certain order.
+ * Summarize repeated failures in the just-completed test.
*/
-static int test_run(int i, const char *tmpdir)
+static void
+test_summarize(const char *filename, int failed)
{
- int failures_before = failures;
+ unsigned int i;
- if (!quiet_flag) {
- printf("%d: %s\n", i, tests[i].name);
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY:
+ printf(failed ? "E" : ".");
fflush(stdout);
+ break;
+ case VERBOSITY_PASSFAIL:
+ printf(failed ? "FAIL\n" : "ok\n");
+ break;
}
- /*
- * Always explicitly chdir() in case the last test moved us to
- * a strange place.
- */
- if (chdir(tmpdir)) {
- fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir %s\n",
- tmpdir);
- exit(1);
+ log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
+
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].count > 1 && !failed_lines[i].skip)
+ logprintf("%s:%d: Summary: Failed %d times\n",
+ filename, i, failed_lines[i].count);
}
- /* Create a temp directory for this specific test. */
- if (mkdir(tests[i].name, 0755)) {
+ /* Clear the failure history for the next file. */
+ memset(failed_lines, 0, sizeof(failed_lines));
+}
+
+/*
+ * Actually run a single test, with appropriate setup and cleanup.
+ */
+static int
+test_run(int i, const char *tmpdir)
+{
+ char logfilename[64];
+ int failures_before = failures;
+ int oldumask;
+
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
+ break;
+ case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
+ printf("%3d: %-50s", i, tests[i].name);
+ fflush(stdout);
+ break;
+ default: /* Title of test, details will follow */
+ printf("%3d: %s\n", i, tests[i].name);
+ }
+
+ /* Chdir to the top-level work directory. */
+ if (!assertChdir(tmpdir)) {
fprintf(stderr,
- "ERROR: Couldn't create temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to top work dir %s\n", tmpdir);
exit(1);
}
- /* Chdir() to that work directory. */
- if (chdir(tests[i].name)) {
+ /* Create a log file for this test. */
+ sprintf(logfilename, "%s.log", tests[i].name);
+ logfile = fopen(logfilename, "w");
+ fprintf(logfile, "%s\n\n", tests[i].name);
+ /* Chdir() to a work dir for this specific test. */
+ if (!assertMakeDir(tests[i].name, 0755)
+ || !assertChdir(tests[i].name)) {
fprintf(stderr,
- "ERROR: Couldn't chdir to temp dir ``%s''\n",
- tests[i].name);
+ "ERROR: Can't chdir to work dir %s/%s\n",
+ tmpdir, tests[i].name);
exit(1);
}
/* Explicitly reset the locale before each test. */
setlocale(LC_ALL, "C");
- /* Run the actual test. */
+ /* Record the umask before we run the test. */
+ umask(oldumask = umask(0));
+ /*
+ * Run the actual test.
+ */
(*tests[i].func)();
- /* Summarize the results of this test. */
- summarize();
- /* If there were no failures, we can remove the work dir. */
- if (failures == failures_before) {
- if (!keep_temp_files && chdir(tmpdir) == 0) {
+ /*
+ * Clean up and report afterwards.
+ */
+ /* Restore umask */
+ umask(oldumask);
+ /* Reset locale. */
+ setlocale(LC_ALL, "C");
+ /* Reset directory. */
+ if (!assertChdir(tmpdir)) {
+ fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
+ tmpdir);
+ exit(1);
+ }
+ /* Report per-test summaries. */
+ tests[i].failures = failures - failures_before;
+ test_summarize(test_filename, tests[i].failures);
+ /* Close the per-test log file. */
+ fclose(logfile);
+ logfile = NULL;
+ /* If there were no failures, we can remove the work dir and logfile. */
+ if (tests[i].failures == 0) {
+ if (!keep_temp_files && assertChdir(tmpdir)) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Make sure not to leave empty directories.
+ * Sometimes a processing of closing files used by tests
+ * is not done, then rmdir will be failed and it will
+ * leave a empty test directory. So we should wait a few
+ * seconds and retry rmdir. */
+ int r, t;
+ for (t = 0; t < 10; t++) {
+ if (t > 0)
+ Sleep(1000);
+ r = systemf("rmdir /S /Q %s", tests[i].name);
+ if (r == 0)
+ break;
+ }
+ systemf("del %s", logfilename);
+#else
systemf("rm -rf %s", tests[i].name);
+ systemf("rm %s", logfilename);
+#endif
}
}
/* Return appropriate status. */
- return (failures == failures_before ? 0 : 1);
+ return (tests[i].failures);
}
-static void usage(const char *program)
+/*
+ *
+ *
+ * MAIN and support routines.
+ *
+ *
+ */
+
+static void
+usage(const char *program)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
int i;
@@ -783,92 +1878,129 @@ static void usage(const char *program)
exit(1);
}
-#define UUDECODE(c) (((c) - 0x20) & 0x3f)
-
-void
-extract_reference_file(const char *name)
+static char *
+get_refdir(const char *d)
{
- char buff[1024];
- FILE *in, *out;
+ char tried[512] = { '\0' };
+ char buff[128];
+ char *pwd, *p;
+
+ /* If a dir was specified, try that */
+ if (d != NULL) {
+ pwd = NULL;
+ snprintf(buff, sizeof(buff), "%s", d);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+ goto failure;
+ }
- sprintf(buff, "%s/%s.uu", refdir, name);
- in = fopen(buff, "r");
- failure("Couldn't open reference file %s", buff);
- assert(in != NULL);
- if (in == NULL)
- return;
- /* Read up to and including the 'begin' line. */
- for (;;) {
- if (fgets(buff, sizeof(buff), in) == NULL) {
- /* TODO: This is a failure. */
- return;
- }
- if (memcmp(buff, "begin ", 6) == 0)
- break;
+ /* Get the current dir. */
+ pwd = getcwd(NULL, 0);
+ while (pwd[strlen(pwd) - 1] == '\n')
+ pwd[strlen(pwd) - 1] = '\0';
+
+ /* Look for a known file. */
+ snprintf(buff, sizeof(buff), "%s", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+#if defined(LIBRARY)
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY);
+#else
+ snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM);
+#endif
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ if (memcmp(pwd, "/usr/obj", 8) == 0) {
+ snprintf(buff, sizeof(buff), "%s", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+ snprintf(buff, sizeof(buff), "%s/test", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+ strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
}
- /* Now, decode the rest and write it. */
- /* Not a lot of error checking here; the input better be right. */
- out = fopen(name, "w");
- while (fgets(buff, sizeof(buff), in) != NULL) {
- char *p = buff;
- int bytes;
- if (memcmp(buff, "end", 3) == 0)
- break;
+failure:
+ printf("Unable to locate known reference file %s\n", KNOWNREF);
+ printf(" Checked following directories:\n%s\n", tried);
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+ DebugBreak();
+#endif
+ exit(1);
- bytes = UUDECODE(*p++);
- while (bytes > 0) {
- int n = 0;
- /* Write out 1-3 bytes from that. */
- if (bytes > 0) {
- n = UUDECODE(*p++) << 18;
- n |= UUDECODE(*p++) << 12;
- fputc(n >> 16, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++) << 6;
- fputc((n >> 8) & 0xFF, out);
- --bytes;
- }
- if (bytes > 0) {
- n |= UUDECODE(*p++);
- fputc(n & 0xFF, out);
- --bytes;
- }
- }
- }
- fclose(out);
- fclose(in);
+success:
+ free(p);
+ free(pwd);
+ return strdup(buff);
}
-
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
static const int limit = sizeof(tests) / sizeof(tests[0]);
- int i, tests_run = 0, tests_failed = 0, opt;
+ int i, tests_run = 0, tests_failed = 0, option;
time_t now;
char *refdir_alloc = NULL;
- char *progname, *p;
+ const char *progname;
+ const char *tmp, *option_arg, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
+ (void)argc; /* UNUSED */
+
+#if defined(HAVE__CrtSetReportMode)
+ /* To stop to run the default invalid parameter handler. */
+ _set_invalid_parameter_handler(invalid_parameter_handler);
+ /* Disable annoying assertion message box. */
+ _CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
+
/*
* Name of this program, used to build root of our temp directory
* tree.
*/
progname = p = argv[0];
while (*p != '\0') {
- if (*p == '/')
+ /* Support \ or / dir separators for Windows compat. */
+ if (*p == '/' || *p == '\\')
progname = p + 1;
++p;
}
#ifdef PROGRAM
/* Get the target program from environment, if available. */
- testprog = getenv(ENVBASE);
+ testprogfile = getenv(ENVBASE);
#endif
+ if (getenv("TMPDIR") != NULL)
+ tmp = getenv("TMPDIR");
+ else if (getenv("TMP") != NULL)
+ tmp = getenv("TMP");
+ else if (getenv("TEMP") != NULL)
+ tmp = getenv("TEMP");
+ else if (getenv("TEMPDIR") != NULL)
+ tmp = getenv("TEMPDIR");
+ else
+ tmp = "/tmp";
+
/* Allow -d to be controlled through the environment. */
if (getenv(ENVBASE "_DEBUG") != NULL)
dump_on_failure = 1;
@@ -877,46 +2009,92 @@ int main(int argc, char **argv)
refdir = getenv(ENVBASE "_TEST_FILES");
/*
- * Parse options.
+ * Parse options, without using getopt(), which isn't available
+ * on all platforms.
*/
- while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) {
- switch (opt) {
- case 'd':
- dump_on_failure = 1;
- break;
- case 'k':
- keep_temp_files = 1;
+ ++argv; /* Skip program name */
+ while (*argv != NULL) {
+ if (**argv != '-')
break;
- case 'p':
+ p = *argv++;
+ ++p; /* Skip '-' */
+ while (*p != '\0') {
+ option = *p++;
+ option_arg = NULL;
+ /* If 'opt' takes an argument, parse that. */
+ if (option == 'p' || option == 'r') {
+ if (*p != '\0')
+ option_arg = p;
+ else if (*argv == NULL) {
+ fprintf(stderr,
+ "Option -%c requires argument.\n",
+ option);
+ usage(progname);
+ } else
+ option_arg = *argv++;
+ p = ""; /* End of this option word. */
+ }
+
+ /* Now, handle the option. */
+ switch (option) {
+ case 'd':
+ dump_on_failure = 1;
+ break;
+ case 'k':
+ keep_temp_files = 1;
+ break;
+ case 'p':
#ifdef PROGRAM
- testprog = optarg;
+ testprogfile = option_arg;
#else
- usage(progname);
+ fprintf(stderr, "-p option not permitted\n");
+ usage(progname);
#endif
- break;
- case 'q':
- quiet_flag++;
- break;
- case 'r':
- refdir = optarg;
- break;
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- usage(progname);
+ break;
+ case 'q':
+ verbosity--;
+ break;
+ case 'r':
+ refdir = option_arg;
+ break;
+ case 'v':
+ verbosity++;
+ break;
+ default:
+ fprintf(stderr, "Unrecognized option '%c'\n",
+ option);
+ usage(progname);
+ }
}
}
- argc -= optind;
- argv += optind;
/*
* Sanity-check that our options make sense.
*/
#ifdef PROGRAM
- if (testprog == NULL)
+ if (testprogfile == NULL) {
+ fprintf(stderr, "Program executable required\n");
usage(progname);
+ }
+
+ {
+ char *testprg;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Command.com sometimes rejects '/' separators. */
+ testprg = strdup(testprogfile);
+ for (i = 0; testprg[i] != '\0'; i++) {
+ if (testprg[i] == '/')
+ testprg[i] = '\\';
+ }
+ testprogfile = testprg;
+#endif
+ /* Quote the name that gets put into shell command lines. */
+ testprg = malloc(strlen(testprogfile) + 3);
+ strcpy(testprg, "\"");
+ strcat(testprg, testprogfile);
+ strcat(testprg, "\"");
+ testprog = testprg;
+ }
#endif
/*
@@ -925,40 +2103,37 @@ int main(int argc, char **argv)
* to make it easier to track the results of multiple tests.
*/
now = time(NULL);
- for (i = 0; i < 1000; i++) {
+ for (i = 0; ; i++) {
strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
"%Y-%m-%dT%H.%M.%S",
localtime(&now));
- sprintf(tmpdir, "/tmp/%s.%s-%03d", progname, tmpdir_timestamp, i);
- if (mkdir(tmpdir,0755) == 0)
+ sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
+ tmpdir_timestamp, i);
+ if (assertMakeDir(tmpdir,0755))
break;
- if (errno == EEXIST)
- continue;
- fprintf(stderr, "ERROR: Unable to create temp directory %s\n",
- tmpdir);
- exit(1);
+ if (i >= 999) {
+ fprintf(stderr,
+ "ERROR: Unable to create temp directory %s\n",
+ tmpdir);
+ exit(1);
+ }
}
/*
* If the user didn't specify a directory for locating
- * reference files, use the current directory for that.
+ * reference files, try to find the reference files in
+ * the "usual places."
*/
- if (refdir == NULL) {
- systemf("/bin/pwd > %s/refdir", tmpdir);
- refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
- p = refdir + strlen(refdir);
- while (p[-1] == '\n') {
- --p;
- *p = '\0';
- }
- systemf("rm %s/refdir", tmpdir);
- }
+ refdir = refdir_alloc = get_refdir(refdir);
/*
* Banner with basic information.
*/
- if (!quiet_flag) {
- printf("Running tests in: %s\n", tmpdir);
+ printf("\n");
+ printf("If tests fail or crash, details will be in:\n");
+ printf(" %s\n", tmpdir);
+ printf("\n");
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
printf("Reference files will be read from: %s\n", refdir);
#ifdef PROGRAM
printf("Running tests on: %s\n", testprog);
@@ -966,12 +2141,15 @@ int main(int argc, char **argv)
printf("Exercising: ");
fflush(stdout);
printf("%s\n", EXTRA_VERSION);
+ } else {
+ printf("Running ");
+ fflush(stdout);
}
/*
* Run some or all of the individual tests.
*/
- if (argc == 0) {
+ if (*argv == NULL) {
/* Default: Run all tests. */
for (i = 0; i < limit; i++) {
if (test_run(i, tmpdir))
@@ -980,15 +2158,30 @@ int main(int argc, char **argv)
}
} else {
while (*(argv) != NULL) {
- i = atoi(*argv);
- if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
- printf("*** INVALID Test %s\n", *argv);
- usage(progname);
+ if (**argv >= '0' && **argv <= '9') {
+ i = atoi(*argv);
+ if (i < 0 || i >= limit) {
+ printf("*** INVALID Test %s\n", *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
} else {
- if (test_run(i, tmpdir))
- tests_failed++;
- tests_run++;
+ for (i = 0; i < limit; ++i) {
+ if (strcmp(*argv, tests[i].name) == 0)
+ break;
+ }
+ if (i >= limit) {
+ printf("*** INVALID Test ``%s''\n",
+ *argv);
+ free(refdir_alloc);
+ usage(progname);
+ /* usage() never returns */
+ }
}
+ if (test_run(i, tmpdir))
+ tests_failed++;
+ tests_run++;
argv++;
}
}
@@ -996,20 +2189,38 @@ int main(int argc, char **argv)
/*
* Report summary statistics.
*/
- if (!quiet_flag) {
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
printf("\n");
- printf("%d of %d tests reported failures\n",
- tests_failed, tests_run);
- printf(" Total of %d assertions checked.\n", assertions);
- printf(" Total of %d assertions failed.\n", failures);
- printf(" Total of %d assertions skipped.\n", skips);
+ printf("Totals:\n");
+ printf(" Tests run: %8d\n", tests_run);
+ printf(" Tests failed: %8d\n", tests_failed);
+ printf(" Assertions checked:%8d\n", assertions);
+ printf(" Assertions failed: %8d\n", failures);
+ printf(" Skips reported: %8d\n", skips);
+ }
+ if (failures) {
+ printf("\n");
+ printf("Failing tests:\n");
+ for (i = 0; i < limit; ++i) {
+ if (tests[i].failures)
+ printf(" %d: %s (%d failures)\n", i,
+ tests[i].name, tests[i].failures);
+ }
+ printf("\n");
+ printf("Details for failing tests: %s\n", tmpdir);
+ printf("\n");
+ } else {
+ if (verbosity == VERBOSITY_SUMMARY_ONLY)
+ printf("\n");
+ printf("%d tests passed, no failures\n", tests_run);
}
free(refdir_alloc);
/* If the final tmpdir is empty, we can remove it. */
/* This should be the usual case when all tests succeed. */
+ assertChdir("..");
rmdir(tmpdir);
- return (tests_failed);
+ return (tests_failed ? 1 : 0);
}
diff --git a/archivers/libarchive/files/tar/test/test.h b/archivers/libarchive/files/tar/test/test.h
index 30321e845d6..54c8b8b10c9 100644
--- a/archivers/libarchive/files/tar/test/test.h
+++ b/archivers/libarchive/files/tar/test/test.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/usr.bin/tar/test/test.h,v 1.3 2008/06/15 10:07:54 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/test/test.h,v 1.4 2008/08/21 07:04:57 kientzle Exp $
*/
/* Every test program should #include "test.h" as the first thing. */
@@ -33,39 +33,95 @@
*/
#if defined(HAVE_CONFIG_H)
/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../../config.h"
+#include "config.h"
#elif defined(__FreeBSD__)
/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "../config_freebsd.h"
-#elif defined(_WIN32)
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
/* Win32 can't run the 'configure' script. */
-#include "../config_windows.h"
+#include "config_windows.h"
#else
/* Warn if the library hasn't been (automatically or manually) configured. */
#error Oops: No config.h and no pre-built configuration in test.h.
#endif
+#include <sys/types.h> /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+#if HAVE_DIRENT_H
#include <dirent.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#define dirent direct
+#endif
#include <errno.h>
#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
-#ifndef _WIN32
+#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <wchar.h>
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
#endif
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
+/*
+ * System-specific tweaks. We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
+ */
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "../bsdtar_windows.h"
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#endif
+#define LOCALE_DE "deu"
#else
-#define __FBSDID(a) /* null */
+#define LOCALE_DE "de_DE.UTF-8"
+#endif
+
+/* Visual Studio */
+#ifdef _MSC_VER
+#define snprintf sprintf_s
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+/* Cygwin-1.7.x is lazy about populating nlinks, so don't
+ * expect it to be accurate. */
+# define NLINKS_INACCURATE_FOR_DIRS
+#endif
+
+/* Haiku OS */
+#if defined(__HAIKU__)
+/* Haiku has typedefs in stdint.h (needed for int64_t) */
+#include <stdint.h>
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
#endif
/*
@@ -75,38 +131,83 @@
#define DEFINE_TEST(name) void name(void); void name(void)
/* An implementation of the standard assert() macro */
-#define assert(e) test_assert(__FILE__, __LINE__, (e), #e, NULL)
-
+#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
+/* chdir() and error if it fails */
+#define assertChdir(path) \
+ assertion_chdir(__FILE__, __LINE__, path)
/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-
+#define assertEqualInt(v1,v2) \
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* Assert two strings are the same. Reports value of each one if not. */
#define assertEqualString(v1,v2) \
- test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but v1 and v2 are wchar_t * */
#define assertEqualWString(v1,v2) \
- test_assert_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+ assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* As above, but raw blocks of bytes. */
#define assertEqualMem(v1, v2, l) \
- test_assert_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
/* Assert two files are the same; allow printf-style expansion of second name.
* See below for comments about variable arguments here...
*/
#define assertEqualFile \
- test_setup(__FILE__, __LINE__);test_assert_equal_file
+ assertion_setup(__FILE__, __LINE__);assertion_equal_file
/* Assert that a file is empty; supports printf-style arguments. */
#define assertEmptyFile \
- test_setup(__FILE__, __LINE__);test_assert_empty_file
+ assertion_setup(__FILE__, __LINE__);assertion_empty_file
+/* Assert that a file is not empty; supports printf-style arguments. */
+#define assertNonEmptyFile \
+ assertion_setup(__FILE__, __LINE__);assertion_non_empty_file
+#define assertFileAtime(pathname, sec, nsec) \
+ assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileAtimeRecent(pathname) \
+ assertion_file_atime_recent(__FILE__, __LINE__, pathname)
+#define assertFileBirthtime(pathname, sec, nsec) \
+ assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileBirthtimeRecent(pathname) \
+ assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileExists \
- test_setup(__FILE__, __LINE__);test_assert_file_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_exists
/* Assert that a file exists; supports printf-style arguments. */
#define assertFileNotExists \
- test_setup(__FILE__, __LINE__);test_assert_file_not_exists
+ assertion_setup(__FILE__, __LINE__);assertion_file_not_exists
/* Assert that file contents match a string; supports printf-style arguments. */
#define assertFileContents \
- test_setup(__FILE__, __LINE__);test_assert_file_contents
+ assertion_setup(__FILE__, __LINE__);assertion_file_contents
+#define assertFileMtime(pathname, sec, nsec) \
+ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileMtimeRecent(pathname) \
+ assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
+#define assertFileNLinks(pathname, nlinks) \
+ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size) \
+ assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertTextFileContents \
+ assertion_setup(__FILE__, __LINE__);assertion_text_file_contents
+#define assertFileContainsLinesAnyOrder(pathname, lines) \
+ assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
+#define assertIsDir(pathname, mode) \
+ assertion_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsHardlink(path1, path2) \
+ assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsNotHardlink(path1, path2) \
+ assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsReg(pathname, mode) \
+ assertion_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents) \
+ assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
+/* Create a directory, report error if it fails. */
+#define assertMakeDir(dirname, mode) \
+ assertion_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeFile(path, mode, contents) \
+ assertion_make_file(__FILE__, __LINE__, path, mode, contents)
+#define assertMakeHardlink(newfile, oldfile) \
+ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto) \
+ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertUmask(mask) \
+ assertion_umask(__FILE__, __LINE__, mask)
/*
* This would be simple with C99 variadic macros, but I don't want to
@@ -115,26 +216,61 @@
* but effective.
*/
#define skipping \
- test_setup(__FILE__, __LINE__);test_skipping
+ assertion_setup(__FILE__, __LINE__);test_skipping
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
-void test_setup(const char *, int);
+int assertion_assert(const char *, int, int, const char *, void *);
+int assertion_chdir(const char *, int, const char *);
+int assertion_empty_file(const char *, ...);
+int assertion_equal_file(const char *, const char *, ...);
+int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
+int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
+int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int assertion_file_atime(const char *, int, const char *, long, long);
+int assertion_file_atime_recent(const char *, int, const char *);
+int assertion_file_birthtime(const char *, int, const char *, long, long);
+int assertion_file_birthtime_recent(const char *, int, const char *);
+int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
+int assertion_file_contents(const void *, int, const char *, ...);
+int assertion_file_exists(const char *, ...);
+int assertion_file_mtime(const char *, int, const char *, long, long);
+int assertion_file_mtime_recent(const char *, int, const char *);
+int assertion_file_nlinks(const char *, int, const char *, int);
+int assertion_file_not_exists(const char *, ...);
+int assertion_file_size(const char *, int, const char *, long);
+int assertion_is_dir(const char *, int, const char *, int);
+int assertion_is_hardlink(const char *, int, const char *, const char *);
+int assertion_is_not_hardlink(const char *, int, const char *, const char *);
+int assertion_is_reg(const char *, int, const char *, int);
+int assertion_is_symlink(const char *, int, const char *, const char *);
+int assertion_make_dir(const char *, int, const char *, int);
+int assertion_make_file(const char *, int, const char *, int, const char *);
+int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
+int assertion_make_symlink(const char *, int, const char *newpath, const char *);
+int assertion_non_empty_file(const char *, ...);
+int assertion_text_file_contents(const char *buff, const char *f);
+int assertion_umask(const char *, int, int);
+void assertion_setup(const char *, int);
+
void test_skipping(const char *fmt, ...);
-int test_assert(const char *, int, int, const char *, void *);
-int test_assert_empty_file(const char *, ...);
-int test_assert_equal_file(const char *, const char *, ...);
-int test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
-int test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
-int test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
-int test_assert_file_contents(const void *, int, const char *, ...);
-int test_assert_file_exists(const char *, ...);
-int test_assert_file_not_exists(const char *, ...);
/* Like sprintf, then system() */
int systemf(const char * fmt, ...);
+/* Delay until time() returns a value after this. */
+void sleepUntilAfter(time_t);
+
+/* Return true if this platform can create symlinks. */
+int canSymlink(void);
+
+/* Return true if this platform can run the "gzip" program. */
+int canGzip(void);
+
+/* Return true if this platform can run the "gunzip" program. */
+int canGunzip(void);
+
/* Suck file into string allocated via malloc(). Call free() when done. */
/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
char *slurpfile(size_t *, const char *fmt, ...);
@@ -147,4 +283,7 @@ void extract_reference_file(const char *);
*/
/* Pathname of exe to be tested. */
-char *testprog;
+const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+const char *testprog;
diff --git a/archivers/libarchive/files/tar/test/test_0.c b/archivers/libarchive/files/tar/test/test_0.c
index 36c8b1ebe1f..c9277da16bc 100644
--- a/archivers/libarchive/files/tar/test/test_0.c
+++ b/archivers/libarchive/files/tar/test/test_0.c
@@ -29,13 +29,18 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_0.c,v 1.2 2008/05/26 17:10:10 kien
* This first test does basic sanity checks on the environment. For
* most of these, we just exit on failure.
*/
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define DEV_NULL "/dev/null"
+#else
+#define DEV_NULL "NUL"
+#endif
DEFINE_TEST(test_0)
{
struct stat st;
failure("File %s does not exist?!", testprog);
- if (!assertEqualInt(0, stat(testprog, &st)))
+ if (!assertEqualInt(0, stat(testprogfile, &st)))
exit(1);
failure("%s is not executable?!", testprog);
@@ -46,9 +51,9 @@ DEFINE_TEST(test_0)
* Try to succesfully run the program; this requires that
* we know some option that will succeed.
*/
- if (0 == systemf("%s --version >/dev/null", testprog)) {
+ if (0 == systemf("%s --version >" DEV_NULL, testprog)) {
/* This worked. */
- } else if (0 == systemf("%s -W version >/dev/null", testprog)) {
+ } else if (0 == systemf("%s -W version >" DEV_NULL, testprog)) {
/* This worked. */
} else {
failure("Unable to successfully run any of the following:\n"
diff --git a/archivers/libarchive/files/tar/test/test_basic.c b/archivers/libarchive/files/tar/test/test_basic.c
index fff51123019..4dc7cf6364f 100644
--- a/archivers/libarchive/files/tar/test/test_basic.c
+++ b/archivers/libarchive/files/tar/test/test_basic.c
@@ -27,20 +27,19 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_basic.c,v 1.2 2008/05/26 17:10:10
static void
-basic_tar(const char *target, const char *pack_options, const char *unpack_options)
+basic_tar(const char *target, const char *pack_options,
+ const char *unpack_options, const char *flist)
{
- struct stat st, st2;
- char buff[128];
int r;
- assertEqualInt(0, mkdir(target, 0775));
+ assertMakeDir(target, 0775);
/* Use the tar program to create an archive. */
- r = systemf("%s cf - %s `cat filelist` >%s/archive 2>%s/pack.err", testprog, pack_options, target, target);
+ r = systemf("%s cf - %s %s >%s/archive 2>%s/pack.err", testprog, pack_options, flist, target, target);
failure("Error invoking %s cf -", testprog, pack_options);
assertEqualInt(r, 0);
- chdir(target);
+ assertChdir(target);
/* Verify that nothing went to stderr. */
assertEmptyFile("pack.err");
@@ -60,99 +59,57 @@ basic_tar(const char *target, const char *pack_options, const char *unpack_optio
*/
/* Regular file with 2 links. */
- r = lstat("file", &st);
- failure("Failed to stat file %s/file, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st.st_mode));
- assertEqualInt(0644, st.st_mode & 0777);
- assertEqualInt(10, st.st_size);
- failure("file %s/file", target);
- assertEqualInt(2, st.st_nlink);
- }
+ assertIsReg("file", -1);
+ assertFileSize("file", 10);
+ failure("%s", target);
+ assertFileNLinks("file", 2);
/* Another name for the same file. */
- r = lstat("linkfile", &st2);
- failure("Failed to stat file %s/linkfile, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- assert(S_ISREG(st2.st_mode));
- assertEqualInt(0644, st2.st_mode & 0777);
- assertEqualInt(10, st2.st_size);
- failure("file %s/linkfile", target);
- assertEqualInt(2, st2.st_nlink);
- /* Verify that the two are really hardlinked. */
- assertEqualInt(st.st_dev, st2.st_dev);
- failure("%s/linkfile and %s/file aren't really hardlinks", target, target);
- assertEqualInt(st.st_ino, st2.st_ino);
- }
+ assertIsReg("linkfile", -1);
+ assertFileSize("linkfile", 10);
+ assertFileNLinks("linkfile", 2);
+ assertIsHardlink("file", "linkfile");
/* Symlink */
- r = lstat("symlink", &st);
- failure("Failed to stat file %s/symlink, errno=%d", target, errno);
- assertEqualInt(r, 0);
- if (r == 0) {
- failure("symlink should be a symlink; actual mode is %o",
- st.st_mode);
- assert(S_ISLNK(st.st_mode));
- if (S_ISLNK(st.st_mode)) {
- r = readlink("symlink", buff, sizeof(buff));
- assertEqualInt(r, 4);
- buff[r] = '\0';
- assertEqualString(buff, "file");
- }
- }
+ if (canSymlink())
+ assertIsSymlink("symlink", "file");
/* dir */
- r = lstat("dir", &st);
- if (r == 0) {
- assertEqualInt(r, 0);
- assert(S_ISDIR(st.st_mode));
- assertEqualInt(0775, st.st_mode & 0777);
- }
-
- chdir("..");
+ assertIsDir("dir", 0775);
+ assertChdir("..");
}
DEFINE_TEST(test_basic)
{
- int fd;
- int filelist;
- int oldumask;
+ FILE *f;
+ const char *flist;
- oldumask = umask(0);
-
- /*
- * Create an assortment of files on disk.
- */
- filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+ assertUmask(0);
/* File with 10 bytes content. */
- fd = open("file", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(10, write(fd, "123456789", 10));
- close(fd);
- write(filelist, "file\n", 5);
+ f = fopen("file", "wb");
+ assert(f != NULL);
+ assertEqualInt(10, fwrite("123456789", 1, 10, f));
+ fclose(f);
/* hardlink to above file. */
- assertEqualInt(0, link("file", "linkfile"));
- write(filelist, "linkfile\n", 9);
+ assertMakeHardlink("linkfile", "file");
+ assertIsHardlink("file", "linkfile");
/* Symlink to above file. */
- assertEqualInt(0, symlink("file", "symlink"));
- write(filelist, "symlink\n", 8);
+ if (canSymlink())
+ assertMakeSymlink("symlink", "file");
/* Directory. */
- assertEqualInt(0, mkdir("dir", 0775));
- write(filelist, "dir\n", 4);
- /* All done. */
- close(filelist);
+ assertMakeDir("dir", 0775);
+ if (canSymlink())
+ flist = "file linkfile symlink dir";
+ else
+ flist = "file linkfile dir";
/* Archive/dearchive with a variety of options. */
- basic_tar("copy", "", "");
+ basic_tar("copy", "", "", flist);
/* tar doesn't handle cpio symlinks correctly */
/* basic_tar("copy_odc", "--format=odc", ""); */
- basic_tar("copy_ustar", "--format=ustar", "");
-
- umask(oldumask);
+ basic_tar("copy_ustar", "--format=ustar", "", flist);
}
diff --git a/archivers/libarchive/files/tar/test/test_copy.c b/archivers/libarchive/files/tar/test/test_copy.c
index b2eef8cf791..69112900e53 100644
--- a/archivers/libarchive/files/tar/test/test_copy.c
+++ b/archivers/libarchive/files/tar/test/test_copy.c
@@ -23,7 +23,110 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_copy.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_copy.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
+
+#if defined(__CYGWIN__)
+# include <limits.h>
+# include <sys/cygwin.h>
+#endif
+
+/*
+ * Try to figure out how deep we can go in our tests. Assumes that
+ * the first call to this function has the longest starting cwd (which
+ * is currently "<testdir>/original"). This is mostly to work around
+ * limits in our Win32 support.
+ *
+ * Background: On Posix systems, PATH_MAX is merely a limit on the
+ * length of the string passed into a system call. By repeatedly
+ * calling chdir(), you can work with arbitrarily long paths on such
+ * systems. In contrast, Win32 APIs apply PATH_MAX limits to the full
+ * absolute path, so the permissible length of a system call argument
+ * varies with the cwd. Some APIs actually enforce limits
+ * significantly less than PATH_MAX to ensure that you can create
+ * files within the current working directory. The Win32 limits also
+ * apply to Cygwin before 1.7.
+ *
+ * Someday, I want to convert the Win32 support to use newer
+ * wide-character paths with '\\?\' prefix, which has a 32k PATH_MAX
+ * instead of the rather anemic 260 character limit of the older
+ * system calls. Then we can drop this mess (unless we want to
+ * continue to special-case Cygwin 1.5 and earlier).
+ */
+static int
+compute_loop_max(void)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ static int LOOP_MAX = 0;
+ char buf[MAX_PATH];
+ size_t cwdlen;
+
+ if (LOOP_MAX == 0) {
+ assert(_getcwd(buf, MAX_PATH) != NULL);
+ cwdlen = strlen(buf);
+ /* 12 characters = length of 8.3 filename */
+ /* 4 characters = length of "/../" used in symlink tests */
+ /* 1 character = length of extra "/" separator */
+ LOOP_MAX = MAX_PATH - (int)cwdlen - 12 - 4 - 1;
+ }
+ return LOOP_MAX;
+#elif defined(__CYGWIN__) && !defined(HAVE_CYGWIN_CONV_PATH)
+ static int LOOP_MAX = 0;
+ if (LOOP_MAX == 0) {
+ char wbuf[PATH_MAX];
+ char pbuf[PATH_MAX];
+ size_t wcwdlen;
+ size_t pcwdlen;
+ size_t cwdlen;
+ assert(getcwd(pbuf, PATH_MAX) != NULL);
+ pcwdlen = strlen(pbuf);
+ cygwin_conv_to_full_win32_path(pbuf, wbuf);
+ wcwdlen = strlen(wbuf);
+ cwdlen = ((wcwdlen > pcwdlen) ? wcwdlen : pcwdlen);
+ /* Cygwin helper needs an extra few characters. */
+ LOOP_MAX = PATH_MAX - (int)cwdlen - 12 - 4 - 4;
+ }
+ return LOOP_MAX;
+#else
+ /* cygwin-1.7 ends up here, along with "normal" unix */
+ return 200; /* restore pre-r278 depth */
+#endif
+}
+
+/* filenames[i] is a distinctive filename of length i. */
+/* To simplify interpreting failures, each filename ends with a
+ * decimal integer which is the length of the filename. E.g., A
+ * filename ending in "_92" is 92 characters long. To detect errors
+ * which drop or misplace characters, the filenames use a repeating
+ * "abcdefghijklmnopqrstuvwxyz..." pattern. */
+static char *filenames[201];
+
+static void
+compute_filenames(void)
+{
+ char buff[250];
+ size_t i,j;
+
+ filenames[0] = strdup("");
+ filenames[1] = strdup("1");
+ filenames[2] = strdup("a2");
+ for (i = 3; i < sizeof(filenames)/sizeof(filenames[0]); ++i) {
+ /* Fill with "abcdefghij..." */
+ for (j = 0; j < i; ++j)
+ buff[j] = 'a' + (j % 26);
+ buff[j--] = '\0';
+ /* Work from the end to fill in the number portion. */
+ buff[j--] = '0' + (i % 10);
+ if (i > 9) {
+ buff[j--] = '0' + ((i / 10) % 10);
+ if (i > 99)
+ buff[j--] = '0' + (i / 100);
+ }
+ buff[j] = '_';
+ /* Guard against obvious screwups in the above code. */
+ assertEqualInt(strlen(buff), i);
+ filenames[i] = strdup(buff);
+ }
+}
static void
create_tree(void)
@@ -31,208 +134,145 @@ create_tree(void)
char buff[260];
char buff2[260];
int i;
- int fd;
-
- assertEqualInt(0, mkdir("original", 0775));
- chdir("original");
- assertEqualInt(0, mkdir("f", 0775));
- assertEqualInt(0, mkdir("l", 0775));
- assertEqualInt(0, mkdir("m", 0775));
- assertEqualInt(0, mkdir("s", 0775));
- assertEqualInt(0, mkdir("d", 0775));
-
- for (i = 0; i < 200; i++) {
- buff[0] = 'f';
- buff[1] = '/';
- /* Create a file named "f/abcdef..." */
- buff[i + 2] = 'a' + (i % 26);
- buff[i + 3] = '\0';
- fd = open(buff, O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- assertEqualInt(i + 3, write(fd, buff, strlen(buff)));
- close(fd);
+ int LOOP_MAX;
+
+ compute_filenames();
+
+ /* Log that we'll be omitting some checks. */
+ if (!canSymlink()) {
+ skipping("Symlink checks");
+ }
+
+ assertMakeDir("original", 0775);
+ assertEqualInt(0, chdir("original"));
+ LOOP_MAX = compute_loop_max();
+
+ assertMakeDir("f", 0775);
+ assertMakeDir("l", 0775);
+ assertMakeDir("m", 0775);
+ assertMakeDir("s", 0775);
+ assertMakeDir("d", 0775);
+
+ for (i = 1; i < LOOP_MAX; i++) {
+ failure("Internal sanity check failed: i = %d", i);
+ assert(filenames[i] != NULL);
+
+ sprintf(buff, "f/%s", filenames[i]);
+ assertMakeFile(buff, 0777, buff);
/* Create a link named "l/abcdef..." to the above. */
- strcpy(buff2, buff);
- buff2[0] = 'l';
- assertEqualInt(0, link(buff, buff2));
+ sprintf(buff2, "l/%s", filenames[i]);
+ assertMakeHardlink(buff2, buff);
/* Create a link named "m/abcdef..." to the above. */
- strcpy(buff2, buff);
- buff2[0] = 'm';
- assertEqualInt(0, link(buff, buff2));
-
- /* Create a symlink named "s/abcdef..." to the above. */
- strcpy(buff2 + 3, buff);
- buff[0] = 's';
- buff2[0] = '.';
- buff2[1] = '.';
- buff2[2] = '/';
- assertEqualInt(0, symlink(buff2, buff));
-
+ sprintf(buff2, "m/%s", filenames[i]);
+ assertMakeHardlink(buff2, buff);
+
+ if (canSymlink()) {
+ /* Create a symlink named "s/abcdef..." to the above. */
+ sprintf(buff, "s/%s", filenames[i]);
+ sprintf(buff2, "../f/%s", filenames[i]);
+ failure("buff=\"%s\" buff2=\"%s\"", buff, buff2);
+ assertMakeSymlink(buff, buff2);
+ }
/* Create a dir named "d/abcdef...". */
buff[0] = 'd';
- assertEqualInt(0, mkdir(buff, 0775));
+ failure("buff=\"%s\"", buff);
+ assertMakeDir(buff, 0775);
}
- chdir("..");
+ assertEqualInt(0, chdir(".."));
}
-#define LIMIT_NONE 0
-#define LIMIT_USTAR 1
+#define LIMIT_NONE 200
+#define LIMIT_USTAR 100
static void
-verify_tree(int limit)
+verify_tree(size_t limit)
{
- struct stat st, st2;
- char filename[260];
char name1[260];
char name2[260];
- char contents[260];
- int i, j, r;
- int fd;
- int len;
- const char *p, *dp;
- DIR *d;
- struct dirent *de;
+ size_t i, LOOP_MAX;
- /* Generate the names we know should be there and verify them. */
- for (i = 1; i < 200; i++) {
- /* Generate a base name of the correct length. */
- for (j = 0; j < i; ++j)
- filename[j] = 'a' + (j % 26);
-#if 0
- for (n = i; n > 0; n /= 10)
- filename[--j] = '0' + (n % 10);
-#endif
- filename[i] = '\0';
+ LOOP_MAX = compute_loop_max();
+ /* Generate the names we know should be there and verify them. */
+ for (i = 1; i < LOOP_MAX; i++) {
/* Verify a file named "f/abcdef..." */
- strcpy(name1, "f/");
- strcat(name1, filename);
- if (limit != LIMIT_USTAR || strlen(filename) <= 100) {
- fd = open(name1, O_RDONLY);
- failure("Couldn't open \"%s\": %s",
- name1, strerror(errno));
- if (assert(fd >= 0)) {
- len = read(fd, contents, i + 10);
- close(fd);
- assertEqualInt(len, i + 2);
- /* Verify contents of 'contents' */
- contents[len] = '\0';
- failure("Each test file contains its own name");
- assertEqualString(name1, contents);
- /* stat() for dev/ino for next check */
- assertEqualInt(0, lstat(name1, &st));
- }
+ sprintf(name1, "f/%s", filenames[i]);
+ if (i <= limit) {
+ assertFileExists(name1);
+ assertFileContents(name1, strlen(name1), name1);
}
- /*
- * ustar allows 100 chars for links, and we have
- * "original/" as part of the name, so the link
- * names here can't exceed 91 chars.
- */
- strcpy(name2, "l/");
- strcat(name2, filename);
- if (limit != LIMIT_USTAR || strlen(name2) <= 100) {
+ sprintf(name2, "l/%s", filenames[i]);
+ if (i + 2 <= limit) {
/* Verify hardlink "l/abcdef..." */
- assertEqualInt(0, (r = lstat(name2, &st2)));
- if (r == 0) {
- assertEqualInt(st2.st_dev, st.st_dev);
- assertEqualInt(st2.st_ino, st.st_ino);
- }
-
- /* Verify hardlink "m_abcdef..." */
+ assertIsHardlink(name1, name2);
+ /* Verify hardlink "m/abcdef..." */
name2[0] = 'm';
- assertEqualInt(0, (r = lstat(name2, &st2)));
- if (r == 0) {
- assertEqualInt(st2.st_dev, st.st_dev);
- assertEqualInt(st2.st_ino, st.st_ino);
- }
+ assertIsHardlink(name1, name2);
}
- /*
- * Symlink text doesn't include the 'original/' prefix,
- * so the limit here is 100 characters.
- */
- /* Verify symlink "s/abcdef..." */
- strcpy(name2, "../s/");
- strcat(name2, filename);
- if (limit != LIMIT_USTAR || strlen(name2) <= 100) {
- /* This is a symlink. */
- failure("Couldn't stat %s (length %d)",
- filename, strlen(filename));
- if (assertEqualInt(0, lstat(name2 + 3, &st2))) {
- assert(S_ISLNK(st2.st_mode));
- /* This is a symlink to the file above. */
- failure("Couldn't stat %s", name2 + 3);
- if (assertEqualInt(0, stat(name2 + 3, &st2))) {
- assertEqualInt(st2.st_dev, st.st_dev);
- assertEqualInt(st2.st_ino, st.st_ino);
- }
- }
+ if (canSymlink()) {
+ /* Verify symlink "s/abcdef..." */
+ sprintf(name1, "s/%s", filenames[i]);
+ sprintf(name2, "../f/%s", filenames[i]);
+ if (strlen(name2) <= limit)
+ assertIsSymlink(name1, name2);
}
/* Verify dir "d/abcdef...". */
- strcpy(name1, "d/");
- strcat(name1, filename);
- if (limit != LIMIT_USTAR || strlen(filename) < 100) {
- /* This is a dir. */
- failure("Couldn't stat %s (length %d)",
- name1, strlen(filename));
- if (assertEqualInt(0, lstat(name1, &st2))) {
- if (assert(S_ISDIR(st2.st_mode))) {
- /* TODO: opendir/readdir this
- * directory and make sure
- * it's empty.
- */
- }
+ sprintf(name1, "d/%s", filenames[i]);
+ if (i + 1 <= limit) { /* +1 for trailing slash */
+ if (assertIsDir(name1, -1)) {
+ /* TODO: opendir/readdir this
+ * directory and make sure
+ * it's empty.
+ */
}
}
}
- /* Now make sure nothing is there that shouldn't be. */
- for (dp = "dflms"; *dp != '\0'; ++dp) {
- char dir[2];
- dir[0] = *dp; dir[1] = '\0';
- d = opendir(dir);
- while ((de = readdir(d)) != NULL) {
- p = de->d_name;
- switch(dp[0]) {
- case 'l': case 'm':
- if (limit == LIMIT_USTAR) {
- failure("strlen(p) = %d", strlen(p));
- assert(strlen(p) <= 100);
- }
- case 'd':
- if (limit == LIMIT_USTAR) {
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ {
+ const char *dp;
+ /* Now make sure nothing is there that shouldn't be. */
+ for (dp = "dflms"; *dp != '\0'; ++dp) {
+ DIR *d;
+ struct dirent *de;
+ char dir[2];
+ dir[0] = *dp; dir[1] = '\0';
+ d = opendir(dir);
+ failure("Unable to open dir '%s'", dir);
+ if (!assert(d != NULL))
+ continue;
+ while ((de = readdir(d)) != NULL) {
+ char *p = de->d_name;
+ if (p[0] == '.')
+ continue;
+ switch(dp[0]) {
+ case 'l': case 'm': case 'd':
failure("strlen(p)=%d", strlen(p));
- assert(strlen(p) < 100);
- }
- case 'f': case 's':
- if (limit == LIMIT_USTAR) {
+ assert(strlen(p) < limit);
+ assertEqualString(p,
+ filenames[strlen(p)]);
+ break;
+ case 'f': case 's':
failure("strlen(p)=%d", strlen(p));
- assert(strlen(p) < 101);
- }
- /* Our files have very particular filename patterns. */
- if (p[0] != '.' || (p[1] != '.' && p[1] != '\0')) {
- for (i = 0; p[i] != '\0' && i < 200; i++) {
- failure("i=%d, p[i]='%c' 'a'+(i%%26)='%c'", i, p[i], 'a' + (i % 26));
- assertEqualInt(p[i], 'a' + (i % 26));
- }
- assert(p[i] == '\0');
+ assert(strlen(p) < limit + 1);
+ assertEqualString(p,
+ filenames[strlen(p)]);
+ break;
+ default:
+ failure("File %s shouldn't be here", p);
+ assert(0);
}
- break;
- case '.':
- assert(p[1] == '\0' || (p[1] == '.' && p[2] == '\0'));
- break;
- default:
- failure("File %s shouldn't be here", p);
- assert(0);
}
+ closedir(d);
}
- closedir(d);
}
+#endif
}
static void
@@ -240,7 +280,13 @@ copy_basic(void)
{
int r;
- assertEqualInt(0, mkdir("plain", 0775));
+ /* NOTE: for proper operation on cygwin-1.5 and windows, the
+ * length of the name of the directory below, "plain", must be
+ * less than or equal to the lengthe of the name of the original
+ * directory, "original" This restriction derives from the
+ * extremely limited pathname lengths on those platforms.
+ */
+ assertMakeDir("plain", 0775);
assertEqualInt(0, chdir("plain"));
/*
@@ -276,7 +322,13 @@ copy_ustar(void)
const char *target = "ustar";
int r;
- assertEqualInt(0, mkdir(target, 0775));
+ /* NOTE: for proper operation on cygwin-1.5 and windows, the
+ * length of the name of the directory below, "ustar", must be
+ * less than or equal to the lengthe of the name of the original
+ * directory, "original" This restriction derives from the
+ * extremely limited pathname lengths on those platforms.
+ */
+ assertMakeDir(target, 0775);
assertEqualInt(0, chdir(target));
/*
@@ -303,17 +355,13 @@ copy_ustar(void)
assertEmptyFile("unpack.err");
assertEmptyFile("unpack.out");
- chdir("original");
verify_tree(LIMIT_USTAR);
- chdir("../..");
+ assertEqualInt(0, chdir("../.."));
}
DEFINE_TEST(test_copy)
{
- int oldumask;
-
- oldumask = umask(0);
-
+ assertUmask(0);
create_tree(); /* Create sample files in "original" dir. */
/* Test simple "tar -c | tar -x" pipeline copy. */
@@ -321,6 +369,4 @@ DEFINE_TEST(test_copy)
/* Same, but constrain to ustar format. */
copy_ustar();
-
- umask(oldumask);
}
diff --git a/archivers/libarchive/files/tar/test/test_empty_mtree.c b/archivers/libarchive/files/tar/test/test_empty_mtree.c
new file mode 100644
index 00000000000..6f8a5e91aa1
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_empty_mtree.c
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Regression test: We used to get a bogus error message when we
+ * asked tar to copy entries out of an empty archive. See
+ * Issue 51 on libarchive.googlecode.com for details.
+ */
+DEFINE_TEST(test_empty_mtree)
+{
+ int r;
+
+ assertMakeFile("test1.mtree", 0777, "#mtree\n");
+
+ r = systemf("%s cf test1.tar @test1.mtree >test1.out 2>test1.err",
+ testprog);
+ failure("Error invoking %s cf", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("test1.out");
+ assertEmptyFile("test1.err");
+}
diff --git a/archivers/libarchive/files/tar/test/test_getdate.c b/archivers/libarchive/files/tar/test/test_getdate.c
index d75119cc33a..eac571049fe 100644
--- a/archivers/libarchive/files/tar/test/test_getdate.c
+++ b/archivers/libarchive/files/tar/test/test_getdate.c
@@ -25,14 +25,56 @@
#include "test.h"
__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_getdate.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
+#include <time.h>
+
/*
* Verify that the getdate() function works.
*/
-time_t get_date(const char *);
+time_t get_date(time_t, const char *);
DEFINE_TEST(test_getdate)
{
- assertEqualInt(0, get_date("Jan 1, 1970 UTC"));
+ time_t now = time(NULL);
+
+ assertEqualInt(get_date(now, "Jan 1, 1970 UTC"), 0);
+ assertEqualInt(get_date(now, "7:12:18-0530 4 May 1983"), 420900138);
+ assertEqualInt(get_date(now, "2004/01/29 513 mest"), 1075345980);
+ assertEqualInt(get_date(now, "99/02/17 7pm utc"), 919278000);
+ assertEqualInt(get_date(now, "02/17/99 7:11am est"), 919253460);
+ /* It's important that we handle ctime() format. */
+ assertEqualInt(get_date(now, "Sun Feb 22 17:38:26 PST 2009"),
+ 1235353106);
+ /* Basic relative offsets. */
+ /* If we use the actual current time as the reference, then
+ * these tests break around DST changes, so it's actually
+ * important to use a specific reference time here. */
+ assertEqualInt(get_date(0, "tomorrow"), 24 * 60 * 60);
+ assertEqualInt(get_date(0, "yesterday"), - 24 * 60 * 60);
+ assertEqualInt(get_date(0, "now + 1 hour"), 60 * 60);
+ assertEqualInt(get_date(0, "now + 1 hour + 1 minute"), 60 * 60 + 60);
+ /* Repeat the above for a different start time. */
+ now = 1231113600; /* Jan 5, 2009 00:00 UTC */
+ assertEqualInt(get_date(0, "Jan 5, 2009 00:00 UTC"), now);
+ assertEqualInt(get_date(now, "tomorrow"), now + 24 * 60 * 60);
+ assertEqualInt(get_date(now, "yesterday"), now - 24 * 60 * 60);
+ assertEqualInt(get_date(now, "now + 1 hour"), now + 60 * 60);
+ assertEqualInt(get_date(now, "now + 1 hour + 1 minute"),
+ now + 60 * 60 + 60);
+ assertEqualInt(get_date(now, "tomorrow 5:16am UTC"),
+ now + 24 * 60 * 60 + 5 * 60 * 60 + 16 * 60);
+ assertEqualInt(get_date(now, "UTC 5:16am tomorrow"),
+ now + 24 * 60 * 60 + 5 * 60 * 60 + 16 * 60);
+
+ /* Jan 5, 2009 was a Monday. */
+ assertEqualInt(get_date(now, "monday UTC"), now);
+ assertEqualInt(get_date(now, "sunday UTC"), now + 6 * 24 * 60 * 60);
+ assertEqualInt(get_date(now, "tuesday UTC"), now + 24 * 60 * 60);
+ /* "next tuesday" is one week after "tuesday" */
+ assertEqualInt(get_date(now, "UTC next tuesday"),
+ now + 8 * 24 * 60 * 60);
+ /* "last tuesday" is one week before "tuesday" */
+ assertEqualInt(get_date(now, "last tuesday UTC"),
+ now - 6 * 24 * 60 * 60);
/* TODO: Lots more tests here. */
}
diff --git a/archivers/libarchive/files/tar/test/test_help.c b/archivers/libarchive/files/tar/test/test_help.c
index 163e2127f26..3bb517d00cd 100644
--- a/archivers/libarchive/files/tar/test/test_help.c
+++ b/archivers/libarchive/files/tar/test/test_help.c
@@ -51,6 +51,7 @@ DEFINE_TEST(test_help)
/* Exercise --help option. */
r = systemf("%s --help >help.stdout 2>help.stderr", testprog);
+ assertEqualInt(r, 0);
failure("--help should generate nothing to stderr.");
assertEmptyFile("help.stderr");
/* Help message should start with name of program. */
@@ -67,6 +68,7 @@ DEFINE_TEST(test_help)
/* -h option should generate the same output. */
r = systemf("%s -h >h.stdout 2>h.stderr", testprog);
+ assertEqualInt(r, 0);
failure("-h should generate nothing to stderr.");
assertEmptyFile("h.stderr");
failure("stdout should be same for -h and --help");
@@ -74,6 +76,7 @@ DEFINE_TEST(test_help)
/* -W help should be another synonym. */
r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog);
+ assertEqualInt(r, 0);
failure("-W help should generate nothing to stderr.");
assertEmptyFile("Whelp.stderr");
failure("stdout should be same for -W help and --help");
diff --git a/archivers/libarchive/files/tar/test/test_option_T_upper.c b/archivers/libarchive/files/tar/test/test_option_T_upper.c
new file mode 100644
index 00000000000..3d2a8b1e2a5
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_option_T_upper.c
@@ -0,0 +1,188 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_T.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
+
+static int
+touch(const char *fn, int fail)
+{
+ FILE *f = fopen(fn, "w");
+ if (fail) {
+ failure("Couldn't create file '%s', errno=%d (%s)\n",
+ fn, errno, strerror(errno));
+ if (!assert(f != NULL))
+ return (0); /* Failure. */
+ } else {
+ if (f == NULL)
+ return (0); /* Soft failure. */
+ }
+ fclose(f);
+ return (1); /* Success */
+}
+
+DEFINE_TEST(test_option_T_upper)
+{
+ FILE *f;
+ int r;
+ struct stat st;
+ int gnarlyFilesSupported;
+
+ /* Create a simple dir heirarchy; bail if anything fails. */
+ if (!assertMakeDir("d1", 0755)) return;
+ if (!assertMakeDir("d1/d2", 0755)) return;
+ if (!touch("f", 1)) return;
+ if (!touch("d1/f1", 1)) return;
+ if (!touch("d1/f2", 1)) return;
+ if (!touch("d1/d2/f3", 1)) return;
+ if (!touch("d1/d2/f4", 1)) return;
+ if (!touch("d1/d2/f5", 1)) return;
+ if (!touch("d1/d2/f6", 1)) return;
+ /* Some platforms don't permit such things; just skip it. */
+ gnarlyFilesSupported = touch("d1/d2/f\x0a", 0);
+
+ /* Populate a file list */
+ f = fopen("filelist", "w+");
+ if (!assert(f != NULL))
+ return;
+ /* Use a variety of text line endings. */
+ fprintf(f, "f\x0d"); /* CR */
+ fprintf(f, "d1/f1\x0d\x0a"); /* CRLF */
+ fprintf(f, "d1/d2/f4\x0a"); /* NL */
+ fprintf(f, "d1/d2/f6"); /* EOF */
+ fclose(f);
+
+ /* Populate a second file list */
+ f = fopen("filelist2", "w+");
+ if (!assert(f != NULL))
+ return;
+ /* Use null-terminated names. */
+ fprintf(f, "d1/d2/f3");
+ fwrite("\0", 1, 1, f);
+ fprintf(f, "d1/d2/f5");
+ fwrite("\0", 1, 1, f);
+ if (gnarlyFilesSupported) {
+ fprintf(f, "d1/d2/f\x0a");
+ fwrite("\0", 1, 1, f);
+ }
+ fclose(f);
+
+ /* Use -c -T to archive up the files. */
+ r = systemf("%s -c -f test1.tar -T filelist > test1.out 2> test1.err",
+ testprog);
+ assert(r == 0);
+ assertEmptyFile("test1.out");
+ assertEmptyFile("test1.err");
+
+ /* Use -x -T to dearchive the files */
+ if (!assertMakeDir("test1", 0755)) return;
+ systemf("%s -x -f test1.tar -T filelist -C test1"
+ " > test1b.out 2> test1b.err", testprog);
+ assertEmptyFile("test1b.out");
+ assertEmptyFile("test1b.err");
+
+ /* Verify the files were extracted. */
+ assertFileExists("test1/f");
+ assertFileExists("test1/d1/f1");
+ assertFileNotExists("test1/d1/f2");
+ assertFileNotExists("test1/d1/d2/f3");
+ assertFileExists("test1/d1/d2/f4");
+ assertFileNotExists("test1/d1/d2/f5");
+ assertFileExists("test1/d1/d2/f6");
+ if (gnarlyFilesSupported) {
+ assertFileNotExists("test1/d1/d2/f\x0a");
+ }
+
+ /* Use -r -T to add more files to the archive. */
+ systemf("%s -r -f test1.tar --null -T filelist2 > test2.out 2> test2.err",
+ testprog);
+ assertEmptyFile("test2.out");
+ assertEmptyFile("test2.err");
+
+ /* Use -x without -T to dearchive the files (ensure -r worked) */
+ if (!assertMakeDir("test3", 0755)) return;
+ systemf("%s -x -f test1.tar -C test3"
+ " > test3.out 2> test3.err", testprog);
+ assertEmptyFile("test3.out");
+ assertEmptyFile("test3.err");
+ /* Verify the files were extracted.*/
+ assertFileExists("test3/f");
+ assertFileExists("test3/d1/f1");
+ assertFileNotExists("test3/d1/f2");
+ assertFileExists("test3/d1/d2/f3");
+ assertFileExists("test3/d1/d2/f4");
+ assertFileExists("test3/d1/d2/f5");
+ assertFileExists("test3/d1/d2/f6");
+ if (gnarlyFilesSupported) {
+ assertFileExists("test3/d1/d2/f\x0a");
+ }
+
+ /* Use -x -T to dearchive the files (verify -x -T together) */
+ if (!assertMakeDir("test2", 0755)) return;
+ systemf("%s -x -f test1.tar -T filelist -C test2"
+ " > test2b.out 2> test2b.err", testprog);
+ assertEmptyFile("test2b.out");
+ assertEmptyFile("test2b.err");
+ /* Verify the files were extracted.*/
+ assertFileExists("test2/f");
+ assertFileExists("test2/d1/f1");
+ assertFileNotExists("test2/d1/f2");
+ assertFileNotExists("test2/d1/d2/f3");
+ assertFileExists("test2/d1/d2/f4");
+ assertFileNotExists("test2/d1/d2/f5");
+ assertFileExists("test2/d1/d2/f6");
+ if (gnarlyFilesSupported) {
+ assertFileNotExists("test2/d1/d2/f\x0a");
+ }
+
+ assertMakeDir("test4", 0755);
+ assertMakeDir("test4_out", 0755);
+ assertMakeDir("test4_out2", 0755);
+ assertMakeDir("test4/d1", 0755);
+ assertEqualInt(1, touch("test4/d1/foo", 0));
+
+ /* Does bsdtar support -s option ? */
+ systemf("%s -cf - -s /foo/bar/ test4/d1/foo > check.out 2> check.err",
+ testprog);
+ assertEqualInt(0, stat("check.err", &st));
+ if (st.st_size == 0) {
+ systemf("%s -cf - -s /foo/bar/ test4/d1/foo | %s -xf - -C test4_out",
+ testprog, testprog);
+ assertEmptyFile("test4_out/test4/d1/bar");
+ systemf("%s -cf - -s /d1/d2/ test4/d1/foo | %s -xf - -C test4_out",
+ testprog, testprog);
+ assertEmptyFile("test4_out/test4/d2/foo");
+ systemf("%s -cf - -s ,test4/d1/foo,, test4/d1/foo | %s -tvf - > test4.lst",
+ testprog, testprog);
+ assertEmptyFile("test4.lst");
+ systemf("%s -cf - test4/d1/foo | %s -xf - -s /foo/bar/ -C test4_out2",
+ testprog, testprog);
+ assertEmptyFile("test4_out2/test4/d1/bar");
+ } else {
+ skipping("bsdtar does not support -s option on this platform");
+ }
+
+ /* TODO: Include some use of -C directory-changing within the filelist. */
+ /* I'm pretty sure -C within the filelist is broken on extract. */
+}
diff --git a/archivers/libarchive/files/tar/test/test_option_q.c b/archivers/libarchive/files/tar/test/test_option_q.c
new file mode 100644
index 00000000000..68867b52a82
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_option_q.c
@@ -0,0 +1,129 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_q.c,v 1.3 2008/08/22 01:35:08 kientzle Exp $");
+
+DEFINE_TEST(test_option_q)
+{
+ FILE *f;
+ int r;
+
+ /*
+ * Create an archive with several different versions of the
+ * same files. By default, the last version will overwrite
+ * any earlier versions. The -q/--fast-read option will
+ * stop early, so we can verify -q/--fast-read by seeing
+ * which version of each file actually ended up being
+ * extracted. This also exercises -r mode, since that's
+ * what we use to build up the test archive.
+ */
+
+ f = fopen("foo", "w");
+ assert(f != NULL);
+ fprintf(f, "foo1");
+ fclose(f);
+
+ assertEqualInt(0, systemf("%s -cf archive.tar foo", testprog));
+
+ f = fopen("foo", "w");
+ assert(f != NULL);
+ fprintf(f, "foo2");
+ fclose(f);
+
+ assertEqualInt(0, systemf("%s -rf archive.tar foo", testprog));
+
+ f = fopen("bar", "w");
+ assert(f != NULL);
+ fprintf(f, "bar1");
+ fclose(f);
+
+ assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog));
+
+ f = fopen("foo", "w");
+ assert(f != NULL);
+ fprintf(f, "foo3");
+ fclose(f);
+
+ assertEqualInt(0, systemf("%s -rf archive.tar foo", testprog));
+
+ f = fopen("bar", "w");
+ assert(f != NULL);
+ fprintf(f, "bar2");
+ fclose(f);
+
+ assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog));
+
+ /*
+ * Now, try extracting from the test archive with various
+ * combinations of -q.
+ */
+
+ /* Test 1: -q foo should only extract the first foo. */
+ assertMakeDir("test1", 0755);
+ assertChdir("test1");
+ r = systemf("%s -xf ../archive.tar -q foo >test.out 2>test.err",
+ testprog);
+ failure("Fatal error trying to use -q option");
+ if (!assertEqualInt(0, r))
+ return;
+
+ assertFileContents("foo1", 4, "foo");
+ assertEmptyFile("test.out");
+ assertEmptyFile("test.err");
+ assertChdir("..");
+
+ /* Test 2: -q foo bar should extract up to the first bar. */
+ assertMakeDir("test2", 0755);
+ assertChdir("test2");
+ assertEqualInt(0,
+ systemf("%s -xf ../archive.tar -q foo bar >test.out 2>test.err", testprog));
+ assertFileContents("foo2", 4, "foo");
+ assertFileContents("bar1", 4, "bar");
+ assertEmptyFile("test.out");
+ assertEmptyFile("test.err");
+ assertChdir("..");
+
+ /* Test 3: Same as test 2, but use --fast-read spelling. */
+ assertMakeDir("test3", 0755);
+ assertChdir("test3");
+ assertEqualInt(0,
+ systemf("%s -xf ../archive.tar --fast-read foo bar >test.out 2>test.err", testprog));
+ assertFileContents("foo2", 4, "foo");
+ assertFileContents("bar1", 4, "bar");
+ assertEmptyFile("test.out");
+ assertEmptyFile("test.err");
+ assertChdir("..");
+
+ /* Test 4: Without -q, should extract everything. */
+ assertMakeDir("test4", 0755);
+ assertChdir("test4");
+ assertEqualInt(0,
+ systemf("%s -xf ../archive.tar foo bar >test.out 2>test.err", testprog));
+ assertFileContents("foo3", 4, "foo");
+ assertFileContents("bar2", 4, "bar");
+ assertEmptyFile("test.out");
+ assertEmptyFile("test.err");
+ assertChdir("..");
+}
diff --git a/archivers/libarchive/files/tar/test/test_option_r.c b/archivers/libarchive/files/tar/test/test_option_r.c
new file mode 100644
index 00000000000..516a8307936
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_option_r.c
@@ -0,0 +1,117 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Also see test_option_q for additional validation of -r support.
+ */
+DEFINE_TEST(test_option_r)
+{
+ char buff[15];
+ char *p0, *p1;
+ size_t s;
+ FILE *f;
+ int r;
+
+ /* Create a file */
+ f = fopen("f1", "w");
+ if (!assert(f != NULL))
+ return;
+ assertEqualInt(3, fwrite("abc", 1, 3, f));
+ fclose(f);
+
+ /* Archive that one file. */
+ r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog);
+ failure("Error invoking %s cf archive.tar f1", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout or stderr. */
+ assertEmptyFile("step1.out");
+ assertEmptyFile("step1.err");
+
+
+ /* Do some basic validation of the constructed archive. */
+ p0 = slurpfile(&s, "archive.tar");
+ if (!assert(p0 != NULL))
+ return;
+ if (!assert(s >= 2048)) {
+ free(p0);
+ return;
+ }
+ assertEqualMem(p0 + 0, "f1", 3);
+ assertEqualMem(p0 + 512, "abc", 3);
+ assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8);
+ assertEqualMem(p0 + 1536, "\0\0\0\0\0\0\0\0", 8);
+
+ /* Edit that file */
+ f = fopen("f1", "w");
+ if (!assert(f != NULL))
+ return;
+ assertEqualInt(3, fwrite("123", 1, 3, f));
+ fclose(f);
+
+ /* Update the archive. */
+ r = systemf("%s rf archive.tar --format=ustar f1 >step2.out 2>step2.err", testprog);
+ failure("Error invoking %s rf archive.tar f1", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout or stderr. */
+ assertEmptyFile("step2.out");
+ assertEmptyFile("step2.err");
+
+ /* Do some basic validation of the constructed archive. */
+ p1 = slurpfile(&s, "archive.tar");
+ if (!assert(p1 != NULL)) {
+ free(p0);
+ return;
+ }
+ assert(s >= 3072);
+ /* Verify first entry is unchanged. */
+ assertEqualMem(p0, p1, 1024);
+ /* Verify that second entry is correct. */
+ assertEqualMem(p1 + 1024, "f1", 3);
+ assertEqualMem(p1 + 1536, "123", 3);
+ /* Verify end-of-archive marker. */
+ assertEqualMem(p1 + 2048, "\0\0\0\0\0\0\0\0", 8);
+ assertEqualMem(p1 + 2560, "\0\0\0\0\0\0\0\0", 8);
+ free(p0);
+ free(p1);
+
+ /* Unpack both items */
+ assertMakeDir("step3", 0775);
+ assertChdir("step3");
+ r = systemf("%s xf ../archive.tar", testprog);
+ failure("Error invoking %s xf archive.tar", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that the second one overwrote the first. */
+ f = fopen("f1", "r");
+ if (assert(f != NULL)) {
+ assertEqualInt(3, fread(buff, 1, 3, f));
+ assertEqualMem(buff, "123", 3);
+ fclose(f);
+ }
+}
diff --git a/archivers/libarchive/files/tar/test/test_option_s.c b/archivers/libarchive/files/tar/test/test_option_s.c
new file mode 100644
index 00000000000..8eb415e1cea
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_option_s.c
@@ -0,0 +1,107 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_T.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
+
+static int
+mkfile(const char *fn, const char *contents)
+{
+ FILE *f = fopen(fn, "w");
+ failure("Couldn't create file '%s', errno=%d (%s)\n",
+ fn, errno, strerror(errno));
+ if (!assert(f != NULL))
+ return (1); /* Failure. */
+ if (contents != NULL)
+ assertEqualInt(strlen(contents),
+ fwrite(contents, 1, strlen(contents), f));
+ assertEqualInt(0, fclose(f));
+ return (0); /* Success */
+}
+
+DEFINE_TEST(test_option_s)
+{
+ struct stat st;
+
+ /* Create a sample file heirarchy. */
+ assertMakeDir("in", 0755);
+ assertMakeDir("in/d1", 0755);
+ assertEqualInt(0, mkfile("in/d1/foo", "foo"));
+ assertEqualInt(0, mkfile("in/d1/bar", "bar"));
+
+ /* Does bsdtar support -s option ? */
+ systemf("%s -cf - -s /foo/bar/ in/d1/foo > NUL 2> check.err",
+ testprog);
+ assertEqualInt(0, stat("check.err", &st));
+ if (st.st_size != 0) {
+ skipping("%s does not support -s option on this platform",
+ testprog);
+ return;
+ }
+
+ /*
+ * Test 1: Filename substitution when creating archives.
+ */
+ assertMakeDir("test1", 0755);
+ systemf("%s -cf - -s /foo/bar/ in/d1/foo | %s -xf - -C test1",
+ testprog, testprog);
+ assertFileContents("foo", 3, "test1/in/d1/bar");
+ systemf("%s -cf - -s /d1/d2/ in/d1/foo | %s -xf - -C test1",
+ testprog, testprog);
+ assertFileContents("foo", 3, "test1/in/d2/foo");
+
+
+ /*
+ * Test 2: Basic substitution when extracting archive.
+ */
+ assertMakeDir("test2", 0755);
+ systemf("%s -cf - in/d1/foo | %s -xf - -s /foo/bar/ -C test2",
+ testprog, testprog);
+ assertFileContents("foo", 3, "test2/in/d1/bar");
+
+ /*
+ * Test 3: Files with empty names shouldn't be archived.
+ */
+ systemf("%s -cf - -s ,in/d1/foo,, in/d1/foo | %s -tvf - > in.lst",
+ testprog, testprog);
+ assertEmptyFile("in.lst");
+
+ /*
+ * Test 4: Multiple substitutions when extracting archive.
+ */
+ assertMakeDir("test4", 0755);
+ systemf("%s -cf - in/d1/foo in/d1/bar | %s -xf - -s /foo/bar/ -s }bar}baz} -C test4",
+ testprog, testprog);
+ assertFileContents("foo", 3, "test4/in/d1/bar");
+ assertFileContents("bar", 3, "test4/in/d1/baz");
+
+ /*
+ * Test 5: Name-switching substitutions when extracting archive.
+ */
+ assertMakeDir("test5", 0755);
+ systemf("%s -cf - in/d1/foo in/d1/bar | %s -xf - -s /foo/bar/ -s }bar}foo} -C test5",
+ testprog, testprog);
+ assertFileContents("foo", 3, "test5/in/d1/bar");
+ assertFileContents("bar", 3, "test5/in/d1/foo");
+}
diff --git a/archivers/libarchive/files/tar/test/test_patterns.c b/archivers/libarchive/files/tar/test/test_patterns.c
index e7b1679fd9d..fee98be9b27 100644
--- a/archivers/libarchive/files/tar/test/test_patterns.c
+++ b/archivers/libarchive/files/tar/test/test_patterns.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
@@ -23,25 +24,161 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_patterns.c,v 1.6 2008/08/21 22:28:00 kientzle Exp $");
DEFINE_TEST(test_patterns)
{
- int fd, r;
+ FILE *f;
+ int r;
+ const char *reffile2 = "test_patterns_2.tar";
+ const char *reffile3 = "test_patterns_3.tar";
+ const char *reffile4 = "test_patterns_4.tar";
+
+ const char *tar2aExpected[] = {
+ "/tmp/foo/bar/",
+ "/tmp/foo/bar/baz",
+ NULL
+ };
/*
* Test basic command-line pattern handling.
*/
/*
+ * Test 1: Files on the command line that don't get matched
+ * didn't produce an error.
+ *
* John Baldwin reported this problem in PR bin/121598
*/
- fd = open("foo", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- close(fd);
- r = systemf("%s zcfv tar1.tgz foo > tar1a.out 2> tar1a.err", testprog);
+ f = fopen("foo", "w");
+ assert(f != NULL);
+ fclose(f);
+ r = systemf("%s cfv tar1.tgz foo > tar1a.out 2> tar1a.err", testprog);
assertEqualInt(r, 0);
- r = systemf("%s zxfv tar1.tgz foo bar > tar1b.out 2> tar1b.err", testprog);
+ r = systemf("%s xv --no-same-owner -f tar1.tgz foo bar > tar1b.out 2> tar1b.err", testprog);
failure("tar should return non-zero because a file was given on the command line that's not in the archive");
assert(r != 0);
+
+ /*
+ * Test 2: Check basic matching of full paths that start with /
+ */
+ extract_reference_file(reffile2);
+
+ r = systemf("%s tf %s /tmp/foo/bar > tar2a.out 2> tar2a.err",
+ testprog, reffile2);
+ assertEqualInt(r, 0);
+ assertFileContainsLinesAnyOrder("tar2a.out", tar2aExpected);
+ assertEmptyFile("tar2a.err");
+
+ /*
+ * Test 3 archive has some entries starting with '/' and some not.
+ */
+ extract_reference_file(reffile3);
+
+ /* Test 3a: Pattern tmp/foo/bar should not match /tmp/foo/bar */
+ r = systemf("%s x --no-same-owner -f %s tmp/foo/bar > tar3a.out 2> tar3a.err",
+ testprog, reffile3);
+ assert(r != 0);
+ assertEmptyFile("tar3a.out");
+
+ /* Test 3b: Pattern /tmp/foo/baz should not match tmp/foo/baz */
+ assertNonEmptyFile("tar3a.err");
+ /* Again, with the '/' */
+ r = systemf("%s x --no-same-owner -f %s /tmp/foo/baz > tar3b.out 2> tar3b.err",
+ testprog, reffile3);
+ assert(r != 0);
+ assertEmptyFile("tar3b.out");
+ assertNonEmptyFile("tar3b.err");
+
+ /* Test 3c: ./tmp/foo/bar should not match /tmp/foo/bar */
+ r = systemf("%s x --no-same-owner -f %s ./tmp/foo/bar > tar3c.out 2> tar3c.err",
+ testprog, reffile3);
+ assert(r != 0);
+ assertEmptyFile("tar3c.out");
+ assertNonEmptyFile("tar3c.err");
+
+ /* Test 3d: ./tmp/foo/baz should match tmp/foo/baz */
+ r = systemf("%s x --no-same-owner -f %s ./tmp/foo/baz > tar3d.out 2> tar3d.err",
+ testprog, reffile3);
+ assertEqualInt(r, 0);
+ assertEmptyFile("tar3d.out");
+ assertEmptyFile("tar3d.err");
+ assertFileExists("tmp/foo/baz/bar");
+
+ /*
+ * Test 4 archive has some entries starting with windows drive letters
+ * such as 'c:\', '//./c:/' or '//?/c:/'.
+ */
+ extract_reference_file(reffile4);
+
+ r = systemf("%s x --no-same-owner -f %s -C tmp > tar4.out 2> tar4.err",
+ testprog, reffile4);
+ assert(r != 0);
+ assertEmptyFile("tar4.out");
+ assertNonEmptyFile("tar4.err");
+
+ for (r = 1; r <= 54; r++) {
+ char file_a[] = "tmp/fileXX";
+ char file_b1[] = "tmp/server/share/fileXX";
+ char file_b2[] = "tmp/server\\share\\fileXX";
+ char file_c[] = "tmp/../fileXX";
+ char *filex;
+ int xsize;
+
+ switch (r) {
+ case 15: case 18:
+ /*
+ * Including server and share names.
+ * //?/UNC/server/share/file15
+ * //?/unc/server/share/file18
+ */
+ filex = file_b1;
+ xsize = sizeof(file_b1);
+ break;
+ case 35: case 38: case 52:
+ /*
+ * Including server and share names.
+ * \\?\UNC\server\share\file35
+ * \\?\unc\server\share\file38
+ * \/?/uNc/server\share\file52
+ */
+ filex = file_b2;
+ xsize = sizeof(file_b2);
+ break;
+ default:
+ filex = file_a;
+ xsize = sizeof(file_a);
+ break;
+ }
+ filex[xsize-3] = '0' + r / 10;
+ filex[xsize-2] = '0' + r % 10;
+ switch (r) {
+ case 5: case 6: case 17: case 20: case 25:
+ case 26: case 37: case 40: case 43: case 54:
+ /*
+ * Not extracted patterns.
+ * D:../file05
+ * c:../../file06
+ * //?/UNC/../file17
+ * //?/unc/../file20
+ * z:..\file25
+ * c:..\..\file26
+ * \\?\UNC\..\file37
+ * \\?\unc\..\file40
+ * c:../..\file43
+ * \/?\UnC\../file54
+ */
+ assertFileNotExists(filex);
+ filex = file_c;
+ xsize = sizeof(file_c);
+ filex[xsize-3] = '0' + r / 10;
+ filex[xsize-2] = '0' + r % 10;
+ assertFileNotExists(filex);
+ break;
+ default:
+ /* Extracted patterns. */
+ assertFileExists(filex);
+ break;
+ }
+ }
}
diff --git a/archivers/libarchive/files/tar/test/test_patterns_2.tar.uu b/archivers/libarchive/files/tar/test/test_patterns_2.tar.uu
new file mode 100644
index 00000000000..eba2daece09
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_patterns_2.tar.uu
@@ -0,0 +1,231 @@
+begin 644 test_patterns_2.tar
+M+W1M<"]F;V\O````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#<U-2``,#`Q-S4P(``P,#`P,#`@`#`P,#`P,#`P,#`P
+M(#$Q,#4Q,C$R-C4V(#`Q,C0T,0`@-0``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,'1I;0``
+M````````````````````````````````````=VAE96P`````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````O=&UP+V9O;R]B87(O````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P-S4U(``P,#$W-3`@`#`P
+M,#`P,"``,#`P,#`P,#`P,#`@,3$P-3$R,3(V-3,@,#$S,C`R`"`U````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````'5S=&%R`#`P=&EM``````````````````````````````````````!W
+M:&5E;````````````````````````````````````#`P,#`P,"``,#`P,#`P
+M(```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"]T;7`O9F]O+V)A
+M>@``````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`V-#0@`#`P,3<U,"``,#`P,#`P(``P,#`P,#`P,#`P,"`Q,3`U,3(Q,C8U
+M-B`P,3,Q,C8`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'=H965L````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````+W1M<"]F;V\O8F%R+V)A>@``````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#8T-"``,#`Q-S4P(``P,#`P,#`@`#`P,#`P
+M,#`P,#`P(#$Q,#4Q,C$R-C4S(#`Q,S8V-P`@,```````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,'1I;0``````````````````````````````````````=VAE96P`````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/tar/test/test_patterns_3.tar.uu b/archivers/libarchive/files/tar/test/test_patterns_3.tar.uu
new file mode 100644
index 00000000000..de60b8dc8e1
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_patterns_3.tar.uu
@@ -0,0 +1,231 @@
+begin 644 test_patterns_3.tar
+M+W1M<"]F;V\O8F%R+P``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#<U-2``,#`Q-S4P(``P,#`P,#`@`#`P,#`P,#`P,#`P
+M(#$Q,#4S,C`W-34R(#`Q,S(P-@`@-0``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,'1I;0``
+M````````````````````````````````````=VAE96P`````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````O=&UP+V9O;R]B87(O8F%Z+P``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P-S4U(``P,#$W-3`@`#`P
+M,#`P,"``,#`P,#`P,#`P,#`@,3$P-3,R,#<U-3(@,#$S-S8R`"`U````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````'5S=&%R`#`P=&EM``````````````````````````````````````!W
+M:&5E;````````````````````````````````````#`P,#`P,"``,#`P,#`P
+M(```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````'1M<"]F;V\O8F%Z
+M+P``````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`W-34@`#`P,3<U,"``,#`P,#`P(``P,#`P,#`P,#`P,"`Q,3`U,S(P-S4V
+M,"`P,3,Q,S8`(#4`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'=H965L````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````=&UP+V9O;R]B87HO8F%R+P``````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#<U-2``,#`Q-S4P(``P,#`P,#`@`#`P,#`P
+M,#`P,#`P(#$Q,#4S,C`W-38P(#`Q,S<P,@`@-0``````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,'1I;0``````````````````````````````````````=VAE96P`````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/tar/test/test_patterns_4.tar.uu b/archivers/libarchive/files/tar/test/test_patterns_4.tar.uu
new file mode 100644
index 00000000000..240af208934
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_patterns_4.tar.uu
@@ -0,0 +1,641 @@
+begin 644 test_patterns_4.tar
+M+V9I;&4P,0``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P
+M(#$Q,34P-C<T-C0R(#`Q,#,S-@`@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````O+BXO9FEL93`R````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P-C0T(``P,#$W-3$@`#`P
+M,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$P-34R`"`P````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````'5S=&%R`#`P````````````````````````````````````````````
+M`````````````````````````````````````````#`P,#`P,"``,#`P,#`P
+M(```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"\N+B\N+B]F:6QE
+M,#,`````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T
+M,B`P,3`W-C8`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````8SHO9FEL93`T````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P
+M,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,#4W-@`@,```````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,```````````````````````````````````````````````````````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!$.BXN+V9I;&4P-0``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P-C0T(``P,#$W
+M-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$P-C<T`"`P
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P````````````````````````````````````
+M`````````````````````````````````````````````````#`P,#`P,"``
+M,#`P,#`P(```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&,Z+BXO
+M+BXO9FEL93`V````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U
+M,#8W-#8T,B`P,3$Q-#<`(#``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P,#`P(``P,#`P,#`@````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````0SHO+BXO9FEL93`W````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@
+M`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,#<U-``@,```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A.B\N+B\N+B]F:6QE,#@`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````,#`P-C0T
+M(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q
+M,C(V`"`P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````'5S=&%R`#`P````````````````````````````
+M`````````````````````````````````````````````````````````#`P
+M,#`P,"``,#`P,#`P(```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`"\O+B]C.B]F:6QE,#D`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P
+M,"`Q,3$U,#8W-#8T,B`P,3$P-S8`(#``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#``````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P,#`P(``P,#`P,#`@````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````+R\N+T,Z+RXN+V9I;&4Q,```````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````#`P,#8T-"``,#`Q-S4Q(``P
+M,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,3(T,0`@,```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!U<W1A<@`P,```````````````````````````````````````````
+M```````````````````````````````````````````P,#`P,#`@`#`P,#`P
+M,"``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````O+S\O8SHO9FEL
+M93$Q````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V
+M-#(@,#$Q,3$P`"`P````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````'5S=&%R`#`P````````````````````
+M````````````````````````````````````````````````````````````
+M`````#`P,#`P,"``,#`P,#`P(```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````"\O/R]#.B\N+B]F:6QE,3(`````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P
+M,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3$R-C0`(#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````=7-T87(`
+M,#``````````````````````````````````````````````````````````
+M````````````````````````````,#`P,#`P(``P,#`P,#`@````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````+R\O+V,Z+V9I;&4Q,P``````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````#`P,#8T-"``,#`Q
+M-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,3`W,@`@
+M,```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!U<W1A<@`P,```````````````````````````````````
+M```````````````````````````````````````````````````P,#`P,#`@
+M`#`P,#`P,"``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````O+R\O
+M0SHO+R\O+V9I;&4Q-```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q
+M-3`V-S0V-#(@,#$Q,S(W`"`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````'5S=&%R`#`P````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`P,"``,#`P,#`P(```````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````"\O/R]53D,O<V5R=F5R+W-H87)E+V9I;&4Q-0``````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q
+M(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3,V,S4`(#``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M=7-T87(`,#``````````````````````````````````````````````````
+M````````````````````````````````````,#`P,#`P(``P,#`P,#`@````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````+R\_+U5.0R]F:6QE,38`
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````#`P,#8T
+M-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q
+M,3(R-@`@,```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!U<W1A<@`P,```````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P,#`@`#`P,#`P,"``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```O+S\O54Y#+RXN+V9I;&4Q-P``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P
+M,#`@,3$Q-3`V-S0V-#(@,#$Q-#0R`"`P````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````'5S=&%R`#`P````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#`P,"``,#`P,#`P(```````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````"\O/R]U;F,O<V5R=F5R+W-H87)E+V9I;&4Q
+M.```````````````````````````````````````````````````````````
+M```````````````````````````````````````P,#`V-#0@`#`P,3<U,2``
+M,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,30P,#``(#``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````=7-T87(`,#``````````````````````````````````````````
+M````````````````````````````````````````````,#`P,#`P(``P,#`P
+M,#`@````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````+R\_+W5N8R]F
+M:6QE,3D`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T
+M-C0R(#`Q,3,W,0`@,```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!U<W1A<@`P,```````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`P,#`@`#`P,#`P,"``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````O+S\O=6YC+RXN+V9I;&4R,```````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P
+M,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q-3<T`"`P````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````'5S=&%R
+M`#`P````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#`P,"``,#`P,#`P(```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````%QF:6QE,C$`````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````P,#`V-#0@`#`P
+M,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3`T,34`
+M(#``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````=7-T87(`,#``````````````````````````````````
+M````````````````````````````````````````````````````,#`P,#`P
+M(``P,#`P,#`@````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````7"XN
+M7&9I;&4R,@``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q
+M,34P-C<T-C0R(#`Q,#<P-@`@,```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!U<W1A<@`P,```````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P,#`@`#`P,#`P,"``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!<+BY<+BY<9FEL93(S````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U
+M,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q,3<W`"`P````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`'5S=&%R`#`P````````````````````````````````````````````````
+M`````````````````````````````````````#`P,#`P,"``,#`P,#`P(```
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````$,Z7&9I;&4R-```````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````P,#`V
+M-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P
+M,3`V,34`(#``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````=7-T87(`,#``````````````````````````
+M````````````````````````````````````````````````````````````
+M,#`P,#`P(``P,#`P,#`@````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````>CHN+EQF:6QE,C4`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P
+M,#`P(#$Q,34P-C<T-C0R(#`Q,3`T,0`@,```````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!U<W1A<@`P,```
+M````````````````````````````````````````````````````````````
+M```````````````````````P,#`P,#`@`#`P,#`P,"``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!C.BXN7"XN7&9I;&4R-@``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````,#`P-C0T(``P,#$W-3$@
+M`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q,S`S`"`P````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````'5S=&%R`#`P````````````````````````````````````````
+M`````````````````````````````````````````````#`P,#`P,"``,#`P
+M,#`P(```````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````%HZ7"XN7&9I
+M;&4R-P``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W
+M-#8T,B`P,3$Q,S<`(#``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````=7-T87(`,#``````````````````
+M````````````````````````````````````````````````````````````
+M````````,#`P,#`P(``P,#`P,#`@````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````0SI<+BY<+BY<9FEL93(X````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P
+M,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,30P,0`@,```````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!U<W1A
+M<@`P,```````````````````````````````````````````````````````
+M```````````````````````````````P,#`P,#`@`#`P,#`P,"``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!<7"Y<8SI<9FEL93(Y````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````,#`P-C0T(``P
+M,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q,S8T
+M`"`P````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````'5S=&%R`#`P````````````````````````````````
+M`````````````````````````````````````````````````````#`P,#`P
+M,"``,#`P,#`P(```````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````%Q<
+M+EQ#.EPN+EQF:6QE,S``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q
+M,3$U,#8W-#8T,B`P,3$V,#0`(#``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````=7-T87(`,#``````````
+M````````````````````````````````````````````````````````````
+M````````````````,#`P,#`P(``P,#`P,#`@````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````7%P_7&,Z7&9I;&4S,0``````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W
+M-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,3,W-@`@,```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!U<W1A<@`P,```````````````````````````````````````````````
+M```````````````````````````````````````P,#`P,#`@`#`P,#`P,"``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!<7#]<1#I<+BY<9FEL
+M93,R````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````,#`P
+M-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@
+M,#$Q-C,P`"`P````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````'5S=&%R`#`P````````````````````````
+M````````````````````````````````````````````````````````````
+M`#`P,#`P,"``,#`P,#`P(```````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````%Q<7%QC.EQF:6QE,S,`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P
+M,#`P,"`Q,3$U,#8W-#8T,B`P,3$T,S4`(#``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````=7-T87(`,#``
+M````````````````````````````````````````````````````````````
+M````````````````````````,#`P,#`P(``P,#`P,#`@````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````7%Q<7$,Z7%Q<7%QF:6QE,S0`````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````#`P,#8T-"``,#`Q-S4Q
+M(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,C$U-@`@,```
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!U<W1A<@`P,```````````````````````````````````````
+M```````````````````````````````````````````````P,#`P,#`@`#`P
+M,#`P,"``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!<7#]<54Y#
+M7'-E<G9E<EQS:&%R95QF:6QE,S4`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V
+M-S0V-#(@,#$T,C4U`"`P````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````'5S=&%R`#`P````````````````
+M````````````````````````````````````````````````````````````
+M`````````#`P,#`P,"``,#`P,#`P(```````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````%Q</UQ53D-<9FEL93,V````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P
+M,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3$U,30`(#``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````=7-T
+M87(`,#``````````````````````````````````````````````````````
+M````````````````````````````````,#`P,#`P(``P,#`P,#`@````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````7%P_7%5.0UPN+EQF:6QE,S<`
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````#`P,#8T-"``
+M,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,C`P
+M-0`@,```````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!U<W1A<@`P,```````````````````````````````
+M```````````````````````````````````````````````````````P,#`P
+M,#`@`#`P,#`P,"``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!<
+M7#]<=6YC7'-E<G9E<EQS:&%R95QF:6QE,S@`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@
+M,3$Q-3`V-S0V-#(@,#$T-#(P`"`P````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````'5S=&%R`#`P````````
+M````````````````````````````````````````````````````````````
+M`````````````````#`P,#`P,"``,#`P,#`P(```````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````%Q</UQU;F-<9FEL93,Y````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````P,#`V-#0@`#`P,3<U,2``,#`Q
+M-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3$V-3<`(#``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````=7-T87(`,#``````````````````````````````````````````````
+M````````````````````````````````````````,#`P,#`P(``P,#`P,#`@
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````7%P_7'5N8UPN+EQF
+M:6QE-#``````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````#`P
+M,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R
+M(#`Q,C$S-P`@,```````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!U<W1A<@`P,```````````````````````
+M````````````````````````````````````````````````````````````
+M```P,#`P,#`@`#`P,#`P,"``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!<+BXO9FEL930Q````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P
+M,#`P,#`@,3$Q-3`V-S0V-#(@,#$P-C,R`"`P````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````'5S=&%R`#`P
+M````````````````````````````````````````````````````````````
+M`````````````````````````#`P,#`P,"``,#`P,#`P(```````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````%PN+B\N+EQF:6QE-#(`````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````P,#`V-#0@`#`P,3<U
+M,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3$Q,C,`(#``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````=7-T87(`,#``````````````````````````````````````
+M````````````````````````````````````````````````,#`P,#`P(``P
+M,#`P,#`@````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````8SHN+B\N
+M+EQF:6QE-#,`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P(#$Q,34P
+M-C<T-C0R(#`Q,3(R-0`@,```````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!U<W1A<@`P,```````````````
+M````````````````````````````````````````````````````````````
+M```````````P,#`P,#`@`#`P,#`P,"``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!#.B\N+EQF:6QE-#0`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````,#`P-C0T(``P,#$W-3$@`#`P,3<U,2``
+M,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q,#,R`"`P````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````'5S
+M=&%R`#`P````````````````````````````````````````````````````
+M`````````````````````````````````#`P,#`P,"``,#`P,#`P(```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````$0Z7"XN+RXN7&9I;&4T-0``
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````P,#`V-#0@
+M`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T,B`P,3$S
+M,C0`(#``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````=7-T87(`,#``````````````````````````````
+M````````````````````````````````````````````````````````,#`P
+M,#`P(``P,#`P,#`@````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M7"\N+V,Z7&9I;&4T-@``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P,#`P,#`P
+M(#$Q,34P-C<T-C0R(#`Q,3(S,0`@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!<7"XO0SI<+BY<9FEL930W````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P-C0T(``P,#$W-3$@`#`P
+M,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q-3,W`"`P````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````'5S=&%R`#`P````````````````````````````````````````````
+M`````````````````````````````````````````#`P,#`P,"``,#`P,#`P
+M(```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````%PO/UQC.B]F:6QE
+M-#@`````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U,#8W-#8T
+M,B`P,3$R-30`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````7%P_+T0Z+RXN7&9I;&4T.0``````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@`#`P,#`P
+M,#`P,#`P(#$Q,34P-C<T-C0R(#`Q,34P-@`@,```````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,```````````````````````````````````````````````````````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!<+R]<1#I<9FEL934P````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P-C0T(``P,#$W
+M-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q,C0S`"`P
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P````````````````````````````````````
+M`````````````````````````````````````````````````#`P,#`P,"``
+M,#`P,#`P(```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````%Q<+R]C
+M.EPO+UQ<9FEL934Q````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P,"`Q,3$U
+M,#8W-#8T,B`P,3$W,S$`(#``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P,#`P(``P,#`P,#`@````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````7"\_+W5.8R]S97)V97)<<VAA<F5<9FEL934R````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#8T-"``,#`Q-S4Q(``P,#$W-3$@
+M`#`P,#`P,#`P,#`P(#$Q,34P-C<T-C0R(#`Q-#$T-0`@,```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!<7#\O54YC7&9I;&4U,P``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````,#`P-C0T
+M(``P,#$W-3$@`#`P,3<U,2``,#`P,#`P,#`P,#`@,3$Q-3`V-S0V-#(@,#$Q
+M-#<V`"`P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````'5S=&%R`#`P````````````````````````````
+M`````````````````````````````````````````````````````````#`P
+M,#`P,"``,#`P,#`P(```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`%PO/UQ5;D-<+BXO9FEL934T````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`V-#0@`#`P,3<U,2``,#`Q-S4Q(``P,#`P,#`P,#`P
+M,"`Q,3$U,#8W-#8T,B`P,3$W,3(`(#``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#``````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P,#`P(``P,#`P,#`@````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+'````````````
+`
+end
diff --git a/archivers/libarchive/files/tar/test/test_stdio.c b/archivers/libarchive/files/tar/test/test_stdio.c
index d770cf11f40..b95a4e30542 100644
--- a/archivers/libarchive/files/tar/test/test_stdio.c
+++ b/archivers/libarchive/files/tar/test/test_stdio.c
@@ -27,27 +27,27 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_stdio.c,v 1.2 2008/05/26 17:10:10
DEFINE_TEST(test_stdio)
{
- int fd;
- int filelist;
- int oldumask;
+ FILE *filelist;
+ char *p;
+ size_t s;
int r;
- oldumask = umask(0);
+ assertUmask(0);
/*
* Create a couple of files on disk.
*/
- filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
/* File */
- fd = open("f", O_CREAT | O_WRONLY, 0644);
- assert(fd >= 0);
- write(fd, "f\n", 2);
- close(fd);
- write(filelist, "f\n", 2);
+ assertMakeFile("f", 0755, "abc");
/* Link to above file. */
- assertEqualInt(0, link("f", "l"));
- write(filelist, "l\n", 2);
- close(filelist);
+ assertMakeHardlink("l", "f");
+
+ /* Create file list (text mode here) */
+ filelist = fopen("filelist", "w");
+ assert(filelist != NULL);
+ fprintf(filelist, "f\n");
+ fprintf(filelist, "l\n");
+ fclose(filelist);
/*
* Archive/dearchive with a variety of options, verifying
@@ -111,7 +111,10 @@ DEFINE_TEST(test_stdio)
/* 'xvOf' should generate list on stderr, file contents on stdout. */
r = systemf("%s xvOf archive >xvOf.out 2>xvOf.err", testprog);
assertEqualInt(r, 0);
- /* TODO: Verify xvOf.out */
+ /* Verify xvOf.out is the file contents */
+ p = slurpfile(&s, "xvOf.out");
+ assert(s = 3);
+ assertEqualMem(p, "abc", 3);
/* TODO: Verify xvf.err */
/* 'xvf -' should generate list on stderr, empty stdout. */
@@ -119,6 +122,4 @@ DEFINE_TEST(test_stdio)
assertEqualInt(r, 0);
assertEmptyFile("xvf-.out");
/* TODO: Verify xvf-.err */
-
- umask(oldumask);
}
diff --git a/archivers/libarchive/files/tar/test/test_strip_components.c b/archivers/libarchive/files/tar/test/test_strip_components.c
new file mode 100644
index 00000000000..c9028a4d766
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_strip_components.c
@@ -0,0 +1,109 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_strip_components.c,v 1.2 2008/11/10 05:24:13 kientzle Exp $");
+
+static int
+touch(const char *fn)
+{
+ FILE *f = fopen(fn, "w");
+ failure("Couldn't create file '%s', errno=%d (%s)\n",
+ fn, errno, strerror(errno));
+ if (!assert(f != NULL))
+ return (0); /* Failure. */
+ fclose(f);
+ return (1); /* Success */
+}
+
+DEFINE_TEST(test_strip_components)
+{
+ assertMakeDir("d0", 0755);
+ assertChdir("d0");
+ assertMakeDir("d1", 0755);
+ assertMakeDir("d1/d2", 0755);
+ assertMakeDir("d1/d2/d3", 0755);
+ assertEqualInt(1, touch("d1/d2/f1"));
+ assertMakeHardlink("l1", "d1/d2/f1");
+ assertMakeHardlink("d1/l2", "d1/d2/f1");
+ if (canSymlink()) {
+ assertMakeSymlink("s1", "d1/d2/f1");
+ assertMakeSymlink("d1/s2", "d2/f1");
+ }
+ assertChdir("..");
+
+ assertEqualInt(0, systemf("%s -cf test.tar d0", testprog));
+
+ assertMakeDir("target", 0755);
+ assertEqualInt(0, systemf("%s -x -C target --strip-components 2 "
+ "-f test.tar", testprog));
+
+ failure("d0/ is too short and should not get restored");
+ assertFileNotExists("target/d0");
+ failure("d0/d1/ is too short and should not get restored");
+ assertFileNotExists("target/d1");
+ failure("d0/d1/s2 is a symlink to something that won't be extracted");
+ /* If platform supports symlinks, target/s2 is a broken symlink. */
+ /* If platform does not support symlink, target/s2 doesn't exist. */
+ assertFileNotExists("target/s2");
+ if (canSymlink())
+ assertIsSymlink("target/s2", "d2/f1");
+ failure("d0/d1/d2 should be extracted");
+ assertIsDir("target/d2", -1);
+
+ /*
+ * This next is a complicated case. d0/l1, d0/d1/l2, and
+ * d0/d1/d2/f1 are all hardlinks to the same file; d0/l1 can't
+ * be extracted with --strip-components=2 and the other two
+ * can. Remember that tar normally stores the first file with
+ * a body and the other as hardlink entries to the first
+ * appearance. So the final result depends on the order in
+ * which these three names get archived. If d0/l1 is first,
+ * none of the three can be restored. If either of the longer
+ * names are first, then the two longer ones can both be
+ * restored.
+ *
+ * The tree-walking code used by bsdtar always visits files
+ * before subdirectories, so bsdtar's behavior is fortunately
+ * deterministic: d0/l1 will always get stored first and the
+ * other two will be stored as hardlinks to d0/l1. Since
+ * d0/l1 can't be extracted, none of these three will be
+ * extracted.
+ *
+ * It may be worth extending this test to force a particular
+ * archiving order so as to exercise both of the cases described
+ * above.
+ *
+ * Of course, this is all totally different for cpio and newc
+ * formats because the hardlink management is different.
+ * TODO: Rename this to test_strip_components_tar and create
+ * parallel tests for cpio and newc formats.
+ */
+ failure("d0/l1 is too short and should not get restored");
+ assertFileNotExists("target/l1");
+ failure("d0/d1/l2 is a hardlink to file whose name was too short");
+ assertFileNotExists("target/l2");
+ failure("d0/d1/d2/f1 is a hardlink to file whose name was too short");
+ assertFileNotExists("target/d2/f1");
+}
diff --git a/archivers/libarchive/files/tar/test/test_symlink_dir.c b/archivers/libarchive/files/tar/test/test_symlink_dir.c
new file mode 100644
index 00000000000..aa80ba68e31
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_symlink_dir.c
@@ -0,0 +1,160 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_symlink_dir.c,v 1.1 2008/09/14 02:16:04 kientzle Exp $");
+
+/*
+ * tar -x -P should follow existing symlinks for dirs, but not other
+ * content. Plain tar -x should remove symlinks when they're in the
+ * way of a dir extraction.
+ */
+
+static int
+mkfile(const char *name, int mode, const char *contents, size_t size)
+{
+ FILE *f = fopen(name, "wb");
+ size_t written;
+
+ (void)mode; /* UNUSED */
+ if (f == NULL)
+ return (-1);
+ written = fwrite(contents, 1, size, f);
+ fclose(f);
+ if (size != written)
+ return (-1);
+ return (0);
+}
+
+DEFINE_TEST(test_symlink_dir)
+{
+ assertUmask(0);
+
+ assertMakeDir("source", 0755);
+ assertEqualInt(0, mkfile("source/file", 0755, "a", 1));
+ assertEqualInt(0, mkfile("source/file2", 0755, "ab", 2));
+ assertMakeDir("source/dir", 0755);
+ assertMakeDir("source/dir/d", 0755);
+ assertEqualInt(0, mkfile("source/dir/f", 0755, "abc", 3));
+ assertMakeDir("source/dir2", 0755);
+ assertMakeDir("source/dir2/d2", 0755);
+ assertEqualInt(0, mkfile("source/dir2/f2", 0755, "abcd", 4));
+ assertMakeDir("source/dir3", 0755);
+ assertMakeDir("source/dir3/d3", 0755);
+ assertEqualInt(0, mkfile("source/dir3/f3", 0755, "abcde", 5));
+
+ assertEqualInt(0,
+ systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
+ testprog));
+
+ /*
+ * Extract with -x and without -P.
+ */
+ assertMakeDir("dest1", 0755);
+ /* "dir" is a symlink to an existing "dest1/real_dir" */
+ assertMakeDir("dest1/real_dir", 0755);
+ if (canSymlink()) {
+ assertMakeSymlink("dest1/dir", "real_dir");
+ /* "dir2" is a symlink to a non-existing "real_dir2" */
+ assertMakeSymlink("dest1/dir2", "real_dir2");
+ } else {
+ skipping("some symlink checks");
+ }
+ /* "dir3" is a symlink to an existing "non_dir3" */
+ assertEqualInt(0, mkfile("dest1/non_dir3", 0755, "abcdef", 6));
+ if (canSymlink())
+ assertMakeSymlink("dest1/dir3", "non_dir3");
+ /* "file" is a symlink to existing "real_file" */
+ assertEqualInt(0, mkfile("dest1/real_file", 0755, "abcdefg", 7));
+ if (canSymlink()) {
+ assertMakeSymlink("dest1/file", "real_file");
+ /* "file2" is a symlink to non-existing "real_file2" */
+ assertMakeSymlink("dest1/file2", "real_file2");
+ }
+ assertEqualInt(0, systemf("%s -xf test.tar -C dest1", testprog));
+
+ /* dest1/dir symlink should be replaced */
+ failure("symlink to dir was followed when it shouldn't be");
+ assertIsDir("dest1/dir", -1);
+ /* dest1/dir2 symlink should be replaced */
+ failure("Broken symlink wasn't replaced with dir");
+ assertIsDir("dest1/dir2", -1);
+ /* dest1/dir3 symlink should be replaced */
+ failure("Symlink to non-dir wasn't replaced with dir");
+ assertIsDir("dest1/dir3", -1);
+ /* dest1/file symlink should be replaced */
+ failure("Symlink to existing file should be replaced");
+ assertIsReg("dest1/file", -1);
+ /* dest1/file2 symlink should be replaced */
+ failure("Symlink to non-existing file should be replaced");
+ assertIsReg("dest1/file2", -1);
+
+ /*
+ * Extract with both -x and -P
+ */
+ assertMakeDir("dest2", 0755);
+ /* "dir" is a symlink to existing "real_dir" */
+ assertMakeDir("dest2/real_dir", 0755);
+ if (canSymlink())
+ assertMakeSymlink("dest2/dir", "real_dir");
+ /* "dir2" is a symlink to a non-existing "real_dir2" */
+ if (canSymlink())
+ assertMakeSymlink("dest2/dir2", "real_dir2");
+ /* "dir3" is a symlink to an existing "non_dir3" */
+ assertEqualInt(0, mkfile("dest2/non_dir3", 0755, "abcdefgh", 8));
+ if (canSymlink())
+ assertMakeSymlink("dest2/dir3", "non_dir3");
+ /* "file" is a symlink to existing "real_file" */
+ assertEqualInt(0, mkfile("dest2/real_file", 0755, "abcdefghi", 9));
+ if (canSymlink())
+ assertMakeSymlink("dest2/file", "real_file");
+ /* "file2" is a symlink to non-existing "real_file2" */
+ if (canSymlink())
+ assertMakeSymlink("dest2/file2", "real_file2");
+ assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
+
+ /* dest2/dir symlink should be followed */
+ if (canSymlink()) {
+ assertIsSymlink("dest2/dir", "real_dir");
+ assertIsDir("dest2/real_dir", -1);
+ }
+
+ /* Contents of 'dir' should be restored */
+ assertIsDir("dest2/dir/d", -1);
+ assertIsReg("dest2/dir/f", -1);
+ assertFileSize("dest2/dir/f", 3);
+ /* dest2/dir2 symlink should be removed */
+ failure("Broken symlink wasn't replaced with dir");
+ assertIsDir("dest2/dir2", -1);
+ /* dest2/dir3 symlink should be removed */
+ failure("Symlink to non-dir wasn't replaced with dir");
+ assertIsDir("dest2/dir3", -1);
+ /* dest2/file symlink should be removed;
+ * even -P shouldn't follow symlinks for files */
+ failure("Symlink to existing file should be removed");
+ assertIsReg("dest2/file", -1);
+ /* dest2/file2 symlink should be removed */
+ failure("Symlink to non-existing file should be removed");
+ assertIsReg("dest2/file2", -1);
+}
diff --git a/archivers/libarchive/files/tar/test/test_version.c b/archivers/libarchive/files/tar/test/test_version.c
index 6ed656d8024..42472d1bc26 100644
--- a/archivers/libarchive/files/tar/test/test_version.c
+++ b/archivers/libarchive/files/tar/test/test_version.c
@@ -51,8 +51,9 @@ DEFINE_TEST(test_version)
q = p = slurpfile(&s, "version.stdout");
/* Version message should start with name of program, then space. */
assert(s > 6);
- failure("Version: %s", p);
- assertEqualMem(q, "bsdtar ", 7);
+ failure("Version must start with 'bsdtar': ``%s''", p);
+ if (!assertEqualMem(q, "bsdtar ", 7))
+ return;
q += 7; s -= 7;
/* Version number is a series of digits and periods. */
while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
@@ -60,22 +61,22 @@ DEFINE_TEST(test_version)
--s;
}
/* Version number terminated by space. */
- failure("Version: %s", p);
+ failure("No space after bsdtar version: ``%s''", p);
assert(s > 1);
/* Skip a single trailing a,b,c, or d. */
if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
++q;
- failure("Version: %s", p);
+ failure("No space after bsdtar version: ``%s''", p);
assert(*q == ' ');
++q; --s;
/* Separator. */
- failure("Version: %s", p);
+ failure("No `-' between bsdtar and libarchive versions: ``%s''", p);
assertEqualMem(q, "- ", 2);
q += 2; s -= 2;
/* libarchive name and version number */
- failure("Version: %s", p);
+ failure("Not long enough for libarchive version: ``%s''", p);
assert(s > 11);
- failure("Version: %s", p);
+ failure("Libarchive version must start with `libarchive': ``%s''", p);
assertEqualMem(q, "libarchive ", 11);
q += 11; s -= 11;
/* Version number is a series of digits and periods. */
@@ -86,8 +87,11 @@ DEFINE_TEST(test_version)
/* Skip a single trailing a,b,c, or d. */
if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
++q;
- /* All terminated by a newline. */
+ /* All terminated by end-of-line. */
assert(s >= 1);
+ /* Skip an optional CR character (e.g., Windows) */
+ failure("Version output must end with \\n or \\r\\n");
+ if (*q == '\r') { ++q; --s; }
assertEqualMem(q, "\n", 1);
free(p);
}
diff --git a/archivers/libarchive/files/tar/test/test_windows.c b/archivers/libarchive/files/tar/test/test_windows.c
new file mode 100644
index 00000000000..a2d0c214b95
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_windows.c
@@ -0,0 +1,323 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+
+static void
+mkfile(const char *name)
+{
+ FILE *f;
+
+ f = fopen(name, "wb");
+ assert(f != NULL);
+ assertEqualInt(5, fwrite("01234", 1, 5, f));
+ fclose(f);
+}
+
+static void
+mkfullpath(char **path1, char **path2, const char *tpath, int type)
+{
+ char *fp1 = NULL, *fp2 = NULL, *p1 = NULL, *p2 = NULL;
+ size_t l;
+
+ /*
+ * Get full path name of "tpath"
+ */
+ l = GetFullPathNameA(tpath, 0, NULL, NULL);
+ assert(0 != l);
+ fp1 = malloc(l);
+ assert(NULL != fp1);
+ fp2 = malloc(l*2);
+ assert(NULL != fp2);
+ l = GetFullPathNameA(tpath, l, fp1, NULL);
+ if ((type & 0x01) == 0) {
+ for (p1 = fp1; *p1 != '\0'; p1++)
+ if (*p1 == '\\')
+ *p1 = '/';
+ }
+
+ switch(type) {
+ case 0: /* start with "/" */
+ case 1: /* start with "\" */
+ /* strip "c:" */
+ memmove(fp1, fp1 + 2, l - 2);
+ fp1[l -2] = '\0';
+ p1 = fp1 + 1;
+ break;
+ case 2: /* start with "c:/" */
+ case 3: /* start with "c:\" */
+ p1 = fp1 + 3;
+ break;
+ case 4: /* start with "//./c:/" */
+ case 5: /* start with "\\.\c:\" */
+ case 6: /* start with "//?/c:/" */
+ case 7: /* start with "\\?\c:\" */
+ p1 = malloc(l + 4 + 1);
+ assert(NULL != p1);
+ if (type & 0x1)
+ memcpy(p1, "\\\\.\\", 4);
+ else
+ memcpy(p1, "//./", 4);
+ if (type == 6 || type == 7)
+ p1[2] = '?';
+ memcpy(p1 + 4, fp1, l);
+ p1[l + 4] = '\0';
+ free(fp1);
+ fp1 = p1;
+ p1 = fp1 + 7;
+ break;
+ }
+
+ /*
+ * Strip leading drive names and converting "\" to "\\"
+ */
+ p2 = fp2;
+ while (*p1 != '\0') {
+ if (*p1 == '\\')
+ *p2 = '/';
+ else
+ *p2 = *p1;
+ ++p1;
+ ++p2;
+ }
+ *p2++ = '\r';
+ *p2++ = '\n';
+ *p2 = '\0';
+
+ *path1 = fp1;
+ *path2 = fp2;
+}
+
+static const char *list1[] = {"aaa/", "aaa/file1", "aaa/xxa/", "aaa/xxb/",
+ "aaa/zzc/", "aaa/zzc/file1", "aaa/xxb/file1", "aaa/xxa/file1",
+ "aab/", "aac/", "abb/", "abc/", "abd/", NULL};
+static const char *list2[] = {"bbb/", "bbb/file1", "bbb/xxa/", "bbb/xxb/",
+ "bbb/zzc/", "bbb/zzc/file1", "bbb/xxb/file1", "bbb/xxa/file1", "bbc/",
+ "bbd/", "bcc/", "bcd/", "bce/", NULL};
+static const char *list3[] = {"aac/", "abc/", "bbc/", "bcc/", "ccc/", NULL};
+static const char *list4[] = {"fff/abca", "fff/acca", NULL};
+static const char *list5[] = {"aaa/file1", "aaa/xxa/", "aaa/xxa/file1",
+ "aaa/xxb/", "aaa/xxb/file1", "aaa/zzc/", "aaa/zzc/file1", NULL};
+static const char *list6[] = {"fff/abca", "fff/acca", "aaa/xxa/",
+ "aaa/xxa/file1", "aaa/xxb/", "aaa/xxb/file1", NULL};
+#endif /* _WIN32 && !__CYGWIN__ */
+
+DEFINE_TEST(test_windows)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ char *fp1, *fp2;
+
+ /*
+ * Preparre tests.
+ * Create directories and files.
+ */
+ assertMakeDir("tmp", 0775);
+ assertChdir("tmp");
+
+ assertMakeDir("aaa", 0775);
+ assertMakeDir("aaa/xxa", 0775);
+ assertMakeDir("aaa/xxb", 0775);
+ assertMakeDir("aaa/zzc", 0775);
+ mkfile("aaa/file1");
+ mkfile("aaa/xxa/file1");
+ mkfile("aaa/xxb/file1");
+ mkfile("aaa/zzc/file1");
+ assertMakeDir("aab", 0775);
+ assertMakeDir("aac", 0775);
+ assertMakeDir("abb", 0775);
+ assertMakeDir("abc", 0775);
+ assertMakeDir("abd", 0775);
+ assertMakeDir("bbb", 0775);
+ assertMakeDir("bbb/xxa", 0775);
+ assertMakeDir("bbb/xxb", 0775);
+ assertMakeDir("bbb/zzc", 0775);
+ mkfile("bbb/file1");
+ mkfile("bbb/xxa/file1");
+ mkfile("bbb/xxb/file1");
+ mkfile("bbb/zzc/file1");
+ assertMakeDir("bbc", 0775);
+ assertMakeDir("bbd", 0775);
+ assertMakeDir("bcc", 0775);
+ assertMakeDir("bcd", 0775);
+ assertEqualInt(0, _mkdir("bce"));
+ assertEqualInt(0, _mkdir("ccc"));
+ assertEqualInt(0, _mkdir("fff"));
+ mkfile("fff/aaaa");
+ mkfile("fff/abba");
+ mkfile("fff/abca");
+ mkfile("fff/acba");
+ mkfile("fff/acca");
+
+ /*
+ * Test1: Command line pattern matching.
+ */
+ assertEqualInt(0,
+ systemf("%s -cf ../archive1.tar a*", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive1.tar > ../list1", testprog));
+ assertFileContainsLinesAnyOrder("../list1", list1);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive2.tar b*", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive2.tar > ../list2", testprog));
+ assertFileContainsLinesAnyOrder("../list2", list2);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive3.tar ??c", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive3.tar > ../list3", testprog));
+ assertFileContainsLinesAnyOrder("../list3", list3);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive3b.tar *c", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive3b.tar > ../list3b", testprog));
+ assertFileContainsLinesAnyOrder("../list3b", list3);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive4.tar fff/a?ca", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive4.tar > ../list4", testprog));
+ assertFileContainsLinesAnyOrder("../list4", list4);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive5.tar aaa\\*", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive5.tar > ../list5", testprog));
+ assertFileContainsLinesAnyOrder("../list5", list5);
+
+ assertEqualInt(0,
+ systemf("%s -cf ../archive6.tar fff\\a?ca aaa\\xx*", testprog));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive6.tar > ../list6", testprog));
+ assertFileContainsLinesAnyOrder("../list6", list6);
+
+ /*
+ * Test2: Archive the file start with drive letters.
+ */
+ /* Test2a: start with "/" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 0);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive10.tar %s > ../out10 2> ../err10",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive10.tar > ../list10", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list10");
+ free(fp1);
+ free(fp2);
+
+ /* Test2b: start with "\" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 1);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive11.tar %s > ../out11 2> ../err11",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive11.tar > ../list11", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list11");
+ free(fp1);
+ free(fp2);
+
+ /* Test2c: start with "c:/" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 2);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive12.tar %s > ../out12 2> ../err12",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive12.tar > ../list12", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list12");
+ free(fp1);
+ free(fp2);
+
+ /* Test2d: start with "c:\" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 3);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive13.tar %s > ../out13 2> ../err13",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive13.tar > ../list13", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list13");
+ free(fp1);
+ free(fp2);
+
+ /* Test2e: start with "//./c:/" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 4);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive14.tar %s > ../out14 2> ../err14",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive14.tar > ../list14", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list14");
+ free(fp1);
+ free(fp2);
+
+ /* Test2f: start with "\\.\c:\" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 5);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive15.tar %s > ../out15 2> ../err15",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive15.tar > ../list15", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list15");
+ free(fp1);
+ free(fp2);
+
+ /* Test2g: start with "//?/c:/" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 6);
+ failure("fp1=%s, fp2=%s", fp1, fp2);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive16.tar %s > ../out16 2> ../err16",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive16.tar > ../list16", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list16");
+ free(fp1);
+ free(fp2);
+
+ /* Test2h: start with "\\?\c:\" */
+ mkfullpath(&fp1, &fp2, "aaa/file1", 7);
+ failure("fp1=%s, fp2=%s", fp1, fp2);
+ assertEqualInt(0,
+ systemf("%s -cf ../archive17.tar %s > ../out17 2> ../err17",
+ testprog, fp1));
+ assertEqualInt(0,
+ systemf("%s -tf ../archive17.tar > ../list17", testprog));
+ /* Check drive letters have been stripped. */
+ assertFileContents(fp2, strlen(fp2), "../list17");
+ free(fp1);
+ free(fp2);
+#else
+ skipping("Windows specific test");
+#endif /* _WIN32 && !__CYGWIN__ */
+}
diff --git a/archivers/libarchive/files/tar/tree.c b/archivers/libarchive/files/tar/tree.c
index 23e64e3da06..6504ebf7d06 100644
--- a/archivers/libarchive/files/tar/tree.c
+++ b/archivers/libarchive/files/tar/tree.c
@@ -18,6 +18,7 @@
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -43,11 +44,14 @@
* regular dir or via fchdir(2) for a symlink).
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/tree.c,v 1.8 2007/03/11 10:36:42 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/tree.c,v 1.9 2008/11/27 05:49:52 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
@@ -66,6 +70,9 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/tree.c,v 1.8 2007/03/11 10:36:42 kientzle Ex
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
#include "tree.h"
@@ -76,21 +83,38 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/tree.c,v 1.8 2007/03/11 10:36:42 kientzle Ex
*/
struct tree_entry {
+ int depth;
struct tree_entry *next;
struct tree_entry *parent;
char *name;
size_t dirname_length;
dev_t dev;
ino_t ino;
- int fd;
int flags;
+ /* How to return back to the parent of a symlink. */
+#ifdef HAVE_FCHDIR
+ int symlink_parent_fd;
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ char *symlink_parent_path;
+#else
+#error fchdir function required.
+#endif
};
/* Definitions for tree_entry.flags bitmap. */
#define isDir 1 /* This entry is a regular directory. */
#define isDirLink 2 /* This entry is a symbolic link to a directory. */
-#define needsPreVisit 4 /* This entry needs to be previsited. */
-#define needsPostVisit 8 /* This entry needs to be postvisited. */
+#define needsFirstVisit 4 /* This is an initial entry. */
+#define needsDescent 8 /* This entry needs to be previsited. */
+#define needsOpen 16 /* This is a directory that needs to be opened. */
+#define needsAscent 32 /* This entry needs to be postvisited. */
+
+/*
+ * On Windows, "first visit" is handled as a pattern to be handed to
+ * _findfirst(). This is consistent with Windows conventions that
+ * file patterns are handled within the application. On Posix,
+ * "first visit" is just returned to the client.
+ */
/*
* Local data for this package.
@@ -98,17 +122,28 @@ struct tree_entry {
struct tree {
struct tree_entry *stack;
struct tree_entry *current;
+#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
+ HANDLE d;
+ BY_HANDLE_FILE_INFORMATION fileInfo;
+#define INVALID_DIR_HANDLE INVALID_HANDLE_VALUE
+ WIN32_FIND_DATA _findData;
+ WIN32_FIND_DATA *findData;
+#else
DIR *d;
- int initialDirFd;
+#define INVALID_DIR_HANDLE NULL
+ struct dirent *de;
+#endif
int flags;
int visit_type;
int tree_errno; /* Error code from last failed operation. */
+ /* Dynamically-sized buffer for holding path */
char *buff;
- const char *basename;
size_t buff_length;
- size_t path_length;
- size_t dirname_length;
+
+ const char *basename; /* Last path element */
+ size_t dirname_length; /* Leading dir length */
+ size_t path_length; /* Total path length */
int depth;
int openCount;
@@ -119,10 +154,17 @@ struct tree {
};
/* Definitions for tree.flags bitmap. */
-#define needsReturn 8 /* Marks first entry as not having been returned yet. */
-#define hasStat 16 /* The st entry is set. */
-#define hasLstat 32 /* The lst entry is set. */
+#define hasStat 16 /* The st entry is valid. */
+#define hasLstat 32 /* The lst entry is valid. */
+#define hasFileInfo 64 /* The Windows fileInfo entry is valid. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static int
+tree_dir_next_windows(struct tree *t, const char *pattern);
+#else
+static int
+tree_dir_next_posix(struct tree *t);
+#endif
#ifdef HAVE_DIRENT_D_NAMLEN
/* BSD extension; avoids need for a strlen() call. */
@@ -131,25 +173,32 @@ struct tree {
#define D_NAMELEN(dp) (strlen((dp)->d_name))
#endif
-#if 0
#include <stdio.h>
void
tree_dump(struct tree *t, FILE *out)
{
+ char buff[300];
struct tree_entry *te;
fprintf(out, "\tdepth: %d\n", t->depth);
fprintf(out, "\tbuff: %s\n", t->buff);
- fprintf(out, "\tpwd: "); fflush(stdout); system("pwd");
- fprintf(out, "\taccess: %s\n", t->basename);
+ fprintf(out, "\tpwd: %s\n", getcwd(buff, sizeof(buff)));
+ fprintf(out, "\tbasename: %s\n", t->basename);
fprintf(out, "\tstack:\n");
for (te = t->stack; te != NULL; te = te->next) {
- fprintf(out, "\t\tte->name: %s%s%s\n", te->name,
- te->flags & needsPreVisit ? "" : " *",
- t->current == te ? " (current)" : "");
+ fprintf(out, "\t\t%s%d:\"%s\" %s%s%s%s%s%s\n",
+ t->current == te ? "*" : " ",
+ te->depth,
+ te->name,
+ te->flags & needsFirstVisit ? "V" : "",
+ te->flags & needsDescent ? "D" : "",
+ te->flags & needsOpen ? "O" : "",
+ te->flags & needsAscent ? "A" : "",
+ te->flags & isDirLink ? "L" : "",
+ (t->current == te && t->d) ? "+" : ""
+ );
}
}
-#endif
/*
* Add a directory path to the current stack.
@@ -162,20 +211,29 @@ tree_push(struct tree *t, const char *path)
te = malloc(sizeof(*te));
memset(te, 0, sizeof(*te));
te->next = t->stack;
+ te->parent = t->current;
+ if (te->parent)
+ te->depth = te->parent->depth + 1;
t->stack = te;
- te->fd = -1;
+#ifdef HAVE_FCHDIR
+ te->symlink_parent_fd = -1;
te->name = strdup(path);
- te->flags = needsPreVisit | needsPostVisit;
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ te->symlink_parent_path = NULL;
+ te->name = strdup(path);
+#endif
+ te->flags = needsDescent | needsOpen | needsAscent;
te->dirname_length = t->dirname_length;
}
/*
- * Append a name to the current path.
+ * Append a name to the current dir path.
*/
static void
tree_append(struct tree *t, const char *name, size_t name_length)
{
char *p;
+ size_t size_needed;
if (t->buff != NULL)
t->buff[t->dirname_length] = '\0';
@@ -184,12 +242,16 @@ tree_append(struct tree *t, const char *name, size_t name_length)
name_length--;
/* Resize pathname buffer as needed. */
- while (name_length + 1 + t->dirname_length >= t->buff_length) {
- t->buff_length *= 2;
+ size_needed = name_length + 1 + t->dirname_length;
+ if (t->buff_length < size_needed) {
if (t->buff_length < 1024)
t->buff_length = 1024;
+ while (t->buff_length < size_needed)
+ t->buff_length *= 2;
t->buff = realloc(t->buff, t->buff_length);
}
+ if (t->buff == NULL)
+ abort();
p = t->buff + t->dirname_length;
t->path_length = t->dirname_length + name_length;
/* Add a separating '/' if it's needed. */
@@ -197,7 +259,11 @@ tree_append(struct tree *t, const char *name, size_t name_length)
*p++ = '/';
t->path_length ++;
}
+#if HAVE_STRNCPY_S
+ strncpy_s(p, t->buff_length - (p - t->buff), name, name_length);
+#else
strncpy(p, name, name_length);
+#endif
p[name_length] = '\0';
t->basename = p;
}
@@ -208,39 +274,95 @@ tree_append(struct tree *t, const char *name, size_t name_length)
struct tree *
tree_open(const char *path)
{
+#ifdef HAVE_FCHDIR
struct tree *t;
t = malloc(sizeof(*t));
memset(t, 0, sizeof(*t));
- tree_append(t, path, strlen(path));
- t->initialDirFd = open(".", O_RDONLY);
- /*
- * During most of the traversal, items are set up and then
- * returned immediately from tree_next(). That doesn't work
- * for the very first entry, so we set a flag for this special
- * case.
- */
- t->flags = needsReturn;
+ /* First item is set up a lot like a symlink traversal. */
+ tree_push(t, path);
+ t->stack->flags = needsFirstVisit | isDirLink | needsAscent;
+ t->stack->symlink_parent_fd = open(".", O_RDONLY);
+ t->openCount++;
+ t->d = INVALID_DIR_HANDLE;
+ return (t);
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ struct tree *t;
+ char *cwd = _getcwd(NULL, 0);
+ char *pathname = strdup(path), *p, *base;
+
+ if (pathname == NULL)
+ abort();
+ for (p = pathname; *p != '\0'; ++p) {
+ if (*p == '\\')
+ *p = '/';
+ }
+ base = pathname;
+
+ t = malloc(sizeof(*t));
+ memset(t, 0, sizeof(*t));
+ /* First item is set up a lot like a symlink traversal. */
+ /* printf("Looking for wildcard in %s\n", path); */
+ /* TODO: wildcard detection here screws up on \\?\c:\ UNC names */
+ if (strchr(base, '*') || strchr(base, '?')) {
+ // It has a wildcard in it...
+ // Separate the last element.
+ p = strrchr(base, '/');
+ if (p != NULL) {
+ *p = '\0';
+ chdir(base);
+ tree_append(t, base, p - base);
+ t->dirname_length = t->path_length;
+ base = p + 1;
+ }
+ }
+ tree_push(t, base);
+ free(pathname);
+ t->stack->flags = needsFirstVisit | isDirLink | needsAscent;
+ t->stack->symlink_parent_path = cwd;
+ t->d = INVALID_DIR_HANDLE;
return (t);
+#endif
}
/*
* We've finished a directory; ascend back to the parent.
*/
-static void
+static int
tree_ascend(struct tree *t)
{
struct tree_entry *te;
+ int r = 0;
te = t->stack;
t->depth--;
if (te->flags & isDirLink) {
- fchdir(te->fd);
- close(te->fd);
+#ifdef HAVE_FCHDIR
+ if (fchdir(te->symlink_parent_fd) != 0) {
+ t->tree_errno = errno;
+ r = TREE_ERROR_FATAL;
+ }
+ close(te->symlink_parent_fd);
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ if (SetCurrentDirectory(te->symlink_parent_path) == 0) {
+ t->tree_errno = errno;
+ r = TREE_ERROR_FATAL;
+ }
+ free(te->symlink_parent_path);
+ te->symlink_parent_path = NULL;
+#endif
t->openCount--;
} else {
- chdir("..");
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (SetCurrentDirectory("..") == 0) {
+#else
+ if (chdir("..") != 0) {
+#endif
+ t->tree_errno = errno;
+ r = TREE_ERROR_FATAL;
+ }
}
+ return (r);
}
/*
@@ -251,16 +373,18 @@ tree_pop(struct tree *t)
{
struct tree_entry *te;
- t->buff[t->dirname_length] = '\0';
+ if (t->buff)
+ t->buff[t->dirname_length] = '\0';
if (t->stack == t->current && t->current != NULL)
t->current = t->current->parent;
te = t->stack;
t->stack = te->next;
t->dirname_length = te->dirname_length;
- t->basename = t->buff + t->dirname_length;
- /* Special case: starting dir doesn't skip leading '/'. */
- if (t->dirname_length > 0)
- t->basename++;
+ if (t->buff) {
+ t->basename = t->buff + t->dirname_length;
+ while (t->basename[0] == '/')
+ t->basename++;
+ }
free(te->name);
free(te);
}
@@ -271,84 +395,179 @@ tree_pop(struct tree *t)
int
tree_next(struct tree *t)
{
- struct dirent *de = NULL;
-
- /* Handle the startup case by returning the initial entry. */
- if (t->flags & needsReturn) {
- t->flags &= ~needsReturn;
- return (t->visit_type = TREE_REGULAR);
+ int r;
+
+ /* If we're called again after a fatal error, that's an API
+ * violation. Just crash now. */
+ if (t->visit_type == TREE_ERROR_FATAL) {
+ fprintf(stderr, "Unable to continue traversing"
+ " directory heirarchy after a fatal error.");
+ abort();
}
while (t->stack != NULL) {
/* If there's an open dir, get the next entry from there. */
- while (t->d != NULL) {
- de = readdir(t->d);
- if (de == NULL) {
- closedir(t->d);
- t->d = NULL;
- } else if (de->d_name[0] == '.'
- && de->d_name[1] == '\0') {
- /* Skip '.' */
- } else if (de->d_name[0] == '.'
- && de->d_name[1] == '.'
- && de->d_name[2] == '\0') {
- /* Skip '..' */
- } else {
- /*
- * Append the path to the current path
- * and return it.
- */
- tree_append(t, de->d_name, D_NAMELEN(de));
- t->flags &= ~hasLstat;
- t->flags &= ~hasStat;
- return (t->visit_type = TREE_REGULAR);
- }
+ if (t->d != INVALID_DIR_HANDLE) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ r = tree_dir_next_windows(t, NULL);
+#else
+ r = tree_dir_next_posix(t);
+#endif
+ if (r == 0)
+ continue;
+ return (r);
}
- /* If the current dir needs to be visited, set it up. */
- if (t->stack->flags & needsPreVisit) {
+ if (t->stack->flags & needsFirstVisit) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ char *d = t->stack->name;
+ t->stack->flags &= ~needsFirstVisit;
+ if (strchr(d, '*') || strchr(d, '?')) {
+ r = tree_dir_next_windows(t, d);
+ if (r == 0)
+ continue;
+ return (r);
+ }
+ // Not a pattern, handle it as-is...
+#endif
+ /* Top stack item needs a regular visit. */
+ t->current = t->stack;
+ tree_append(t, t->stack->name, strlen(t->stack->name));
+ //t->dirname_length = t->path_length;
+ //tree_pop(t);
+ t->stack->flags &= ~needsFirstVisit;
+ return (t->visit_type = TREE_REGULAR);
+ } else if (t->stack->flags & needsDescent) {
+ /* Top stack item is dir to descend into. */
t->current = t->stack;
tree_append(t, t->stack->name, strlen(t->stack->name));
- t->stack->flags &= ~needsPreVisit;
+ t->stack->flags &= ~needsDescent;
/* If it is a link, set up fd for the ascent. */
if (t->stack->flags & isDirLink) {
- t->stack->fd = open(".", O_RDONLY);
+#ifdef HAVE_FCHDIR
+ t->stack->symlink_parent_fd = open(".", O_RDONLY);
t->openCount++;
if (t->openCount > t->maxOpenCount)
t->maxOpenCount = t->openCount;
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ t->stack->symlink_parent_path = _getcwd(NULL, 0);
+#endif
}
t->dirname_length = t->path_length;
- if (chdir(t->stack->name) != 0) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (t->path_length == 259 || !SetCurrentDirectory(t->stack->name) != 0)
+#else
+ if (chdir(t->stack->name) != 0)
+#endif
+ {
/* chdir() failed; return error */
tree_pop(t);
t->tree_errno = errno;
return (t->visit_type = TREE_ERROR_DIR);
}
t->depth++;
- t->d = opendir(".");
- if (t->d == NULL) {
- tree_ascend(t); /* Undo "chdir" */
+ return (t->visit_type = TREE_POSTDESCENT);
+ } else if (t->stack->flags & needsOpen) {
+ t->stack->flags &= ~needsOpen;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ r = tree_dir_next_windows(t, "*");
+#else
+ r = tree_dir_next_posix(t);
+#endif
+ if (r == 0)
+ continue;
+ return (r);
+ } else if (t->stack->flags & needsAscent) {
+ /* Top stack item is dir and we're done with it. */
+ r = tree_ascend(t);
+ tree_pop(t);
+ t->visit_type = r != 0 ? r : TREE_POSTASCENT;
+ return (t->visit_type);
+ } else {
+ /* Top item on stack is dead. */
+ tree_pop(t);
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ }
+ }
+ return (t->visit_type = 0);
+}
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static int
+tree_dir_next_windows(struct tree *t, const char *pattern)
+{
+ const char *name;
+ size_t namelen;
+ int r;
+
+ for (;;) {
+ if (pattern != NULL) {
+ t->d = FindFirstFile(pattern, &t->_findData);
+ if (t->d == INVALID_DIR_HANDLE) {
+ r = tree_ascend(t); /* Undo "chdir" */
tree_pop(t);
t->tree_errno = errno;
- return (t->visit_type = TREE_ERROR_DIR);
+ t->visit_type = r != 0 ? r : TREE_ERROR_DIR;
+ return (t->visit_type);
}
- t->flags &= ~hasLstat;
- t->flags &= ~hasStat;
- t->basename = ".";
- return (t->visit_type = TREE_POSTDESCENT);
+ t->findData = &t->_findData;
+ pattern = NULL;
+ } else if (!FindNextFile(t->d, &t->_findData)) {
+ FindClose(t->d);
+ t->d = INVALID_DIR_HANDLE;
+ t->findData = NULL;
+ return (0);
}
+ name = t->findData->cFileName;
+ namelen = strlen(name);
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ if (name[0] == '.' && name[1] == '\0')
+ continue;
+ if (name[0] == '.' && name[1] == '.' && name[2] == '\0')
+ continue;
+ tree_append(t, name, namelen);
+ return (t->visit_type = TREE_REGULAR);
+ }
+}
+#else
+static int
+tree_dir_next_posix(struct tree *t)
+{
+ int r;
+ const char *name;
+ size_t namelen;
- /* We've done everything necessary for the top stack entry. */
- if (t->stack->flags & needsPostVisit) {
- tree_ascend(t);
+ if (t->d == NULL) {
+ if ((t->d = opendir(".")) == NULL) {
+ r = tree_ascend(t); /* Undo "chdir" */
tree_pop(t);
- t->flags &= ~hasLstat;
- t->flags &= ~hasStat;
- return (t->visit_type = TREE_POSTASCENT);
+ t->tree_errno = errno;
+ t->visit_type = r != 0 ? r : TREE_ERROR_DIR;
+ return (t->visit_type);
}
}
- return (t->visit_type = 0);
+ for (;;) {
+ t->de = readdir(t->d);
+ if (t->de == NULL) {
+ closedir(t->d);
+ t->d = INVALID_DIR_HANDLE;
+ return (0);
+ }
+ name = t->de->d_name;
+ namelen = D_NAMELEN(t->de);
+ t->flags &= ~hasLstat;
+ t->flags &= ~hasStat;
+ if (name[0] == '.' && name[1] == '\0')
+ continue;
+ if (name[0] == '.' && name[1] == '.' && name[2] == '\0')
+ continue;
+ tree_append(t, name, namelen);
+ return (t->visit_type = TREE_REGULAR);
+ }
}
+#endif
/*
* Return error code.
@@ -385,25 +604,51 @@ const struct stat *
tree_current_stat(struct tree *t)
{
if (!(t->flags & hasStat)) {
- if (stat(t->basename, &t->st) != 0)
+ if (stat(tree_current_access_path(t), &t->st) != 0)
return NULL;
t->flags |= hasStat;
}
return (&t->st);
}
+#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
+const BY_HANDLE_FILE_INFORMATION *
+tree_current_file_information(struct tree *t)
+{
+ if (!(t->flags & hasFileInfo)) {
+ HANDLE h = CreateFile(tree_current_access_path(t),
+ 0, 0, NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
+ NULL);
+ if (h == INVALID_HANDLE_VALUE)
+ return NULL;
+ if (!GetFileInformationByHandle(h, &t->fileInfo)) {
+ CloseHandle(h);
+ return NULL;
+ }
+ CloseHandle(h);
+ t->flags |= hasFileInfo;
+ }
+ return (&t->fileInfo);
+}
+#endif
/*
* Get the lstat() data for the entry just returned from tree_next().
*/
const struct stat *
tree_current_lstat(struct tree *t)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ return (tree_current_stat(t));
+#else
if (!(t->flags & hasLstat)) {
- if (lstat(t->basename, &t->lst) != 0)
+ if (lstat(tree_current_access_path(t), &t->lst) != 0)
return NULL;
t->flags |= hasLstat;
}
return (&t->lst);
+#endif
}
/*
@@ -412,8 +657,14 @@ tree_current_lstat(struct tree *t)
int
tree_current_is_dir(struct tree *t)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (t->findData)
+ return (t->findData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+ if (tree_current_file_information(t))
+ return (t->fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+ return (0);
+#else
const struct stat *st;
-
/*
* If we already have lstat() info, then try some
* cheap tests to determine if this is a dir.
@@ -438,6 +689,7 @@ tree_current_is_dir(struct tree *t)
return 0;
/* Use the definitive test. Hopefully this is cached. */
return (S_ISDIR(st->st_mode));
+#endif
}
/*
@@ -448,6 +700,11 @@ tree_current_is_dir(struct tree *t)
int
tree_current_is_physical_dir(struct tree *t)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (tree_current_is_physical_link(t))
+ return (0);
+ return (tree_current_is_dir(t));
+#else
const struct stat *st;
/*
@@ -471,6 +728,7 @@ tree_current_is_physical_dir(struct tree *t)
return 0;
/* Use the definitive test. Hopefully this is cached. */
return (S_ISDIR(st->st_mode));
+#endif
}
/*
@@ -479,10 +737,21 @@ tree_current_is_physical_dir(struct tree *t)
int
tree_current_is_physical_link(struct tree *t)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#ifndef IO_REPARSE_TAG_SYMLINK
+/* Old SDKs do not provide IO_REPARSE_TAG_SYMLINK */
+#define IO_REPARSE_TAG_SYMLINK 0xA000000CL
+#endif
+ if (t->findData)
+ return ((t->findData->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ && (t->findData->dwReserved0 == IO_REPARSE_TAG_SYMLINK));
+ return (0);
+#else
const struct stat *st = tree_current_lstat(t);
if (st == NULL)
return 0;
return (S_ISLNK(st->st_mode));
+#endif
}
/*
@@ -530,13 +799,23 @@ tree_close(struct tree *t)
/* Release anything remaining in the stack. */
while (t->stack != NULL)
tree_pop(t);
- if (t->buff)
- free(t->buff);
- /* chdir() back to where we started. */
+ free(t->buff);
+ /* TODO: Ensure that premature close() resets cwd */
+#if 0
+#ifdef HAVE_FCHDIR
if (t->initialDirFd >= 0) {
- fchdir(t->initialDirFd);
+ int s = fchdir(t->initialDirFd);
+ (void)s; /* UNUSED */
close(t->initialDirFd);
t->initialDirFd = -1;
}
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ if (t->initialDir != NULL) {
+ SetCurrentDir(t->initialDir);
+ free(t->initialDir);
+ t->initialDir = NULL;
+ }
+#endif
+#endif
free(t);
}
diff --git a/archivers/libarchive/files/tar/tree.h b/archivers/libarchive/files/tar/tree.h
index a32a15f8f32..9a7e0d30744 100644
--- a/archivers/libarchive/files/tar/tree.h
+++ b/archivers/libarchive/files/tar/tree.h
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/usr.bin/tar/tree.h,v 1.3 2007/01/09 08:12:17 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/tree.h,v 1.4 2008/11/27 05:49:52 kientzle Exp $
*/
/*-
@@ -36,8 +36,7 @@
* * Supports very deep logical traversals. The fts package
* uses "non-chdir" approach for logical traversals. This
* package does use a chdir approach for logical traversals
- * and can therefore handle pathnames much longer than
- * PATH_MAX.
+ * and can therefore handle pathnames much longer than PATH_MAX.
* * Supports deep physical traversals "out of the box."
* Due to the memory optimizations above, there's no need to
* limit dir names to 32k.
@@ -53,23 +52,32 @@ struct tree *tree_open(const char * /* pathname */);
void tree_close(struct tree *);
/*
- * tree_next() returns Zero if there is no next entry, non-zero if there is.
- * Note that directories are potentially visited three times. The first
- * time as "regular" file. If tree_descend() is invoked at that time,
- * the directory is added to a work list and will be visited two more
- * times: once just after descending into the directory and again
- * just after ascending back to the parent.
+ * tree_next() returns Zero if there is no next entry, non-zero if
+ * there is. Note that directories are visited three times.
+ * Directories are always visited first as part of enumerating their
+ * parent; that is a "regular" visit. If tree_descend() is invoked at
+ * that time, the directory is added to a work list and will
+ * subsequently be visited two more times: once just after descending
+ * into the directory ("postdescent") and again just after ascending
+ * back to the parent ("postascent").
*
- * TREE_ERROR is returned if the descent failed (because the
+ * TREE_ERROR_DIR is returned if the descent failed (because the
* directory couldn't be opened, for instance). This is returned
- * instead of TREE_PREVISIT/TREE_POSTVISIT.
+ * instead of TREE_POSTDESCENT/TREE_POSTASCENT. TREE_ERROR_DIR is not a
+ * fatal error, but it does imply that the relevant subtree won't be
+ * visited. TREE_ERROR_FATAL is returned for an error that left the
+ * traversal completely hosed. Right now, this is only returned for
+ * chdir() failures during ascent.
*/
#define TREE_REGULAR 1
#define TREE_POSTDESCENT 2
#define TREE_POSTASCENT 3
#define TREE_ERROR_DIR -1
+#define TREE_ERROR_FATAL -2
+
int tree_next(struct tree *);
+/* Errno value associated with the last traversal error. */
int tree_errno(struct tree *);
/*
@@ -85,16 +93,32 @@ void tree_descend(struct tree *);
* Return information about the current entry.
*/
+/* Current depth in the traversal. */
int tree_current_depth(struct tree *);
+
/*
- * The current full pathname, length of the full pathname,
- * and a name that can be used to access the file.
- * Because tree does use chdir extensively, the access path is
- * almost never the same as the full current path.
+ * The current full pathname, length of the full pathname, and a name
+ * that can be used to access the file. Because tree does use chdir
+ * extensively, the access path is almost never the same as the full
+ * current path.
+ *
+ * TODO: Flesh out this interface to provide other information. In
+ * particular, Windows can provide file size, mode, and some permission
+ * information without invoking stat() at all.
+ *
+ * TODO: On platforms that support it, use openat()-style operations
+ * to eliminate the chdir() operations entirely while still supporting
+ * arbitrarily deep traversals. This makes access_path troublesome to
+ * support, of course, which means we'll need a rich enough interface
+ * that clients can function without it. (In particular, we'll need
+ * tree_current_open() that returns an open file descriptor.)
+ *
+ * TODO: Provide tree_current_archive_entry().
*/
const char *tree_current_path(struct tree *);
size_t tree_current_pathlen(struct tree *);
const char *tree_current_access_path(struct tree *);
+
/*
* Request the lstat() or stat() data for the current path. Since the
* tree package needs to do some of this anyway, and caches the
@@ -103,7 +127,9 @@ const char *tree_current_access_path(struct tree *);
*/
const struct stat *tree_current_stat(struct tree *);
const struct stat *tree_current_lstat(struct tree *);
-/* The following tests may use mechanisms much faster than stat()/lstat(). */
+
+/* The following functions use tricks to avoid a certain number of
+ * stat()/lstat() calls. */
/* "is_physical_dir" is equivalent to S_ISDIR(tree_current_lstat()->st_mode) */
int tree_current_is_physical_dir(struct tree *);
/* "is_physical_link" is equivalent to S_ISLNK(tree_current_lstat()->st_mode) */
diff --git a/archivers/libarchive/files/tar/util.c b/archivers/libarchive/files/tar/util.c
index ee1e40dbf2d..f7232744ec0 100644
--- a/archivers/libarchive/files/tar/util.c
+++ b/archivers/libarchive/files/tar/util.c
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.20 2008/06/09 14:03:55 cperciva Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.23 2008/12/15 06:00:25 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -36,9 +36,15 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.20 2008/06/09 14:03:55 cperciva E
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -46,122 +52,163 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.20 2008/06/09 14:03:55 cperciva E
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_WCTYPE_H
+#include <wctype.h>
+#else
+/* If we don't have wctype, we need to hack up some version of iswprint(). */
+#define iswprint isprint
+#endif
#include "bsdtar.h"
+#include "err.h"
-static void bsdtar_vwarnc(struct bsdtar *, int code,
- const char *fmt, va_list ap);
+static size_t bsdtar_expand_char(char *, size_t, char);
+static const char *strip_components(const char *path, int elements);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define read _read
+#endif
+
+/* TODO: Hack up a version of mbtowc for platforms with no wide
+ * character support at all. I think the following might suffice,
+ * but it needs careful testing.
+ * #if !HAVE_MBTOWC
+ * #define mbtowc(wcp, p, n) ((*wcp = *p), 1)
+ * #endif
+ */
/*
* Print a string, taking care with any non-printable characters.
+ *
+ * Note that we use a stack-allocated buffer to receive the formatted
+ * string if we can. This is partly performance (avoiding a call to
+ * malloc()), partly out of expedience (we have to call vsnprintf()
+ * before malloc() anyway to find out how big a buffer we need; we may
+ * as well point that first call at a small local buffer in case it
+ * works), but mostly for safety (so we can use this to print messages
+ * about out-of-memory conditions).
*/
void
safe_fprintf(FILE *f, const char *fmt, ...)
{
- char *buff;
- char *buff_heap;
- int buff_length;
- int length;
+ char fmtbuff_stack[256]; /* Place to format the printf() string. */
+ char outbuff[256]; /* Buffer for outgoing characters. */
+ char *fmtbuff_heap; /* If fmtbuff_stack is too small, we use malloc */
+ char *fmtbuff; /* Pointer to fmtbuff_stack or fmtbuff_heap. */
+ int fmtbuff_length;
+ int length, n;
va_list ap;
- char *p;
+ const char *p;
unsigned i;
- char buff_stack[256];
- char copy_buff[256];
+ wchar_t wc;
+ char try_wc;
/* Use a stack-allocated buffer if we can, for speed and safety. */
- buff_heap = NULL;
- buff_length = sizeof(buff_stack);
- buff = buff_stack;
+ fmtbuff_heap = NULL;
+ fmtbuff_length = sizeof(fmtbuff_stack);
+ fmtbuff = fmtbuff_stack;
+ /* Try formatting into the stack buffer. */
va_start(ap, fmt);
- length = vsnprintf(buff, buff_length, fmt, ap);
+ length = vsnprintf(fmtbuff, fmtbuff_length, fmt, ap);
va_end(ap);
- /* If the result is too large, allocate a buffer on the heap. */
- if (length >= buff_length) {
- buff_length = length+1;
- buff_heap = malloc(buff_length);
- /* Failsafe: use the truncated string if malloc fails. */
- if (buff_heap != NULL) {
- buff = buff_heap;
+
+ /* If the result was too large, allocate a buffer on the heap. */
+ if (length >= fmtbuff_length) {
+ fmtbuff_length = length+1;
+ fmtbuff_heap = malloc(fmtbuff_length);
+
+ /* Reformat the result into the heap buffer if we can. */
+ if (fmtbuff_heap != NULL) {
+ fmtbuff = fmtbuff_heap;
va_start(ap, fmt);
- length = vsnprintf(buff, buff_length, fmt, ap);
+ length = vsnprintf(fmtbuff, fmtbuff_length, fmt, ap);
va_end(ap);
+ } else {
+ /* Leave fmtbuff pointing to the truncated
+ * string in fmtbuff_stack. */
+ length = sizeof(fmtbuff_stack) - 1;
}
}
+ /* Note: mbrtowc() has a cleaner API, but mbtowc() seems a bit
+ * more portable, so we use that here instead. */
+ n = mbtowc(NULL, NULL, 1); /* Reset the shift state. */
+
/* Write data, expanding unprintable characters. */
- p = buff;
+ p = fmtbuff;
i = 0;
+ try_wc = 1;
while (*p != '\0') {
- unsigned char c = *p++;
-
- if (isprint(c) && c != '\\')
- copy_buff[i++] = c;
- else {
- copy_buff[i++] = '\\';
- switch (c) {
- case '\a': copy_buff[i++] = 'a'; break;
- case '\b': copy_buff[i++] = 'b'; break;
- case '\f': copy_buff[i++] = 'f'; break;
- case '\n': copy_buff[i++] = 'n'; break;
-#if '\r' != '\n'
- /* On some platforms, \n and \r are the same. */
- case '\r': copy_buff[i++] = 'r'; break;
-#endif
- case '\t': copy_buff[i++] = 't'; break;
- case '\v': copy_buff[i++] = 'v'; break;
- case '\\': copy_buff[i++] = '\\'; break;
- default:
- sprintf(copy_buff + i, "%03o", c);
- i += 3;
+
+ /* Convert to wide char, test if the wide
+ * char is printable in the current locale. */
+ if (try_wc && (n = mbtowc(&wc, p, length)) != -1) {
+ length -= n;
+ if (iswprint(wc) && wc != L'\\') {
+ /* Printable, copy the bytes through. */
+ while (n-- > 0)
+ outbuff[i++] = *p++;
+ } else {
+ /* Not printable, format the bytes. */
+ while (n-- > 0)
+ i += (unsigned)bsdtar_expand_char(
+ outbuff, i, *p++);
}
+ } else {
+ /* After any conversion failure, don't bother
+ * trying to convert the rest. */
+ i += (unsigned)bsdtar_expand_char(outbuff, i, *p++);
+ try_wc = 0;
}
- /* If our temp buffer is full, dump it and keep going. */
- if (i > (sizeof(copy_buff) - 8)) {
- copy_buff[i++] = '\0';
- fprintf(f, "%s", copy_buff);
+ /* If our output buffer is full, dump it and keep going. */
+ if (i > (sizeof(outbuff) - 20)) {
+ outbuff[i] = '\0';
+ fprintf(f, "%s", outbuff);
i = 0;
}
}
- copy_buff[i++] = '\0';
- fprintf(f, "%s", copy_buff);
+ outbuff[i] = '\0';
+ fprintf(f, "%s", outbuff);
- /* If we allocated a heap-based buffer, free it now. */
- if (buff_heap != NULL)
- free(buff_heap);
+ /* If we allocated a heap-based formatting buffer, free it now. */
+ if (fmtbuff_heap != NULL)
+ free(fmtbuff_heap);
}
-static void
-bsdtar_vwarnc(struct bsdtar *bsdtar, int code, const char *fmt, va_list ap)
-{
- fprintf(stderr, "%s: ", bsdtar->progname);
- vfprintf(stderr, fmt, ap);
- if (code != 0)
- fprintf(stderr, ": %s", strerror(code));
- fprintf(stderr, "\n");
-}
-
-void
-bsdtar_warnc(struct bsdtar *bsdtar, int code, const char *fmt, ...)
+/*
+ * Render an arbitrary sequence of bytes into printable ASCII characters.
+ */
+static size_t
+bsdtar_expand_char(char *buff, size_t offset, char c)
{
- va_list ap;
+ size_t i = offset;
- va_start(ap, fmt);
- bsdtar_vwarnc(bsdtar, code, fmt, ap);
- va_end(ap);
-}
-
-void
-bsdtar_errc(struct bsdtar *bsdtar, int eval, int code, const char *fmt, ...)
-{
- va_list ap;
+ if (isprint((unsigned char)c) && c != '\\')
+ buff[i++] = c;
+ else {
+ buff[i++] = '\\';
+ switch (c) {
+ case '\a': buff[i++] = 'a'; break;
+ case '\b': buff[i++] = 'b'; break;
+ case '\f': buff[i++] = 'f'; break;
+ case '\n': buff[i++] = 'n'; break;
+#if '\r' != '\n'
+ /* On some platforms, \n and \r are the same. */
+ case '\r': buff[i++] = 'r'; break;
+#endif
+ case '\t': buff[i++] = 't'; break;
+ case '\v': buff[i++] = 'v'; break;
+ case '\\': buff[i++] = '\\'; break;
+ default:
+ sprintf(buff + i, "%03o", 0xFF & (int)c);
+ i += 3;
+ }
+ }
- va_start(ap, fmt);
- bsdtar_vwarnc(bsdtar, code, fmt, ap);
- va_end(ap);
- exit(eval);
+ return (i - offset);
}
int
@@ -184,7 +231,7 @@ yes(const char *fmt, ...)
buff[l] = 0;
for (p = buff; *p != '\0'; p++) {
- if (isspace(0xff & (int)*p))
+ if (isspace((unsigned char)*p))
continue;
switch(*p) {
case 'y': case 'Y':
@@ -199,95 +246,6 @@ yes(const char *fmt, ...)
return (0);
}
-/*
- * Read lines from file and do something with each one. If option_null
- * is set, lines are terminated with zero bytes; otherwise, they're
- * terminated with newlines.
- *
- * This uses a self-sizing buffer to handle arbitrarily-long lines.
- * If the "process" function returns non-zero for any line, this
- * function will return non-zero after attempting to process all
- * remaining lines.
- */
-int
-process_lines(struct bsdtar *bsdtar, const char *pathname,
- int (*process)(struct bsdtar *, const char *))
-{
- FILE *f;
- char *buff, *buff_end, *line_start, *line_end, *p;
- size_t buff_length, new_buff_length, bytes_read, bytes_wanted;
- int separator;
- int ret;
-
- separator = bsdtar->option_null ? '\0' : '\n';
- ret = 0;
-
- if (strcmp(pathname, "-") == 0)
- f = stdin;
- else
- f = fopen(pathname, "r");
- if (f == NULL)
- bsdtar_errc(bsdtar, 1, errno, "Couldn't open %s", pathname);
- buff_length = 8192;
- buff = malloc(buff_length);
- if (buff == NULL)
- bsdtar_errc(bsdtar, 1, ENOMEM, "Can't read %s", pathname);
- line_start = line_end = buff_end = buff;
- for (;;) {
- /* Get some more data into the buffer. */
- bytes_wanted = buff + buff_length - buff_end;
- bytes_read = fread(buff_end, 1, bytes_wanted, f);
- buff_end += bytes_read;
- /* Process all complete lines in the buffer. */
- while (line_end < buff_end) {
- if (*line_end == separator) {
- *line_end = '\0';
- if ((*process)(bsdtar, line_start) != 0)
- ret = -1;
- line_start = line_end + 1;
- line_end = line_start;
- } else
- line_end++;
- }
- if (feof(f))
- break;
- if (ferror(f))
- bsdtar_errc(bsdtar, 1, errno,
- "Can't read %s", pathname);
- if (line_start > buff) {
- /* Move a leftover fractional line to the beginning. */
- memmove(buff, line_start, buff_end - line_start);
- buff_end -= line_start - buff;
- line_end -= line_start - buff;
- line_start = buff;
- } else {
- /* Line is too big; enlarge the buffer. */
- new_buff_length = buff_length * 2;
- if (new_buff_length <= buff_length)
- bsdtar_errc(bsdtar, 1, ENOMEM,
- "Line too long in %s", pathname);
- buff_length = new_buff_length;
- p = realloc(buff, buff_length);
- if (p == NULL)
- bsdtar_errc(bsdtar, 1, ENOMEM,
- "Line too long in %s", pathname);
- buff_end = p + (buff_end - buff);
- line_end = p + (line_end - buff);
- line_start = buff = p;
- }
- }
- /* At end-of-file, handle the final line. */
- if (line_end > line_start) {
- *line_end = '\0';
- if ((*process)(bsdtar, line_start) != 0)
- ret = -1;
- }
- free(buff);
- if (f != stdin)
- fclose(f);
- return (ret);
-}
-
/*-
* The logic here for -C <dir> attempts to avoid
* chdir() as long as possible. For example:
@@ -304,6 +262,8 @@ process_lines(struct bsdtar *bsdtar, const char *pathname,
* This way, programs that build tar command lines don't have to worry
* about -C with non-existent directories; such requests will only
* fail if the directory must be accessed.
+ *
+ * TODO: Make this handle Windows paths correctly.
*/
void
set_chdir(struct bsdtar *bsdtar, const char *newdir)
@@ -329,7 +289,7 @@ set_chdir(struct bsdtar *bsdtar, const char *newdir)
free(old_pending);
}
if (bsdtar->pending_chdir == NULL)
- bsdtar_errc(bsdtar, 1, errno, "No memory");
+ lafe_errc(1, errno, "No memory");
}
void
@@ -339,13 +299,52 @@ do_chdir(struct bsdtar *bsdtar)
return;
if (chdir(bsdtar->pending_chdir) != 0) {
- bsdtar_errc(bsdtar, 1, 0, "could not chdir to '%s'\n",
+ lafe_errc(1, 0, "could not chdir to '%s'\n",
bsdtar->pending_chdir);
}
free(bsdtar->pending_chdir);
bsdtar->pending_chdir = NULL;
}
+static const char *
+strip_components(const char *p, int elements)
+{
+ /* Skip as many elements as necessary. */
+ while (elements > 0) {
+ switch (*p++) {
+ case '/':
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ case '\\': /* Support \ path sep on Windows ONLY. */
+#endif
+ elements--;
+ break;
+ case '\0':
+ /* Path is too short, skip it. */
+ return (NULL);
+ }
+ }
+
+ /* Skip any / characters. This handles short paths that have
+ * additional / termination. This also handles the case where
+ * the logic above stops in the middle of a duplicate //
+ * sequence (which would otherwise get converted to an
+ * absolute path). */
+ for (;;) {
+ switch (*p) {
+ case '/':
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ case '\\': /* Support \ path sep on Windows ONLY. */
+#endif
+ ++p;
+ break;
+ case '\0':
+ return (NULL);
+ default:
+ return (p);
+ }
+ }
+}
+
/*
* Handle --strip-components and any future path-rewriting options.
* Returns non-zero if the pathname should not be extracted.
@@ -358,13 +357,13 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
const char *name = archive_entry_pathname(entry);
#if HAVE_REGEX_H
char *subst_name;
-#endif
int r;
+#endif
#if HAVE_REGEX_H
r = apply_substitution(bsdtar, name, &subst_name, 0);
if (r == -1) {
- bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry");
+ lafe_warnc(0, "Invalid substitution, skipping entry");
return 1;
}
if (r == 1) {
@@ -380,7 +379,7 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
if (archive_entry_hardlink(entry)) {
r = apply_substitution(bsdtar, archive_entry_hardlink(entry), &subst_name, 1);
if (r == -1) {
- bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry");
+ lafe_warnc(0, "Invalid substitution, skipping entry");
return 1;
}
if (r == 1) {
@@ -391,7 +390,7 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
if (archive_entry_symlink(entry) != NULL) {
r = apply_substitution(bsdtar, archive_entry_symlink(entry), &subst_name, 1);
if (r == -1) {
- bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry");
+ lafe_warnc(0, "Invalid substitution, skipping entry");
return 1;
}
if (r == 1) {
@@ -402,42 +401,88 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
#endif
/* Strip leading dir names as per --strip-components option. */
- if ((r = bsdtar->strip_components) > 0) {
- const char *p = name;
-
- while (r > 0) {
- switch (*p++) {
- case '/':
- r--;
- name = p;
- break;
- case '\0':
- /* Path is too short, skip it. */
+ if (bsdtar->strip_components > 0) {
+ const char *linkname = archive_entry_hardlink(entry);
+
+ name = strip_components(name, bsdtar->strip_components);
+ if (name == NULL)
+ return (1);
+
+ if (linkname != NULL) {
+ linkname = strip_components(linkname,
+ bsdtar->strip_components);
+ if (linkname == NULL)
return (1);
- }
+ archive_entry_copy_hardlink(entry, linkname);
}
- while (*name == '/')
- ++name;
- if (*name == '\0')
- return (1);
}
- /* Strip redundant leading '/' characters. */
- while (name[0] == '/' && name[1] == '/')
- name++;
-
- /* Strip leading '/' unless user has asked us not to. */
- if (name[0] == '/' && !bsdtar->option_absolute_paths) {
- /* Generate a warning the first time this happens. */
- if (!bsdtar->warned_lead_slash) {
- bsdtar_warnc(bsdtar, 0,
- "Removing leading '/' from member names");
+ /* By default, don't write or restore absolute pathnames. */
+ if (!bsdtar->option_absolute_paths) {
+ const char *rp, *p = name;
+ int slashonly = 1;
+
+ /* Remove leading "//./" or "//?/" or "//?/UNC/"
+ * (absolute path prefixes used by Windows API) */
+ if ((p[0] == '/' || p[0] == '\\') &&
+ (p[1] == '/' || p[1] == '\\') &&
+ (p[2] == '.' || p[2] == '?') &&
+ (p[3] == '/' || p[3] == '\\'))
+ {
+ if (p[2] == '?' &&
+ (p[4] == 'U' || p[4] == 'u') &&
+ (p[5] == 'N' || p[5] == 'n') &&
+ (p[6] == 'C' || p[6] == 'c') &&
+ (p[7] == '/' || p[7] == '\\'))
+ p += 8;
+ else
+ p += 4;
+ slashonly = 0;
+ }
+ do {
+ rp = p;
+ /* Remove leading drive letter from archives created
+ * on Windows. */
+ if (((p[0] >= 'a' && p[0] <= 'z') ||
+ (p[0] >= 'A' && p[0] <= 'Z')) &&
+ p[1] == ':') {
+ p += 2;
+ slashonly = 0;
+ }
+ /* Remove leading "/../", "//", etc. */
+ while (p[0] == '/' || p[0] == '\\') {
+ if (p[1] == '.' && p[2] == '.' &&
+ (p[3] == '/' || p[3] == '\\')) {
+ p += 3; /* Remove "/..", leave "/"
+ * for next pass. */
+ slashonly = 0;
+ } else
+ p += 1; /* Remove "/". */
+ }
+ } while (rp != p);
+
+ if (p != name && !bsdtar->warned_lead_slash) {
+ /* Generate a warning the first time this happens. */
+ if (slashonly)
+ lafe_warnc(0,
+ "Removing leading '%c' from member names",
+ name[0]);
+ else
+ lafe_warnc(0,
+ "Removing leading drive letter from "
+ "member names");
bsdtar->warned_lead_slash = 1;
}
- name++;
- /* Special case: Stripping leading '/' from "/" yields ".". */
- if (*name == '\0')
+
+ /* Special case: Stripping everything yields ".". */
+ if (*p == '\0')
name = ".";
+ else
+ name = p;
+ } else {
+ /* Strip redundant leading '/' characters. */
+ while (name[0] == '/' && name[1] == '/')
+ name++;
}
/* Safely replace name in archive_entry. */
@@ -450,6 +495,28 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
}
/*
+ * It would be nice to just use printf() for formatting large numbers,
+ * but the compatibility problems are quite a headache. Hence the
+ * following simple utility function.
+ */
+const char *
+tar_i64toa(int64_t n0)
+{
+ static char buff[24];
+ int64_t n = n0 < 0 ? -n0 : n0;
+ char *p = buff + sizeof(buff);
+
+ *--p = '\0';
+ do {
+ *--p = '0' + (int)(n % 10);
+ n /= 10;
+ } while (n > 0);
+ if (n0 < 0)
+ *--p = '-';
+ return p;
+}
+
+/*
* Like strcmp(), but try to be a little more aware of the fact that
* we're comparing two paths. Right now, it just handles leading
* "./" and trailing '/' specially, so that "a/b/" == "./a/b"
@@ -459,6 +526,9 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
* TODO: Publish the path normalization routines in libarchive so
* that bsdtar can normalize paths and use fast strcmp() instead
* of this.
+ *
+ * Note: This is currently only used within write.c, so should
+ * not handle \ path separators.
*/
int
diff --git a/archivers/libarchive/files/tar/write.c b/archivers/libarchive/files/tar/write.c
index 1a6e9289abe..fcf6eecfce4 100644
--- a/archivers/libarchive/files/tar/write.c
+++ b/archivers/libarchive/files/tar/write.c
@@ -24,14 +24,11 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.70 2008/05/26 17:10:10 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.79 2008/11/27 05:49:52 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
@@ -44,27 +41,38 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.70 2008/05/26 17:10:10 kientzle
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#ifdef HAVE_EXT2FS_EXT2_FS_H
-#include <ext2fs/ext2_fs.h>
-#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_FNMATCH_H
-#include <fnmatch.h>
-#endif
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h> /* for Linux file flags */
#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h> /* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+/* This header exists but is broken on Cygwin. */
+#include <ext2fs/ext2_fs.h>
+#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -77,8 +85,13 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.70 2008/05/26 17:10:10 kientzle
#endif
#include "bsdtar.h"
+#include "err.h"
+#include "line_reader.h"
#include "tree.h"
+/* Size of buffer for holding file data prior to writing. */
+#define FILEDATABUFLEN 65536
+
/* Fixed size of uname/gname caches. */
#define name_cache_size 101
@@ -113,36 +126,38 @@ static int append_archive_filename(struct bsdtar *,
struct archive *, const char *fname);
static void archive_names_from_file(struct bsdtar *bsdtar,
struct archive *a);
-static int archive_names_from_file_helper(struct bsdtar *bsdtar,
- const char *line);
-static int copy_file_data(struct bsdtar *bsdtar,
- struct archive *a, struct archive *ina);
-static void create_cleanup(struct bsdtar *);
-static void free_cache(struct name_cache *cache);
-static const char * lookup_gname(struct bsdtar *bsdtar, gid_t gid);
-static int lookup_gname_helper(struct bsdtar *bsdtar,
- const char **name, id_t gid);
-static const char * lookup_uname(struct bsdtar *bsdtar, uid_t uid);
-static int lookup_uname_helper(struct bsdtar *bsdtar,
- const char **name, id_t uid);
+static int copy_file_data(struct bsdtar *, struct archive *a,
+ struct archive *ina, struct archive_entry *);
static int new_enough(struct bsdtar *, const char *path,
const struct stat *);
-static void setup_acls(struct bsdtar *, struct archive_entry *,
- const char *path);
-static void setup_xattrs(struct bsdtar *, struct archive_entry *,
- const char *path);
+static void report_write(struct bsdtar *, struct archive *,
+ struct archive_entry *, int64_t progress);
static void test_for_append(struct bsdtar *);
static void write_archive(struct archive *, struct bsdtar *);
-static void write_entry(struct bsdtar *, struct archive *,
- const struct stat *, const char *pathname,
- const char *accpath);
static void write_entry_backend(struct bsdtar *, struct archive *,
- struct archive_entry *, int);
+ struct archive_entry *);
static int write_file_data(struct bsdtar *, struct archive *,
- int fd);
+ struct archive_entry *, int fd);
static void write_hierarchy(struct bsdtar *, struct archive *,
const char *);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+/* Not a full lseek() emulation, but enough for our needs here. */
+static int
+seek_file(int fd, int64_t offset, int whence)
+{
+ LARGE_INTEGER distance;
+ (void)whence; /* UNUSED */
+ distance.QuadPart = offset;
+ return (SetFilePointerEx((HANDLE)_get_osfhandle(fd),
+ distance, NULL, FILE_BEGIN) ? 1 : -1);
+}
+#define open _open
+#define close _close
+#define read _read
+#define lseek seek_file
+#endif
+
void
tar_mode_c(struct bsdtar *bsdtar)
{
@@ -150,10 +165,7 @@ tar_mode_c(struct bsdtar *bsdtar)
int r;
if (*bsdtar->argv == NULL && bsdtar->names_from_file == NULL)
- bsdtar_errc(bsdtar, 1, 0, "no files or directories specified");
-
- /* We want to catch SIGINFO and SIGUSR1. */
- siginfo_init(bsdtar);
+ lafe_errc(1, 0, "no files or directories specified");
a = archive_write_new();
@@ -168,7 +180,7 @@ tar_mode_c(struct bsdtar *bsdtar)
fprintf(stderr, "Can't use format %s: %s\n",
bsdtar->create_format,
archive_error_string(a));
- usage(bsdtar);
+ usage();
}
/*
@@ -189,43 +201,40 @@ tar_mode_c(struct bsdtar *bsdtar)
} else {
switch (bsdtar->create_compression) {
case 0:
- archive_write_set_compression_none(a);
+ r = archive_write_set_compression_none(a);
break;
-#ifdef HAVE_LIBBZ2
case 'j': case 'y':
- archive_write_set_compression_bzip2(a);
+ r = archive_write_set_compression_bzip2(a);
+ break;
+ case 'J':
+ r = archive_write_set_compression_xz(a);
+ break;
+ case OPTION_LZMA:
+ archive_write_set_compression_lzma(a);
break;
-#endif
-#ifdef HAVE_LIBZ
case 'z':
- archive_write_set_compression_gzip(a);
+ r = archive_write_set_compression_gzip(a);
break;
-#endif
case 'Z':
- archive_write_set_compression_compress(a);
+ r = archive_write_set_compression_compress(a);
break;
default:
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Unrecognized compression option -%c",
bsdtar->create_compression);
}
+ if (r != ARCHIVE_OK) {
+ lafe_errc(1, 0,
+ "Unsupported compression option -%c",
+ bsdtar->create_compression);
+ }
}
- r = archive_write_open_file(a, bsdtar->filename);
- if (r != ARCHIVE_OK)
- bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
-
+ if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
+ if (ARCHIVE_OK != archive_write_open_file(a, bsdtar->filename))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
write_archive(a, bsdtar);
-
- if (bsdtar->option_totals) {
- fprintf(stderr, "Total bytes written: " BSDTAR_FILESIZE_PRINTF "\n",
- (BSDTAR_FILESIZE_TYPE)archive_position_compressed(a));
- }
-
- archive_write_finish(a);
-
- /* Restore old SIGINFO + SIGUSR1 handlers. */
- siginfo_done(bsdtar);
}
/*
@@ -235,7 +244,7 @@ tar_mode_c(struct bsdtar *bsdtar)
void
tar_mode_r(struct bsdtar *bsdtar)
{
- off_t end_offset;
+ int64_t end_offset;
int format;
struct archive *a;
struct archive_entry *entry;
@@ -244,14 +253,15 @@ tar_mode_r(struct bsdtar *bsdtar)
/* Sanity-test some arguments and the file. */
test_for_append(bsdtar);
- /* We want to catch SIGINFO and SIGUSR1. */
- siginfo_init(bsdtar);
-
format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED;
+#if defined(__BORLANDC__)
+ bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT);
+#else
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT, 0666);
+#endif
if (bsdtar->fd < 0)
- bsdtar_errc(bsdtar, 1, errno,
+ lafe_errc(1, errno,
"Cannot open %s", bsdtar->filename);
a = archive_read_new();
@@ -260,14 +270,14 @@ tar_mode_r(struct bsdtar *bsdtar)
archive_read_support_format_gnutar(a);
r = archive_read_open_fd(a, bsdtar->fd, 10240);
if (r != ARCHIVE_OK)
- bsdtar_errc(bsdtar, 1, archive_errno(a),
+ lafe_errc(1, archive_errno(a),
"Can't read archive %s: %s", bsdtar->filename,
archive_error_string(a));
while (0 == archive_read_next_header(a, &entry)) {
if (archive_compression(a) != ARCHIVE_COMPRESSION_NONE) {
archive_read_finish(a);
close(bsdtar->fd);
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Cannot append to compressed archive.");
}
/* Keep going until we hit end-of-archive */
@@ -296,7 +306,7 @@ tar_mode_r(struct bsdtar *bsdtar)
format &= ARCHIVE_FORMAT_BASE_MASK;
if (format != (int)(archive_format(a) & ARCHIVE_FORMAT_BASE_MASK)
&& format != ARCHIVE_FORMAT_EMPTY) {
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Format %s is incompatible with the archive %s.",
bsdtar->create_format, bsdtar->filename);
}
@@ -312,17 +322,15 @@ tar_mode_r(struct bsdtar *bsdtar)
format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED;
archive_write_set_format(a, format);
}
- lseek(bsdtar->fd, end_offset, SEEK_SET); /* XXX check return val XXX */
- archive_write_open_fd(a, bsdtar->fd); /* XXX check return val XXX */
+ if (lseek(bsdtar->fd, end_offset, SEEK_SET) < 0)
+ lafe_errc(1, errno, "Could not seek to archive end");
+ if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
+ if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
write_archive(a, bsdtar); /* XXX check return val XXX */
- if (bsdtar->option_totals) {
- fprintf(stderr, "Total bytes written: " BSDTAR_FILESIZE_PRINTF "\n",
- (BSDTAR_FILESIZE_TYPE)archive_position_compressed(a));
- }
-
- archive_write_finish(a);
close(bsdtar->fd);
bsdtar->fd = -1;
}
@@ -330,7 +338,7 @@ tar_mode_r(struct bsdtar *bsdtar)
void
tar_mode_u(struct bsdtar *bsdtar)
{
- off_t end_offset;
+ int64_t end_offset;
struct archive *a;
struct archive_entry *entry;
int format;
@@ -345,12 +353,9 @@ tar_mode_u(struct bsdtar *bsdtar)
/* Sanity-test some arguments and the file. */
test_for_append(bsdtar);
- /* We want to catch SIGINFO and SIGUSR1. */
- siginfo_init(bsdtar);
-
bsdtar->fd = open(bsdtar->filename, O_RDWR);
if (bsdtar->fd < 0)
- bsdtar_errc(bsdtar, 1, errno,
+ lafe_errc(1, errno,
"Cannot open %s", bsdtar->filename);
a = archive_read_new();
@@ -360,7 +365,7 @@ tar_mode_u(struct bsdtar *bsdtar)
if (archive_read_open_fd(a, bsdtar->fd,
bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block :
DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Can't open %s: %s", bsdtar->filename,
archive_error_string(a));
}
@@ -370,7 +375,7 @@ tar_mode_u(struct bsdtar *bsdtar)
if (archive_compression(a) != ARCHIVE_COMPRESSION_NONE) {
archive_read_finish(a);
close(bsdtar->fd);
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Cannot append to compressed archive.");
}
add_dir_list(bsdtar, archive_entry_pathname(entry),
@@ -400,18 +405,15 @@ tar_mode_u(struct bsdtar *bsdtar)
bsdtar->bytes_per_block);
} else
archive_write_set_bytes_per_block(a, DEFAULT_BYTES_PER_BLOCK);
- lseek(bsdtar->fd, end_offset, SEEK_SET);
- ftruncate(bsdtar->fd, end_offset);
- archive_write_open_fd(a, bsdtar->fd);
+ if (lseek(bsdtar->fd, end_offset, SEEK_SET) < 0)
+ lafe_errc(1, errno, "Could not seek to archive end");
+ if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
+ if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd))
+ lafe_errc(1, 0, "%s", archive_error_string(a));
write_archive(a, bsdtar);
- if (bsdtar->option_totals) {
- fprintf(stderr, "Total bytes written: " BSDTAR_FILESIZE_PRINTF "\n",
- (BSDTAR_FILESIZE_TYPE)archive_position_compressed(a));
- }
-
- archive_write_finish(a);
close(bsdtar->fd);
bsdtar->fd = -1;
@@ -434,10 +436,17 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
const char *arg;
struct archive_entry *entry, *sparse_entry;
+ /* Allocate a buffer for file data. */
+ if ((bsdtar->buff = malloc(FILEDATABUFLEN)) == NULL)
+ lafe_errc(1, 0, "cannot allocate memory");
+
if ((bsdtar->resolver = archive_entry_linkresolver_new()) == NULL)
- bsdtar_errc(bsdtar, 1, 0, "cannot create link resolver");
+ lafe_errc(1, 0, "cannot create link resolver");
archive_entry_linkresolver_set_strategy(bsdtar->resolver,
archive_format(a));
+ if ((bsdtar->diskreader = archive_read_disk_new()) == NULL)
+ lafe_errc(1, 0, "Cannot create read_disk object");
+ archive_read_disk_set_standard_lookup(bsdtar->diskreader);
if (bsdtar->names_from_file != NULL)
archive_names_from_file(bsdtar, a);
@@ -450,10 +459,10 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
bsdtar->argv++;
arg = *bsdtar->argv;
if (arg == NULL) {
- bsdtar_warnc(bsdtar, 1, 0,
+ lafe_warnc(0, "%s",
"Missing argument for -C");
bsdtar->return_value = 1;
- return;
+ goto cleanup;
}
}
set_chdir(bsdtar, arg);
@@ -473,18 +482,31 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
entry = NULL;
archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
while (entry != NULL) {
- int fd = -1;
- write_entry_backend(bsdtar, a, entry, fd);
+ write_entry_backend(bsdtar, a, entry);
archive_entry_free(entry);
entry = NULL;
archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
}
- create_cleanup(bsdtar);
if (archive_write_close(a)) {
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
+ lafe_warnc(0, "%s", archive_error_string(a));
bsdtar->return_value = 1;
}
+
+cleanup:
+ /* Free file data buffer. */
+ free(bsdtar->buff);
+ archive_entry_linkresolver_free(bsdtar->resolver);
+ bsdtar->resolver = NULL;
+ archive_read_finish(bsdtar->diskreader);
+ bsdtar->diskreader = NULL;
+
+ if (bsdtar->option_totals) {
+ fprintf(stderr, "Total bytes written: %s\n",
+ tar_i64toa(archive_position_compressed(a)));
+ }
+
+ archive_write_finish(a);
}
/*
@@ -494,36 +516,34 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
* cause the next line to be a directory to pass to chdir(). If
* --null is specified, then a line "-C" is just another filename.
*/
-void
+static void
archive_names_from_file(struct bsdtar *bsdtar, struct archive *a)
{
- bsdtar->archive = a;
+ struct lafe_line_reader *lr;
+ const char *line;
bsdtar->next_line_is_dir = 0;
- process_lines(bsdtar, bsdtar->names_from_file,
- archive_names_from_file_helper);
+
+ lr = lafe_line_reader(bsdtar->names_from_file, bsdtar->option_null);
+ while ((line = lafe_line_reader_next(lr)) != NULL) {
+ if (bsdtar->next_line_is_dir) {
+ set_chdir(bsdtar, line);
+ bsdtar->next_line_is_dir = 0;
+ } else if (!bsdtar->option_null && strcmp(line, "-C") == 0)
+ bsdtar->next_line_is_dir = 1;
+ else {
+ if (*line != '/')
+ do_chdir(bsdtar); /* Handle a deferred -C */
+ write_hierarchy(bsdtar, a, line);
+ }
+ }
+ lafe_line_reader_free(lr);
if (bsdtar->next_line_is_dir)
- bsdtar_errc(bsdtar, 1, errno,
+ lafe_errc(1, errno,
"Unexpected end of filename list; "
"directory expected after -C");
}
-static int
-archive_names_from_file_helper(struct bsdtar *bsdtar, const char *line)
-{
- if (bsdtar->next_line_is_dir) {
- set_chdir(bsdtar, line);
- bsdtar->next_line_is_dir = 0;
- } else if (!bsdtar->option_null && strcmp(line, "-C") == 0)
- bsdtar->next_line_is_dir = 1;
- else {
- if (*line != '/')
- do_chdir(bsdtar); /* Handle a deferred -C */
- write_hierarchy(bsdtar, bsdtar->archive, line);
- }
- return (0);
-}
-
/*
* Copy from specified archive to current archive. Returns non-zero
* for write errors (which force us to terminate the entire archiving
@@ -545,15 +565,15 @@ append_archive_filename(struct bsdtar *bsdtar, struct archive *a,
archive_read_support_format_all(ina);
archive_read_support_compression_all(ina);
if (archive_read_open_file(ina, filename, 10240)) {
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(ina));
+ lafe_warnc(0, "%s", archive_error_string(ina));
bsdtar->return_value = 1;
return (0);
}
rc = append_archive(bsdtar, a, ina);
- if (archive_errno(ina)) {
- bsdtar_warnc(bsdtar, 0, "Error reading archive %s: %s",
+ if (rc != ARCHIVE_OK) {
+ lafe_warnc(0, "Error reading archive %s: %s",
filename, archive_error_string(ina));
bsdtar->return_value = 1;
}
@@ -572,7 +592,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
if (!new_enough(bsdtar, archive_entry_pathname(in_entry),
archive_entry_stat(in_entry)))
continue;
- if (excluded(bsdtar, archive_entry_pathname(in_entry)))
+ if (lafe_excluded(bsdtar->matching, archive_entry_pathname(in_entry)))
continue;
if (bsdtar->option_interactive &&
!yes("copy '%s'", archive_entry_pathname(in_entry)))
@@ -580,15 +600,13 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
if (bsdtar->verbose)
safe_fprintf(stderr, "a %s",
archive_entry_pathname(in_entry));
- siginfo_setinfo(bsdtar, "copying",
- archive_entry_pathname(in_entry),
- archive_entry_size(in_entry));
- siginfo_printinfo(bsdtar, 0);
+ if (need_report())
+ report_write(bsdtar, a, in_entry, 0);
e = archive_write_header(a, in_entry);
if (e != ARCHIVE_OK) {
if (!bsdtar->verbose)
- bsdtar_warnc(bsdtar, 0, "%s: %s",
+ lafe_warnc(0, "%s: %s",
archive_entry_pathname(in_entry),
archive_error_string(a));
else
@@ -600,7 +618,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
if (e >= ARCHIVE_WARN) {
if (archive_entry_size(in_entry) == 0)
archive_read_data_skip(ina);
- else if (copy_file_data(bsdtar, a, ina))
+ else if (copy_file_data(bsdtar, a, ina, in_entry))
exit(1);
}
@@ -614,24 +632,27 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
/* Helper function to copy data between archives. */
static int
-copy_file_data(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
+copy_file_data(struct bsdtar *bsdtar, struct archive *a,
+ struct archive *ina, struct archive_entry *entry)
{
- char buff[64*1024];
ssize_t bytes_read;
ssize_t bytes_written;
- off_t progress = 0;
+ int64_t progress = 0;
- bytes_read = archive_read_data(ina, buff, sizeof(buff));
+ bytes_read = archive_read_data(ina, bsdtar->buff, FILEDATABUFLEN);
while (bytes_read > 0) {
- siginfo_printinfo(bsdtar, progress);
+ if (need_report())
+ report_write(bsdtar, a, entry, progress);
- bytes_written = archive_write_data(a, buff, bytes_read);
+ bytes_written = archive_write_data(a, bsdtar->buff,
+ bytes_read);
if (bytes_written < bytes_read) {
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
+ lafe_warnc(0, "%s", archive_error_string(a));
return (-1);
}
progress += bytes_written;
- bytes_read = archive_read_data(ina, buff, sizeof(buff));
+ bytes_read = archive_read_data(ina, bsdtar->buff,
+ FILEDATABUFLEN);
}
return (0);
@@ -643,153 +664,240 @@ copy_file_data(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
static void
write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path)
{
+ struct archive_entry *entry = NULL, *spare_entry = NULL;
struct tree *tree;
char symlink_mode = bsdtar->symlink_mode;
dev_t first_dev = 0;
int dev_recorded = 0;
int tree_ret;
-#ifdef __linux
- int fd, r;
- unsigned long fflags;
-#endif
tree = tree_open(path);
if (!tree) {
- bsdtar_warnc(bsdtar, errno, "%s: Cannot open", path);
+ lafe_warnc(errno, "%s: Cannot open", path);
bsdtar->return_value = 1;
return;
}
- while ((tree_ret = tree_next(tree))) {
+ while ((tree_ret = tree_next(tree)) != 0) {
+ int r;
const char *name = tree_current_path(tree);
- const struct stat *st = NULL, *lst = NULL;
+ const struct stat *st = NULL; /* info to use for this entry */
+ const struct stat *lst = NULL; /* lstat() information */
int descend;
- if (tree_ret == TREE_ERROR_DIR)
- bsdtar_warnc(bsdtar, errno, "%s: Couldn't visit directory", name);
+ if (tree_ret == TREE_ERROR_FATAL)
+ lafe_errc(1, tree_errno(tree),
+ "%s: Unable to continue traversing directory tree",
+ name);
+ if (tree_ret == TREE_ERROR_DIR) {
+ lafe_warnc(errno,
+ "%s: Couldn't visit directory", name);
+ bsdtar->return_value = 1;
+ }
if (tree_ret != TREE_REGULAR)
continue;
+
+ /*
+ * If this file/dir is excluded by a filename
+ * pattern, skip it.
+ */
+ if (lafe_excluded(bsdtar->matching, name))
+ continue;
+
+ /*
+ * Get lstat() info from the tree library.
+ */
lst = tree_current_lstat(tree);
if (lst == NULL) {
/* Couldn't lstat(); must not exist. */
- bsdtar_warnc(bsdtar, errno, "%s: Cannot stat", name);
-
- /*
- * Report an error via the exit code if the failed
- * path is a prefix of what the user provided via
- * the command line. (Testing for string equality
- * here won't work due to trailing '/' characters.)
- */
- if (memcmp(name, path, strlen(name)) == 0)
- bsdtar->return_value = 1;
-
+ lafe_warnc(errno, "%s: Cannot stat", name);
+ /* Return error if files disappear during traverse. */
+ bsdtar->return_value = 1;
continue;
}
- if (S_ISLNK(lst->st_mode))
+
+ /*
+ * Distinguish 'L'/'P'/'H' symlink following.
+ */
+ switch(symlink_mode) {
+ case 'H':
+ /* 'H': After the first item, rest like 'P'. */
+ symlink_mode = 'P';
+ /* 'H': First item (from command line) like 'L'. */
+ /* FALLTHROUGH */
+ case 'L':
+ /* 'L': Do descend through a symlink to dir. */
+ descend = tree_current_is_dir(tree);
+ /* 'L': Follow symlinks to files. */
+ archive_read_disk_set_symlink_logical(bsdtar->diskreader);
+ /* 'L': Archive symlinks as targets, if we can. */
st = tree_current_stat(tree);
- /* Default: descend into any dir or symlink to dir. */
- /* We'll adjust this later on. */
- descend = 0;
- if ((st != NULL) && S_ISDIR(st->st_mode))
- descend = 1;
- if ((lst != NULL) && S_ISDIR(lst->st_mode))
- descend = 1;
+ if (st != NULL)
+ break;
+ /* If stat fails, we have a broken symlink;
+ * in that case, don't follow the link. */
+ /* FALLTHROUGH */
+ default:
+ /* 'P': Don't descend through a symlink to dir. */
+ descend = tree_current_is_physical_dir(tree);
+ /* 'P': Don't follow symlinks to files. */
+ archive_read_disk_set_symlink_physical(bsdtar->diskreader);
+ /* 'P': Archive symlinks as symlinks. */
+ st = lst;
+ break;
+ }
/*
- * If user has asked us not to cross mount points,
- * then don't descend into into a dir on a different
- * device.
+ * Are we about to cross to a new filesystem?
*/
if (!dev_recorded) {
+ /* This is the initial file system. */
first_dev = lst->st_dev;
dev_recorded = 1;
- }
- if (bsdtar->option_dont_traverse_mounts) {
- if (lst != NULL && lst->st_dev != first_dev)
- descend = 0;
+ } else if (lst->st_dev == first_dev) {
+ /* The starting file system is always acceptable. */
+ } else if (descend == 0) {
+ /* We're not descending, so no need to check. */
+ } else if (bsdtar->option_dont_traverse_mounts) {
+ /* User has asked us not to cross mount points. */
+ descend = 0;
+ } else {
+ /* We're prepared to cross a mount point. */
+
+ /* XXX TODO: check whether this filesystem is
+ * synthetic and/or local. Add a new
+ * --local-only option to skip non-local
+ * filesystems. Skip synthetic filesystems
+ * regardless.
+ *
+ * The results should be cached, since
+ * tree.c doesn't usually visit a directory
+ * and the directory contents together. A simple
+ * move-to-front list should perform quite well.
+ *
+ * This is going to be heavily OS dependent:
+ * FreeBSD's statfs() in conjunction with getvfsbyname()
+ * provides all of this; NetBSD's statvfs() does
+ * most of it; other systems will vary.
+ */
}
/*
- * If this file/dir is flagged "nodump" and we're
- * honoring such flags, skip this file/dir.
+ * In -u mode, check that the file is newer than what's
+ * already in the archive; in all modes, obey --newerXXX flags.
*/
-#ifdef HAVE_CHFLAGS
- if (bsdtar->option_honor_nodump &&
- (lst->st_flags & UF_NODUMP))
+ if (!new_enough(bsdtar, name, st))
continue;
+
+ archive_entry_free(entry);
+ entry = archive_entry_new();
+
+ archive_entry_set_pathname(entry, name);
+ archive_entry_copy_sourcepath(entry,
+ tree_current_access_path(tree));
+
+ /* Populate the archive_entry with metadata from the disk. */
+ /* XXX TODO: Arrange to open a regular file before
+ * calling this so we can pass in an fd and shorten
+ * the race to query metadata. The linkify dance
+ * makes this more complex than it might sound. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* TODO: tree.c uses stat(), which is badly broken
+ * on Windows. To fix this, we should
+ * deprecate tree_current_stat() and provide a new
+ * call tree_populate_entry(t, entry). This call
+ * would use stat() internally on POSIX and
+ * GetInfoByFileHandle() internally on Windows.
+ * This would be another step towards a tree-walker
+ * that can be integrated deep into libarchive.
+ * For now, just set st to NULL on Windows;
+ * archive_read_disk_entry_from_file() should
+ * be smart enough to use platform-appropriate
+ * ways to probe file information.
+ */
+ st = NULL;
#endif
+ r = archive_read_disk_entry_from_file(bsdtar->diskreader,
+ entry, -1, st);
+ if (r != ARCHIVE_OK)
+ lafe_warnc(archive_errno(bsdtar->diskreader),
+ "%s", archive_error_string(bsdtar->diskreader));
+ if (r < ARCHIVE_WARN)
+ continue;
+
+ /* XXX TODO: Just use flag data from entry; avoid the
+ * duplicate check here. */
-#ifdef __linux
/*
- * Linux has a nodump flag too but to read it
- * we have to open() the file/dir and do an ioctl on it...
+ * If this file/dir is flagged "nodump" and we're
+ * honoring such flags, skip this file/dir.
*/
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
+ /* BSD systems store flags in struct stat */
if (bsdtar->option_honor_nodump &&
- ((fd = open(name, O_RDONLY|O_NONBLOCK)) >= 0) &&
- ((r = ioctl(fd, EXT2_IOC_GETFLAGS, &fflags)),
- close(fd), r) >= 0 &&
- (fflags & EXT2_NODUMP_FL))
+ (lst->st_flags & UF_NODUMP))
continue;
#endif
- /*
- * If this file/dir is excluded by a filename
- * pattern, skip it.
- */
- if (excluded(bsdtar, name))
- continue;
+#if defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL)
+ /* Linux uses ioctl to read flags. */
+ if (bsdtar->option_honor_nodump) {
+ int fd = open(name, O_RDONLY | O_NONBLOCK);
+ if (fd >= 0) {
+ unsigned long fflags;
+ int r = ioctl(fd, EXT2_IOC_GETFLAGS, &fflags);
+ close(fd);
+ if (r >= 0 && (fflags & EXT2_NODUMP_FL))
+ continue;
+ }
+ }
+#endif
/*
* If the user vetoes this file/directory, skip it.
+ * We want this to be fairly late; if some other
+ * check would veto this file, we shouldn't bother
+ * the user with it.
*/
if (bsdtar->option_interactive &&
!yes("add '%s'", name))
continue;
- /*
- * If this is a dir, decide whether or not to recurse.
- */
- if (bsdtar->option_no_subdirs)
- descend = 0;
+ /* Note: if user vetoes, we won't descend. */
+ if (descend && !bsdtar->option_no_subdirs)
+ tree_descend(tree);
/*
- * Distinguish 'L'/'P'/'H' symlink following.
+ * Rewrite the pathname to be archived. If rewrite
+ * fails, skip the entry.
*/
- switch(symlink_mode) {
- case 'H':
- /* 'H': After the first item, rest like 'P'. */
- symlink_mode = 'P';
- /* 'H': First item (from command line) like 'L'. */
- /* FALLTHROUGH */
- case 'L':
- /* 'L': Do descend through a symlink to dir. */
- /* 'L': Archive symlink to file as file. */
- lst = tree_current_stat(tree);
- /* If stat fails, we have a broken symlink;
- * in that case, archive the link as such. */
- if (lst == NULL)
- lst = tree_current_lstat(tree);
- break;
- default:
- /* 'P': Don't descend through a symlink to dir. */
- if (!S_ISDIR(lst->st_mode))
- descend = 0;
- /* 'P': Archive symlink to file as symlink. */
- /* lst = tree_current_lstat(tree); */
- break;
- }
+ if (edit_pathname(bsdtar, entry))
+ continue;
- if (descend)
- tree_descend(tree);
+ /* Display entry as we process it.
+ * This format is required by SUSv2. */
+ if (bsdtar->verbose)
+ safe_fprintf(stderr, "a %s",
+ archive_entry_pathname(entry));
- /*
- * Write the entry. Note that write_entry() handles
- * pathname editing and newness testing.
- */
- write_entry(bsdtar, a, lst, name,
- tree_current_access_path(tree));
+ /* Non-regular files get archived with zero size. */
+ if (archive_entry_filetype(entry) != AE_IFREG)
+ archive_entry_set_size(entry, 0);
+
+ archive_entry_linkify(bsdtar->resolver, &entry, &spare_entry);
+
+ while (entry != NULL) {
+ write_entry_backend(bsdtar, a, entry);
+ archive_entry_free(entry);
+ entry = spare_entry;
+ spare_entry = NULL;
+ }
+
+ if (bsdtar->verbose)
+ fprintf(stderr, "\n");
}
+ archive_entry_free(entry);
tree_close(tree);
}
@@ -798,16 +906,17 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path)
*/
static void
write_entry_backend(struct bsdtar *bsdtar, struct archive *a,
- struct archive_entry *entry, int fd)
+ struct archive_entry *entry)
{
+ int fd = -1;
int e;
- if (fd == -1 && archive_entry_size(entry) > 0) {
+ if (archive_entry_size(entry) > 0) {
const char *pathname = archive_entry_sourcepath(entry);
fd = open(pathname, O_RDONLY);
if (fd == -1) {
if (!bsdtar->verbose)
- bsdtar_warnc(bsdtar, errno,
+ lafe_warnc(errno,
"%s: could not open file", pathname);
else
fprintf(stderr, ": %s", strerror(errno));
@@ -818,7 +927,7 @@ write_entry_backend(struct bsdtar *bsdtar, struct archive *a,
e = archive_write_header(a, entry);
if (e != ARCHIVE_OK) {
if (!bsdtar->verbose)
- bsdtar_warnc(bsdtar, 0, "%s: %s",
+ lafe_warnc(0, "%s: %s",
archive_entry_pathname(entry),
archive_error_string(a));
else
@@ -835,499 +944,79 @@ write_entry_backend(struct bsdtar *bsdtar, struct archive *a,
* that case, just skip the write.
*/
if (e >= ARCHIVE_WARN && fd >= 0 && archive_entry_size(entry) > 0) {
- if (write_file_data(bsdtar, a, fd))
+ if (write_file_data(bsdtar, a, entry, fd))
exit(1);
- close(fd);
}
-}
-
-/*
- * Add a single filesystem object to the archive.
- */
-static void
-write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st,
- const char *pathname, const char *accpath)
-{
- struct archive_entry *entry, *sparse_entry;
- int fd;
-#ifdef __linux
- int r;
- unsigned long stflags;
-#endif
- static char linkbuffer[PATH_MAX+1];
-
- fd = -1;
- entry = archive_entry_new();
-
- archive_entry_set_pathname(entry, pathname);
- archive_entry_copy_sourcepath(entry, accpath);
/*
- * Rewrite the pathname to be archived. If rewrite
- * fails, skip the entry.
+ * If we opened a file, close it now even if there was an error
+ * which made us decide not to write the archive body.
*/
- if (edit_pathname(bsdtar, entry))
- goto abort;
-
- /*
- * In -u mode, check that the file is newer than what's
- * already in the archive; in all modes, obey --newerXXX flags.
- */
- if (!new_enough(bsdtar, archive_entry_pathname(entry), st))
- goto abort;
-
- /* Display entry as we process it. This format is required by SUSv2. */
- if (bsdtar->verbose)
- safe_fprintf(stderr, "a %s", archive_entry_pathname(entry));
-
- /* Read symbolic link information. */
- if ((st->st_mode & S_IFMT) == S_IFLNK) {
- int lnklen;
-
- lnklen = readlink(accpath, linkbuffer, PATH_MAX);
- if (lnklen < 0) {
- if (!bsdtar->verbose)
- bsdtar_warnc(bsdtar, errno,
- "%s: Couldn't read symbolic link",
- pathname);
- else
- safe_fprintf(stderr,
- ": Couldn't read symbolic link: %s",
- strerror(errno));
- goto cleanup;
- }
- linkbuffer[lnklen] = 0;
- archive_entry_set_symlink(entry, linkbuffer);
- }
-
- /* Look up username and group name. */
- archive_entry_set_uname(entry, lookup_uname(bsdtar, st->st_uid));
- archive_entry_set_gname(entry, lookup_gname(bsdtar, st->st_gid));
-
-#ifdef HAVE_CHFLAGS
- if (st->st_flags != 0)
- archive_entry_set_fflags(entry, st->st_flags, 0);
-#endif
-
-#ifdef __linux
- if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode)) &&
- ((fd = open(accpath, O_RDONLY|O_NONBLOCK)) >= 0) &&
- ((r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags)), close(fd), (fd = -1), r) >= 0 &&
- stflags) {
- archive_entry_set_fflags(entry, stflags, 0);
- }
-#endif
-
- archive_entry_copy_stat(entry, st);
- setup_acls(bsdtar, entry, accpath);
- setup_xattrs(bsdtar, entry, accpath);
-
- /* Non-regular files get archived with zero size. */
- if (!S_ISREG(st->st_mode))
- archive_entry_set_size(entry, 0);
-
- /* Record what we're doing, for the benefit of SIGINFO / SIGUSR1. */
- siginfo_setinfo(bsdtar, "adding", archive_entry_pathname(entry),
- archive_entry_size(entry));
- archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
-
- /* Handle SIGINFO / SIGUSR1 request if one was made. */
- siginfo_printinfo(bsdtar, 0);
-
- while (entry != NULL) {
- write_entry_backend(bsdtar, a, entry, fd);
- fd = -1;
- archive_entry_free(entry);
- entry = sparse_entry;
- sparse_entry = NULL;
- }
-
-cleanup:
- if (bsdtar->verbose)
- fprintf(stderr, "\n");
-
-abort:
if (fd >= 0)
close(fd);
+}
- archive_entry_free(entry);
+static void
+report_write(struct bsdtar *bsdtar, struct archive *a,
+ struct archive_entry *entry, int64_t progress)
+{
+ uint64_t comp, uncomp;
+ if (bsdtar->verbose)
+ fprintf(stderr, "\n");
+ comp = archive_position_compressed(a);
+ uncomp = archive_position_uncompressed(a);
+ fprintf(stderr, "In: %d files, %s bytes;",
+ archive_file_count(a), tar_i64toa(uncomp));
+ fprintf(stderr,
+ " Out: %s bytes, compression %d%%\n",
+ tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp));
+ /* Can't have two calls to tar_i64toa() pending, so split the output. */
+ safe_fprintf(stderr, "Current: %s (%s",
+ archive_entry_pathname(entry),
+ tar_i64toa(progress));
+ fprintf(stderr, "/%s bytes)\n",
+ tar_i64toa(archive_entry_size(entry)));
}
-/* Helper function to copy file to archive, with stack-allocated buffer. */
+/* Helper function to copy file to archive. */
static int
-write_file_data(struct bsdtar *bsdtar, struct archive *a, int fd)
+write_file_data(struct bsdtar *bsdtar, struct archive *a,
+ struct archive_entry *entry, int fd)
{
- char buff[64*1024];
ssize_t bytes_read;
ssize_t bytes_written;
- off_t progress = 0;
-
- /* XXX TODO: Allocate buffer on heap and store pointer to
- * it in bsdtar structure; arrange cleanup as well. XXX */
+ int64_t progress = 0;
- bytes_read = read(fd, buff, sizeof(buff));
+ bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN);
while (bytes_read > 0) {
- siginfo_printinfo(bsdtar, progress);
+ if (need_report())
+ report_write(bsdtar, a, entry, progress);
- bytes_written = archive_write_data(a, buff, bytes_read);
+ bytes_written = archive_write_data(a, bsdtar->buff,
+ bytes_read);
if (bytes_written < 0) {
/* Write failed; this is bad */
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
+ lafe_warnc(0, "%s", archive_error_string(a));
return (-1);
}
if (bytes_written < bytes_read) {
/* Write was truncated; warn but continue. */
- bsdtar_warnc(bsdtar, 0,
- "Truncated write; file may have grown while being archived.");
+ lafe_warnc(0,
+ "%s: Truncated write; file may have grown while being archived.",
+ archive_entry_pathname(entry));
return (0);
}
progress += bytes_written;
- bytes_read = read(fd, buff, sizeof(buff));
+ bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN);
}
return 0;
}
-
-static void
-create_cleanup(struct bsdtar *bsdtar)
-{
- free_cache(bsdtar->uname_cache);
- bsdtar->uname_cache = NULL;
- free_cache(bsdtar->gname_cache);
- bsdtar->gname_cache = NULL;
-}
-
-#ifdef HAVE_POSIX_ACL
-static void setup_acl(struct bsdtar *bsdtar,
- struct archive_entry *entry, const char *accpath,
- int acl_type, int archive_entry_acl_type);
-
-static void
-setup_acls(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath)
-{
- archive_entry_acl_clear(entry);
-
- setup_acl(bsdtar, entry, accpath,
- ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
- /* Only directories can have default ACLs. */
- if (S_ISDIR(archive_entry_mode(entry)))
- setup_acl(bsdtar, entry, accpath,
- ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
-}
-
-static void
-setup_acl(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath, int acl_type, int archive_entry_acl_type)
-{
- acl_t acl;
- acl_tag_t acl_tag;
- acl_entry_t acl_entry;
- acl_permset_t acl_permset;
- int s, ae_id, ae_tag, ae_perm;
- const char *ae_name;
-
- /* Retrieve access ACL from file. */
- acl = acl_get_file(accpath, acl_type);
- if (acl != NULL) {
- s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
- while (s == 1) {
- ae_id = -1;
- ae_name = NULL;
-
- acl_get_tag_type(acl_entry, &acl_tag);
- if (acl_tag == ACL_USER) {
- ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry);
- ae_name = lookup_uname(bsdtar, ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
- } else if (acl_tag == ACL_GROUP) {
- ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry);
- ae_name = lookup_gname(bsdtar, ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- } else if (acl_tag == ACL_MASK) {
- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
- } else if (acl_tag == ACL_USER_OBJ) {
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- } else if (acl_tag == ACL_GROUP_OBJ) {
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- } else if (acl_tag == ACL_OTHER) {
- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
- } else {
- /* Skip types that libarchive can't support. */
- continue;
- }
-
- acl_get_permset(acl_entry, &acl_permset);
- ae_perm = 0;
- /*
- * acl_get_perm() is spelled differently on different
- * platforms; see bsdtar_platform.h for details.
- */
- if (ACL_GET_PERM(acl_permset, ACL_EXECUTE))
- ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE;
- if (ACL_GET_PERM(acl_permset, ACL_READ))
- ae_perm |= ARCHIVE_ENTRY_ACL_READ;
- if (ACL_GET_PERM(acl_permset, ACL_WRITE))
- ae_perm |= ARCHIVE_ENTRY_ACL_WRITE;
-
- archive_entry_acl_add_entry(entry,
- archive_entry_acl_type, ae_perm, ae_tag,
- ae_id, ae_name);
-
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
- }
- acl_free(acl);
- }
-}
-#else
-static void
-setup_acls(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath)
-{
- (void)bsdtar;
- (void)entry;
- (void)accpath;
-}
-#endif
-
-#if HAVE_LISTXATTR && HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR
-
-static void
-setup_xattr(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath, const char *name)
-{
- size_t size;
- void *value = NULL;
- char symlink_mode = bsdtar->symlink_mode;
-
- if (symlink_mode == 'H')
- size = getxattr(accpath, name, NULL, 0);
- else
- size = lgetxattr(accpath, name, NULL, 0);
-
- if (size == -1) {
- bsdtar_warnc(bsdtar, errno, "Couldn't get extended attribute");
- return;
- }
-
- if (size > 0 && (value = malloc(size)) == NULL) {
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
- return;
- }
-
- if (symlink_mode == 'H')
- size = getxattr(accpath, name, value, size);
- else
- size = lgetxattr(accpath, name, value, size);
-
- if (size == -1) {
- bsdtar_warnc(bsdtar, errno, "Couldn't get extended attribute");
- return;
- }
-
- archive_entry_xattr_add_entry(entry, name, value, size);
-
- free(value);
-}
-
-/*
- * Linux extended attribute support
- */
-static void
-setup_xattrs(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath)
-{
- char *list, *p;
- size_t list_size;
- char symlink_mode = bsdtar->symlink_mode;
-
- if (symlink_mode == 'H')
- list_size = listxattr(accpath, NULL, 0);
- else
- list_size = llistxattr(accpath, NULL, 0);
-
- if (list_size == -1) {
- bsdtar_warnc(bsdtar, errno,
- "Couldn't list extended attributes");
- return;
- } else if (list_size == 0)
- return;
-
- if ((list = malloc(list_size)) == NULL) {
- bsdtar_errc(bsdtar, 1, errno, "Out of memory");
- return;
- }
-
- if (symlink_mode == 'H')
- list_size = listxattr(accpath, list, list_size);
- else
- list_size = llistxattr(accpath, list, list_size);
-
- if (list_size == -1) {
- bsdtar_warnc(bsdtar, errno,
- "Couldn't list extended attributes");
- free(list);
- return;
- }
-
- for (p = list; (p - list) < list_size; p += strlen(p) + 1) {
- if (strncmp(p, "system.", 7) == 0 ||
- strncmp(p, "xfsroot.", 8) == 0)
- continue;
-
- setup_xattr(bsdtar, entry, accpath, p);
- }
-
- free(list);
-}
-
-#else
-
-/*
- * Generic (stub) extended attribute support.
- */
-static void
-setup_xattrs(struct bsdtar *bsdtar, struct archive_entry *entry,
- const char *accpath)
-{
- (void)bsdtar; /* UNUSED */
- (void)entry; /* UNUSED */
- (void)accpath; /* UNUSED */
-}
-
-#endif
-
-static void
-free_cache(struct name_cache *cache)
-{
- size_t i;
-
- if (cache != NULL) {
- for (i = 0; i < cache->size; i++) {
- if (cache->cache[i].name != NULL &&
- cache->cache[i].name != NO_NAME)
- free((void *)(uintptr_t)cache->cache[i].name);
- }
- free(cache);
- }
-}
-
-/*
- * Lookup uid/gid from uname/gname, return NULL if no match.
- */
-static const char *
-lookup_name(struct bsdtar *bsdtar, struct name_cache **name_cache_variable,
- int (*lookup_fn)(struct bsdtar *, const char **, id_t), id_t id)
-{
- struct name_cache *cache;
- const char *name;
- int slot;
-
-
- if (*name_cache_variable == NULL) {
- *name_cache_variable = malloc(sizeof(struct name_cache));
- if (*name_cache_variable == NULL)
- bsdtar_errc(bsdtar, 1, ENOMEM, "No more memory");
- memset(*name_cache_variable, 0, sizeof(struct name_cache));
- (*name_cache_variable)->size = name_cache_size;
- }
-
- cache = *name_cache_variable;
- cache->probes++;
-
- slot = id % cache->size;
- if (cache->cache[slot].name != NULL) {
- if (cache->cache[slot].id == id) {
- cache->hits++;
- if (cache->cache[slot].name == NO_NAME)
- return (NULL);
- return (cache->cache[slot].name);
- }
- if (cache->cache[slot].name != NO_NAME)
- free((void *)(uintptr_t)cache->cache[slot].name);
- cache->cache[slot].name = NULL;
- }
-
- if (lookup_fn(bsdtar, &name, id) == 0) {
- if (name == NULL || name[0] == '\0') {
- /* Cache the negative response. */
- cache->cache[slot].name = NO_NAME;
- cache->cache[slot].id = id;
- } else {
- cache->cache[slot].name = strdup(name);
- if (cache->cache[slot].name != NULL) {
- cache->cache[slot].id = id;
- return (cache->cache[slot].name);
- }
- /*
- * Conveniently, NULL marks an empty slot, so
- * if the strdup() fails, we've just failed to
- * cache it. No recovery necessary.
- */
- }
- }
- return (NULL);
-}
-
-static const char *
-lookup_uname(struct bsdtar *bsdtar, uid_t uid)
-{
- return (lookup_name(bsdtar, &bsdtar->uname_cache,
- &lookup_uname_helper, (id_t)uid));
-}
-
-static int
-lookup_uname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
-{
- struct passwd *pwent;
-
- (void)bsdtar; /* UNUSED */
-
- errno = 0;
- pwent = getpwuid((uid_t)id);
- if (pwent == NULL) {
- *name = NULL;
- if (errno != 0)
- bsdtar_warnc(bsdtar, errno, "getpwuid(%d) failed", id);
- return (errno);
- }
-
- *name = pwent->pw_name;
- return (0);
-}
-
-static const char *
-lookup_gname(struct bsdtar *bsdtar, gid_t gid)
-{
- return (lookup_name(bsdtar, &bsdtar->gname_cache,
- &lookup_gname_helper, (id_t)gid));
-}
-
-static int
-lookup_gname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
-{
- struct group *grent;
-
- (void)bsdtar; /* UNUSED */
-
- errno = 0;
- grent = getgrgid((gid_t)id);
- if (grent == NULL) {
- *name = NULL;
- if (errno != 0)
- bsdtar_warnc(bsdtar, errno, "getgrgid(%d) failed", id);
- return (errno);
- }
-
- *name = grent->gr_name;
- return (0);
-}
-
/*
* Test if the specified file is new enough to include in the archive.
*/
-int
+static int
new_enough(struct bsdtar *bsdtar, const char *path, const struct stat *st)
{
struct archive_dir_entry *p;
@@ -1398,11 +1087,11 @@ add_dir_list(struct bsdtar *bsdtar, const char *path,
p = malloc(sizeof(*p));
if (p == NULL)
- bsdtar_errc(bsdtar, 1, ENOMEM, "Can't read archive directory");
+ lafe_errc(1, ENOMEM, "Can't read archive directory");
p->name = strdup(path);
if (p->name == NULL)
- bsdtar_errc(bsdtar, 1, ENOMEM, "Can't read archive directory");
+ lafe_errc(1, ENOMEM, "Can't read archive directory");
p->mtime_sec = mtime_sec;
p->mtime_nsec = mtime_nsec;
p->next = NULL;
@@ -1414,25 +1103,32 @@ add_dir_list(struct bsdtar *bsdtar, const char *path,
}
}
-void
+static void
test_for_append(struct bsdtar *bsdtar)
{
struct stat s;
if (*bsdtar->argv == NULL && bsdtar->names_from_file == NULL)
- bsdtar_errc(bsdtar, 1, 0, "no files or directories specified");
+ lafe_errc(1, 0, "no files or directories specified");
if (bsdtar->filename == NULL)
- bsdtar_errc(bsdtar, 1, 0, "Cannot append to stdout.");
+ lafe_errc(1, 0, "Cannot append to stdout.");
if (bsdtar->create_compression != 0)
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Cannot append to %s with compression", bsdtar->filename);
if (stat(bsdtar->filename, &s) != 0)
return;
if (!S_ISREG(s.st_mode) && !S_ISBLK(s.st_mode))
- bsdtar_errc(bsdtar, 1, 0,
+ lafe_errc(1, 0,
"Cannot append to %s: not a regular file.",
bsdtar->filename);
+
+/* Is this an appropriate check here on Windows? */
+/*
+ if (GetFileType(handle) != FILE_TYPE_DISK)
+ lafe_errc(1, 0, "Cannot append");
+*/
+
}